code: def main(cfg: DictConfig) -> None:
      # PTL 2.0 has find_unused_parameters as False by default, so its required to set it to True
      # when there are unused parameters here
      if cfg.trainer.strategy == "ddp":
          cfg.trainer.strategy = "ddp_find_unused_parameters_true"
      logging.info(f"\nConfig Params:\n{OmegaConf.to_yaml(cfg)}")
      trainer = Trainer(**cfg.trainer)
      exp_manager(trainer, cfg.get("exp_manager", None))
  
      logging.info(
          f"Loading weights from pretrained model {cfg.model.language_model.pretrained_model_name}"
      )
      model = EntityLinkingModel(cfg=cfg.model, trainer=trainer)
      logging.info(
          "==========================================================================================="
      )
      logging.info("Starting training...")
      trainer.fit(model)
      logging.info("Training finished!")
      logging.info(
          "==========================================================================================="
      )
  
      if cfg.model.nemo_path:
          # '.nemo' file contains the last checkpoint and the params to initialize the model
          model.save_to(cfg.model.nemo_path)
          logging.info(
              f"Model is saved into `.nemo` file: {cfg.model.nemo_path}"
          )
  
imports: from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from nemo.collections.nlp.models import EntityLinkingModel
  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 1 for calling a global function with example usage: main(cfg) without return types