code: def __init__(self, cfg: DictConfig, trainer: "Trainer" = None):
      # Convert to Hydra 1.0 compatible DictConfig
  
      cfg = model_utils.convert_model_config_to_dict_config(cfg)
      cfg = model_utils.maybe_update_config_version(cfg)
  
      # setup normalizer
      self.normalizer = None
      self.text_normalizer_call = None
      self.text_normalizer_call_kwargs = {}
      self._setup_normalizer(cfg)
  
      # setup tokenizer
      self.tokenizer = None
      self._setup_tokenizer(cfg)
      assert self.tokenizer is not None
  
      num_tokens = len(self.tokenizer.tokens)
      self.tokenizer_pad = self.tokenizer.pad
  
      super().__init__(cfg=cfg, trainer=trainer)
  
      self.audio_to_melspec_processor = instantiate(
          cfg.preprocessor, highfreq=cfg.train_ds.dataset.highfreq
      )
  
      self.feat_matching_loss = FeatureMatchingLoss()
      self.disc_loss = DiscriminatorLoss()
      self.gen_loss = GeneratorLoss()
      self.kl_loss = KlLoss()
  
      self.net_g = instantiate(
          cfg.synthesizer,
          n_vocab=num_tokens,
          spec_channels=cfg.n_fft // 2 + 1,
          segment_size=cfg.segment_size // cfg.n_window_stride,
          padding_idx=self.tokenizer_pad,
      )
  
      self.net_d = MultiPeriodDiscriminator(cfg.use_spectral_norm)
  
      self.automatic_optimization = False
  
imports: import contextlib
  import omegaconf
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import WandbLogger
  from torch.cuda.amp import autocast
  from torch.nn import functional
  from nemo.collections.tts.data.dataset import DistributedBucketSampler
  from nemo.collections.tts.losses.vits_losses import DiscriminatorLoss, FeatureMatchingLoss, GeneratorLoss, KlLoss
  from nemo.collections.tts.models.base import TextToWaveform
  from nemo.collections.tts.modules.vits_modules import MultiPeriodDiscriminator
  from nemo.collections.tts.parts.utils.helpers import clip_grad_value_, g2p_backward_compatible_support, plot_spectrogram_to_numpy, slice_segments
  from nemo.collections.tts.torch.tts_data_types import SpeakerID
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import AudioSignal, FloatType, Index, IntType, TokenIndex
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.core.optim.lr_scheduler import CosineAnnealing
  from nemo.utils import logging, model_utils
  from nemo.utils.decorators.experimental import experimental
label_desc: Use image node_id 1 to create a new VitsModel object from inherited base classes: TextToWaveform with example: obj = VitsModel(cfg, trainer)