class_docstr: Transformer-based (duplex) decoder model for TN/ITN.
code: def setup_validation_data(
      self, val_data_config: Optional[DictConfig]
  ):
      if not val_data_config or not val_data_config.data_path:
          logging.info(
              f"Dataloader config or file_path for the validation is missing, so no data loader for validation is created!"
          )
          self.validation_dataset, self._validation_dl = None, None
          return
      (
          self.validation_dataset,
          self._validation_dl,
      ) = self._setup_dataloader_from_config(
          cfg=val_data_config, data_split="val"
      )
  
      # 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 (
          "use_tarred_dataset" in val_data_config
          and val_data_config["use_tarred_dataset"]
      ):
          # We also need to check if limit_val_batches is already set.
          # If it's an int, we assume that the user has set it to something sane, i.e. <= # validation 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_val_batches, float
          ):
              self._trainer.limit_val_batches = int(
                  self._trainer.limit_val_batches
                  * ceil(
                      len(self._validation_dl.dataset) / self.world_size
                  )
              )
          elif self._trainer is None:
              logging.warning(
                  "Model Trainer was not set before constructing the dataset, incorrect number of "
                  "validation batches will be used. Please set the trainer and rebuild the dataset."
              )
  
imports: import json
  import os
  from collections import defaultdict
  from math import ceil
  from typing import Dict, List, Optional, Union
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, DataCollatorForSeq2Seq
  import nemo.collections.nlp.data.text_normalization.constants
  from nemo.collections.common.tokenizers.moses_tokenizers import MosesProcessor
  from nemo.collections.nlp.data.text_normalization import TextNormalizationTestDataset
  from nemo.collections.nlp.data.text_normalization.decoder_dataset import TarredTextNormalizationDecoderDataset, TextNormalizationDecoderDataset
  from nemo.collections.nlp.models.duplex_text_normalization.utils import get_formatted_string
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import ChannelType, LabelsType, LossType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling the DuplexDecoderModel obj's underlying member method code with example usage: obj.setup_validation_data(val_data_config) without return types