code: def load_lora(lora_nemo, tp):
      lora_state_dict = {}
      with tempfile.TemporaryDirectory() as tmpdir:
          NLPSaveRestoreConnector._unpack_nemo_file(lora_nemo, tmpdir)
          # assert os.path.isdir(lora_extracted_dir), "requires the untar'ed the lora .nemo file"
          for i in range(tp):
              if tp == 1:
                  ckpt_file = f"{tmpdir}/model_weights.ckpt"
              else:
                  ckpt_file = (
                      f"{tmpdir}/mp_rank_0{i}/model_weights.ckpt"
                  )
  
              l = torch.load(
                  ckpt_file, map_location=torch.device("cpu")
              )
              lora_state_dict[i] = l
          config_file = f"{tmpdir}/model_config.yaml"
          lora_config = OmegaConf.load(config_file)
          return lora_state_dict, lora_config
  
imports: import os
  import tempfile
  from typing import Any, Dict
  import torch
  from omegaconf import OmegaConf, open_dict
  from pytorch_lightning.trainer.trainer import Trainer
  from torch.utils.data import DataLoader, Dataset
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_sft_model import MegatronGPTSFTModel
  from nemo.collections.nlp.modules.common.megatron.megatron_init import fake_initialize_model_parallel
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy, NLPSaveRestoreConnector
  from nemo.core.config import hydra_runner
  from nemo.utils import logging
  from nemo.utils.app_state import AppState
  from nemo.utils.model_utils import inject_model_parallel_rank
label_desc: Use image node_id 1 for calling a global function with example usage: load_lora(lora_nemo, tp) and returns: lora_state_dict,  lora_config