class_docstr: Base class for encoder decoder CTC-based models.
class_docstr_tok: ["Base","class","for","encoder","decoder","CTC-based","models","."]
code: def setup_training_data(
      self, train_data_config: Optional[DictConfig]
  ):
      # create audio-only data loader
      self._update_dataset_config(
          dataset_name="train", config=train_data_config
      )
      self._train_dl = self._setup_dataloader_from_config(
          config=train_data_config
      )
  
      # Need to set this because if using an IterableDataset, the length of the
      # dataloader is the total number of samples rather than the number of batches,
      # and this messes up the tqdm progress bar. So we set the number of steps manually
      # (to the correct number) to fix this.
      if (
          "is_tarred" in train_data_config
          and train_data_config["is_tarred"]
      ):
          # We also need to check if limit_train_batches is already set.
          # If it's an int, we assume that the user has set it to something sane,
          # i.e. <= # training batches, and don't change it. Otherwise, adjust
          # batches accordingly if it's a float (including 1.0).
          if self._trainer is not None and isinstance(
              self._trainer.limit_train_batches, float
          ):
              self._trainer.limit_train_batches = int(
                  self._trainer.limit_train_batches
                  * ceil(
                      (len(self._train_dl.dataset) / self.world_size)
                      / train_data_config["batch_size"]
                  )
              )
          elif self._trainer is None:
              logging.warning(
                  "Model Trainer was not set before constructing the dataset, incorrect number of "
                  "training batches will be used. Please set the trainer and rebuild the dataset."
              )
  
imports: import itertools
  import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, Union
  import editdistance
  import torch
  import torch.distributed
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from tqdm.auto import tqdm
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.data.audio_to_text_lhotse import LhotseSpeechToTextBpeDataset
  from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
  from nemo.collections.asr.parts.mixins import ASRBPEMixin
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.common.data.lhotse import get_lhotse_dataloader_from_config
  from nemo.collections.common.losses import SmoothedCrossEntropyLoss
  from nemo.collections.common.metrics import GlobalAverageLossMetric
  from nemo.collections.common.parts import transformer_weights_init
  from nemo.core.classes.common import typecheck
  from nemo.core.neural_types import AudioSignal, ChannelType, LabelsType, LengthsType, LogprobsType, MaskType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the EncDecTransfModelBPE obj's underlying member method code with example usage: obj.setup_training_data(train_data_config) without return types