class_docstr: Base class for Image-Text multi-modal learning
  
  Args:
      opts: command-line arguments
class_docstr_tok: ["Base","class","for","Image-Text","multi-modal","learning","Args",":","opts",":","command-line","arguments"]
docstr: Add dataset-specific arguments to the parser.
docstr_tok: ["Add","dataset-specific","arguments","to","the","parser","."]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      """Add dataset-specific arguments to the parser."""
  
      if cls != BaseMultiModalImgText:
          # Don't re-register arguments in subclasses that don't override `add_arguments()`.
          return parser
  
      group = parser.add_argument_group(cls.__name__)
  
      group.add_argument(
          "--dataset.multi-modal-img-text.context-length",
          type=int,
          default=77,
          help="Context length for the text model. Defaults to 77, the same as in CLIP paper.",
      )
  
      group.add_argument(
          "--dataset.multi-modal-img-text.trunc-seq-len",
          action="store_true",
          default=False,
          help="Many sequences in a batch do not have lengths equal to specified context length. Enabling this flag "
          "allows us to truncate the sequences such that the sequence length of a batch is equal to sequence "
          "with max. non-padded tokens. Defaults to False.",
      )
  
      return parser
  
imports: import argparse
  import os
  from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
  import torch
  from PIL import Image
  from torch import Tensor
  from data.collate_fns import COLLATE_FN_REGISTRY
  from data.datasets.dataset_base import BaseImageDataset
  from data.datasets.multi_modal_img_text.zero_shot import BaseZeroShotDataset, build_zero_shot_dataset
  from data.datasets.utils.text import caption_preprocessing
  from data.text_tokenizer import build_tokenizer
  from data.transforms import image_pil
  from data.transforms.common import Compose
  from utils import logger
  from utils.ddp_utils import is_master, is_start_rank_node
label_desc: Use image node_id 5 for calling the BaseMultiModalImgText obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser