code: def get_model_config(model_class):
      preprocessor_config = {
          "_target_": "nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor"
      }
      vocabulary = [
          " ",
          "'",
          "a",
          "b",
          "c",
      ]  # does not matter, so keeping small
      encoder_config = {
          "_target_": "nemo.collections.asr.modules.ConformerEncoder",
          "feat_in": 64,
          "n_layers": 8,
          "d_model": 4,
      }
      if model_class is EncDecCTCModel:
          decoder_config = {
              "_target_": "nemo.collections.asr.modules.ConvASRDecoder",
              "feat_in": None,
              "num_classes": len(vocabulary),
              "vocabulary": vocabulary,
          }
          model_config = DictConfig(
              {
                  "compute_eval_loss": True,  # will be ignored by the model
                  "preprocessor": DictConfig(preprocessor_config),
                  "encoder": DictConfig(encoder_config),
                  "decoder": DictConfig(decoder_config),
              }
          )
      else:
          decoder_config = {
              "_target_": "nemo.collections.asr.modules.RNNTDecoder",
              "prednet": {"pred_hidden": 4, "pred_rnn_layers": 1},
          }
          joint_config = {
              "_target_": "nemo.collections.asr.modules.RNNTJoint",
              "jointnet": {"joint_hidden": 4, "activation": "relu"},
          }
          decoding_config = {
              "strategy": "greedy_batch",
              "greedy": {"max_symbols": 30},
          }
          loss_config = {
              "loss_name": "default",
              "warprnnt_numba_kwargs": {"fastemit_lambda": 0.001},
          }
  
          model_config = DictConfig(
              {
                  "compute_eval_loss": True,
                  "labels": ListConfig(vocabulary),
                  "preprocessor": DictConfig(preprocessor_config),
                  "model_defaults": DictConfig(
                      {"enc_hidden": 4, "pred_hidden": 4}
                  ),
                  "encoder": DictConfig(encoder_config),
                  "decoder": DictConfig(decoder_config),
                  "joint": DictConfig(joint_config),
                  "decoding": DictConfig(decoding_config),
                  "loss": DictConfig(loss_config),
                  "optim": {"name": "adamw"},
                  "aux_ctc": {
                      "ctc_loss_weight": 0.3,
                      "use_cer": False,
                      "ctc_reduction": "mean_batch",
                      "decoder": {
                          "_target_": "nemo.collections.asr.modules.ConvASRDecoder",
                          "feat_in": None,
                          "num_classes": len(vocabulary),
                          "vocabulary": vocabulary,
                      },
                      "decoding": DictConfig(CTCDecodingConfig),
                  },
              }
          )
      model_config[
          "target"
      ] = f"{model_class.__module__}.{model_class.__name__}"
  
      return model_config
  
file_path: NeMo/tests/collections/asr/test_confidence_ensembles.py
imports: import joblib
  import pytest
  from omegaconf import DictConfig, ListConfig
  from nemo.collections.asr.models import EncDecCTCModel, EncDecHybridRNNTCTCModel, EncDecRNNTModel
  from nemo.collections.asr.models.confidence_ensemble import ConfidenceEnsembleModel
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCDecodingConfig
  from nemo.collections.asr.parts.utils.asr_confidence_utils import ConfidenceConfig, ConfidenceMethodConfig
label_desc: Use image node_id 1 for calling a global function with example usage: get_model_config(model_class) and returns: model_config