class_docstr: Base Dataset class for zero shot tasks.
  
  Args:
      opts: Command-line arguments.
class_docstr_tok: ["Base","Dataset","class","for","zero","shot","tasks",".","Args",":","opts",":","Command-line","arguments","."]
code: def __init__(self, opts: argparse.Namespace, *args, **kwargs) -> None:
      # we need to set the default value of this one
      if getattr(
          opts,
          "dataset.multi_modal_img_text.zero_shot.trove.enable",
          False,
      ):
          try:
              from internal.utils.server_utils import (
                  load_from_data_server,
              )
  
              opts = load_from_data_server(
                  opts=opts,
                  is_training=False,
                  is_evaluation=False,  # use root_val / dir_val
                  arg_prefix="dataset.multi_modal_img_text.zero_shot",
              )
          except Exception as e:
              logger.error(
                  "Unable to load from the server. Error: {}".format(
                      str(e)
                  )
              )
  
      # Extracting zero-shot options to be able to build them separately in
      # child classes
      dataset_opts = extract_opts_with_prefix_replacement(
          opts,
          match_prefix="dataset.multi_modal_img_text.zero_shot.",
          replacement_prefix="dataset.",
      )
      dataset_opts = vars(dataset_opts)
      dataset_opts.update(
          {
              "dataset.num_samples_per_category": -1,
              "dataset.percentage_of_samples": 100.0,
          }
      )
      self.dataset_opts = argparse.Namespace(**dataset_opts)
  
      root = getattr(
          opts, "dataset.multi_modal_img_text.zero_shot.root_val"
      )
      self.root = root
      self.opts = opts
  
      # Initialize text prompts using the static method `class_names`.
      text_prompts = []
      for class_id, class_name in enumerate(self.class_names()):
          text_prompts.append(
              self.generate_text_prompts(class_name.lower())
          )
      self.text_prompts = text_prompts
  
file_path: ml-cvnets/data/datasets/multi_modal_img_text/zero_shot/base_zero_shot.py
imports: import argparse
  from typing import List, Tuple
  from options.utils import extract_opts_with_prefix_replacement
  from utils import logger
label_desc: Use image node_id 1 to create a new BaseZeroShotDataset object from inherited base classes: object with example: obj = BaseZeroShotDataset(opts)