code: def get_trainer(args):
      checkpoint_dir = args.exp_dir / "checkpoints"
      checkpoint = ModelCheckpoint(
          checkpoint_dir,
          monitor="Losses/val_loss",
          mode="min",
          save_top_k=5,
          save_weights_only=True,
          verbose=True,
      )
      train_checkpoint = ModelCheckpoint(
          checkpoint_dir,
          monitor="Losses/train_loss",
          mode="min",
          save_top_k=5,
          save_weights_only=True,
          verbose=True,
      )
      callbacks = [
          checkpoint,
          train_checkpoint,
      ]
      return Trainer(
          default_root_dir=args.exp_dir,
          max_epochs=args.epochs,
          num_nodes=args.num_nodes,
          gpus=args.gpus,
          accelerator="gpu",
          strategy="ddp",
          gradient_clip_val=args.gradient_clip_val,
          callbacks=callbacks,
      )
  
file_path: audio/examples/asr/emformer_rnnt/train.py
imports: import logging
  import pathlib
  from argparse import ArgumentParser
  from common import MODEL_TYPE_LIBRISPEECH, MODEL_TYPE_MUSTC, MODEL_TYPE_TEDLIUM3
  from librispeech.lightning import LibriSpeechRNNTModule
  from mustc.lightning import MuSTCRNNTModule
  from pytorch_lightning import Trainer
  from pytorch_lightning.callbacks import ModelCheckpoint
  from tedlium3.lightning import TEDLIUM3RNNTModule
label_desc: Use image node_id 1 for calling a global function with example usage: get_trainer(args) and returns: Trainer