class_docstr: T0 (https://arxiv.org/abs/2110.08207) Model that Inherits from MegatronT5SFTModel and overrides the dataset building.
code: def build_train_valid_test_datasets(self, stage):
      if stage != "test":
          logging.info("Building T0 validation datasets.")
          # Wrap this in a list since the general finetuning parent class supports multi-validation.
          self._validation_ds = self._build_dataset(
              self.cfg.data.validation_ds,
              check_implict_grad_acc=True,
              is_train=False,
          )
          logging.info(
              f"Length of val dataset: {len(self._validation_ds[0])}"
          )
  
      if stage != "validate":
          if hasattr(self.cfg.data, "test_ds"):
              logging.info("Building T0 test datasets.")
              # Wrap this in a list since the general finetuning parent class supports multi-validation.
              self._test_ds = self._build_dataset(
                  self.cfg.data.test_ds,
                  check_implict_grad_acc=True,
                  is_train=False,
              )
              logging.info(
                  f"Length of test dataset: {len(self._test_ds[0])}"
              )
  
      if stage == "validate" or stage == "test":
          return
      logging.info("Building T0 traing datasets.")
      self._train_ds = self._build_dataset(
          self.cfg.data.train_ds, check_implict_grad_acc=False
      )
      logging.info(f"Length of train dataset: {len(self._train_ds)}")
  
imports: import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.data.language_modeling.megatron.base_dataset_utils import get_datasets_weights_and_num_samples
  from nemo.collections.nlp.data.language_modeling.megatron.blendable_dataset import BlendableDataset
  from nemo.collections.nlp.data.language_modeling.megatron.megatron_batch_samplers import MegatronPretrainingBatchSampler
  from nemo.collections.nlp.data.language_modeling.t0_dataset import T0Dataset
  from nemo.collections.nlp.models.language_modeling.megatron_t5_sft_model import MegatronT5SFTModel
  from nemo.utils import AppState, logging
label_desc: Use image node_id 6 for calling the MegatronT0Model obj's underlying member method code with example usage: obj.build_train_valid_test_datasets(stage) without return types