code: def convert(
      input_nemo_file,
      output_nemo_file,
      skip_if_output_exists=True,
      cpu_only=False,
      ignore_if_missing=tuple(),
  ):
      if skip_if_output_exists and os.path.exists(output_nemo_file):
          logging.info(
              f"Output file already exists ({output_nemo_file}), skipping conversion..."
          )
          logging.info(
              "If you want to overwrite the output file, please run with --overwrite flag"
          )
          return
      nemo_model = restore_model(input_nemo_file, cpu_only=cpu_only)
  
      nemo_tokenizer_model = nemo_model.cfg.tokenizer.model
      nemo_state_dict = nemo_model.state_dict()
      mcore_state_dict = OrderedDict()
      for mcore_param, nemo_param in build_key_mapping(
          nemo_model.cfg
      ).items():
          if mcore_param.endswith("linear_fc1.weight"):
              # in llama models, need to concat dense_h_to_4h.weight and dense_h_to_4h_2.weight for the corresponding linear_fc1.weight
              second_param = nemo_param.replace(
                  "dense_h_to_4h.weight", "dense_h_to_4h_2.weight"
              )
              if second_param in nemo_state_dict:
                  mcore_state_dict[mcore_param] = torch.cat(
                      [
                          nemo_state_dict[nemo_param],
                          nemo_state_dict[second_param],
                      ],
                      dim=0,
                  )
              else:
                  mcore_state_dict[mcore_param] = nemo_state_dict[
                      nemo_param
                  ]
          else:
              mcore_state_dict[mcore_param] = nemo_state_dict[
                  nemo_param
              ]
  
      mcore_model = get_mcore_model_from_nemo_file(
          input_nemo_file, cpu_only=cpu_only
      )
      mcore_model = load_model(
          mcore_model,
          mcore_state_dict,
          ignore_if_missing=ignore_if_missing,
      )
  
      if nemo_model.cfg.tokenizer.model is not None:
          logging.info(
              "registering artifact: tokenizer.model = "
              + nemo_tokenizer_model
          )
          mcore_model.register_artifact(
              "tokenizer.model", nemo_tokenizer_model
          )
  
      mcore_model.cfg.use_cpu_initialization = False
      mcore_model.save_to(output_nemo_file)
      logging.info(f"✅ Done. Model saved to {output_nemo_file}")
      del mcore_model
      del nemo_model
  
file_path: NeMo/scripts/nlp_language_modeling/convert_nemo_gpt_to_mcore.py
imports: import os
  from argparse import ArgumentParser
  from collections import OrderedDict
  import torch
  from omegaconf import OmegaConf, open_dict
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy
  from nemo.utils import AppState, logging
label_desc: Use image node_id 7 for calling a global function with example usage: convert(input_nemo_file, output_nemo_file, skip_if_output_exists, cpu_only, ignore_if_missing) without return types