code: def __init__(self, opts, *args, **kwargs):
      merges_path = getattr(
          opts, "text_tokenizer.clip.merges_path", None
      )
      if merges_path is None:
          logger.error(
              "Please specify BPE merge file using --text-tokenizer.clip.merges-path argument"
          )
  
      # DDP case is handled internally
      merges_path = get_local_path(opts, path=merges_path)
  
      encoder_json_path = getattr(
          opts, "text_tokenizer.clip.encoder_json_path", None
      )
      if encoder_json_path is None:
          logger.error(
              "Please specify Encoder JSON file using --text-tokenizer.clip.encoder-json-path argument"
          )
  
      encoder_json_path = get_local_path(opts, path=encoder_json_path)
  
      super().__init__(opts, *args, **kwargs)
      self.tokenizer = CLIPTokenizer(
          merges_path=merges_path, encoder_json_path=encoder_json_path
      )
      # BPE encodings is a dict, where  keys are tokens and values are token_ids
      self.bpe_encodings = self.tokenizer.bpe.bpe_encoder_
  
file_path: ml-cvnets/data/text_tokenizer/clip_tokenizer.py
imports: import argparse
  import torch
  from torch import Tensor
  from torchtext.transforms import CLIPTokenizer
  from data.text_tokenizer import TOKENIZER_REGISTRY, BaseTokenizer
  from utils import logger
  from utils.download_utils import get_local_path
label_desc: Use image node_id 1 to create a new ClipTokenizer object from inherited base classes: BaseTokenizer with example: obj = ClipTokenizer(opts)