code: def main(
      config_path, encoder_ckpt, decoder_ckpt, output_path, model_type
  ):
      yaml = YAML(typ="safe")
      with open(config_path) as f:
          params = yaml.load(f)
  
      model = None
      if model_type == "asr":
          logging.info("Creating ASR NeMo 1.0 model")
          model = nemo_asr.models.EncDecCTCModel(
              cfg=DictConfig(params["model"])
          )
      elif model_type == "speech_label":
          logging.info("Creating speech label NeMo 1.0 model")
          model = nemo_asr.models.EncDecClassificationModel(
              cfg=DictConfig(params["model"])
          )
      else:
          logging.info("Creating Speaker Recognition NeMo 1.0 model")
          model = nemo_asr.models.EncDecSpeakerLabelModel(
              cfg=DictConfig(params["model"])
          )
  
      model.encoder.load_state_dict(torch.load(encoder_ckpt))
      model.decoder.load_state_dict(torch.load(decoder_ckpt))
      logging.info("Succesfully ported old checkpoint")
  
      model.save_to(output_path)
      logging.info("new model saved at {}".format(output_path))
  
imports: import argparse
  import torch
  from omegaconf import DictConfig
  from ruamel.yaml import YAML
  import nemo.collections.asr
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: main(config_path, encoder_ckpt, decoder_ckpt, output_path, model_type) without return types