code: def get_model_class(cfg):
      if cfg.model_type == "gpt":
          return MegatronGPTModel
      elif cfg.model_type == "bert":
          return MegatronBertModel
      elif cfg.model_type == "t5":
          return MegatronT5Model
      elif cfg.model_type == "bart":
          return MegatronBARTModel
      elif cfg.model_type == "nmt":
          return MegatronNMTModel
      elif cfg.model_type == "retro":
          return MegatronRetrievalModel
      else:
          raise ValueError("Invalid Model Type")
  
file_path: NeMo/examples/nlp/language_modeling/megatron_export.py
imports: import os
  from omegaconf import OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from nemo.collections.nlp.models.language_modeling.megatron_bart_model import MegatronBARTModel
  from nemo.collections.nlp.models.language_modeling.megatron_bert_model import MegatronBertModel
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.models.language_modeling.megatron_retrieval_model import MegatronRetrievalModel
  from nemo.collections.nlp.models.language_modeling.megatron_t5_model import MegatronT5Model
  from nemo.collections.nlp.models.machine_translation.megatron_nmt_model import MegatronNMTModel
  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 import ModelPT
  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: get_model_class(cfg) and returns: MegatronGPTModel, MegatronBertModel, MegatronT5Model, MegatronBARTModel, MegatronNMTModel, MegatronRetrievalModel