code: def main(cfg):
      logging.info(f"Hydra config: {OmegaConf.to_yaml(cfg)}")
  
      if (
          cfg.model.pretrained_model is None
          and cfg.model.nemo_model is None
      ):
          raise ValueError(
              "Either set `cfg.model.nemo_model` or `cfg.model.pretrained_model`"
          )
      if (
          cfg.model.pretrained_model is not None
          and cfg.model.nemo_model is not None
      ):
          raise ValueError(
              "Cannot set `cfg.model.nemo_model` and `cfg.model.pretrained_model`. Select one only."
          )
  
      trainer = pl.Trainer(**cfg.trainer)
      exp_manager(trainer, cfg.get("exp_manager", None))
  
      if cfg.model.pretrained_model is not None:
          model_cfg = ASRModel.from_pretrained(
              cfg.model.pretrained_model, return_config=True
          )
          update_encoder_config_to_support_adapter(model_cfg)
          model = ASRModel.from_pretrained(
              cfg.model.pretrained_model,
              override_config_path=model_cfg,
              trainer=trainer,
          )
  
      else:
          model_cfg = ASRModel.restore_from(
              cfg.model.nemo_model, return_config=True
          )
          update_encoder_config_to_support_adapter(model_cfg)
          model = ASRModel.restore_from(
              cfg.model.nemo_model,
              override_config_path=model_cfg,
              trainer=trainer,
          )
  
      # Setup model for finetuning (train and validation only)
      cfg.model.test_ds = update_model_cfg(
          model.cfg.test_ds, cfg.model.test_ds
      )
  
      # Call the dataloaders and optimizer + scheduler
      model.setup_multiple_test_data(cfg.model.test_ds)
  
      # Setup adapters
      with open_dict(cfg.model.adapter):
          adapter_name = cfg.model.adapter.pop("adapter_name", None)
  
      # Disable all other adapters, enable just the current adapter.
      model.set_enabled_adapters(
          enabled=False
      )  # disable all adapters prior to training
  
      if adapter_name is not None:
          model.set_enabled_adapters(
              adapter_name, enabled=True
          )  # enable just one adapter by name if provided
  
      # First, Freeze all the weights of the model (not just encoder, everything)
      model.freeze()
  
      # Finally, train model
      trainer.test(model)
  
file_path: NeMo/examples/asr/asr_adapters/eval_asr_adapter.py
imports: import pytorch_lightning
  from omegaconf import OmegaConf, open_dict
  from nemo.collections.asr.models import ASRModel
  from nemo.core import adapter_mixins
  from nemo.core.config import hydra_runner
  from nemo.utils import logging
  from nemo.utils.exp_manager import exp_manager
label_desc: Use image node_id 3 for calling a global function with example usage: main(cfg) without return types