code: def __init__(
      self, args=None, sp_model=None, pretrained_model_path=None
  ):
      super().__init__()
      self.save_hyperparameters(args)
      self.args = args
      self.sp_model = sp_model
      spm_vocab_size = self.sp_model.get_piece_size()
      assert spm_vocab_size == _expected_spm_vocab_size, (
          "The model returned by conformer_rnnt_base expects a SentencePiece model of "
          f"vocabulary size {_expected_spm_vocab_size}, but the given SentencePiece model has a vocabulary size "
          f"of {spm_vocab_size}. Please provide a correctly configured SentencePiece model."
      )
      self.blank_idx = spm_vocab_size
  
      if args.modality == "video":
          self.frontend = video_resnet()
      if args.modality == "audio":
          self.frontend = audio_resnet()
  
      if args.mode == "online":
          self.model = emformer_rnnt()
      if args.mode == "offline":
          self.model = conformer_rnnt()
  
      # -- initialise
      if args.pretrained_model_path:
          ckpt = torch.load(
              args.pretrained_model_path,
              map_location=lambda storage, loc: storage,
          )
          tmp_ckpt = {
              k.replace("encoder.frontend.", ""): v
              for k, v in ckpt.items()
              if k.startswith("encoder.frontend.")
          }
          self.frontend.load_state_dict(tmp_ckpt)
  
      self.loss = torchaudio.transforms.RNNTLoss(reduction="sum")
  
      self.optimizer = torch.optim.AdamW(
          itertools.chain(
              *([self.frontend.parameters(), self.model.parameters()])
          ),
          lr=8e-4,
          weight_decay=0.06,
          betas=(0.9, 0.98),
      )
  
imports: import itertools
  import math
  from collections import namedtuple
  from typing import List, Tuple
  import sentencepiece
  import torch
  import torchaudio
  from models.conformer_rnnt import conformer_rnnt
  from models.emformer_rnnt import emformer_rnnt
  from models.resnet import video_resnet
  from models.resnet1d import audio_resnet
  from pytorch_lightning import LightningModule
  from schedulers import WarmupCosineScheduler
  from torchaudio.models import Hypothesis, RNNTBeamSearch
label_desc: Use image node_id 1 to create a new ConformerRNNTModule object from inherited base classes: LightningModule with example: obj = ConformerRNNTModule(args, sp_model, pretrained_model_path)