class_docstr: HuggingFace's ByteLevelBPE Tokenizer.
  
  Fast because Rust.
class_docstr_tok: ["HuggingFace","'s","ByteLevelBPE","Tokenizer",".","Fast","because","Rust","."]
code: def __init__(self, opt: Opt, shared: TShared = None):
      super().__init__(opt, shared)
      # Default true for HF
      self.special_tok_map = {}  # map from HF
      self.add_prefix_space = opt.get("bpe_add_prefix_space", True)
      if self.add_prefix_space is None:
          self.add_prefix_space = True
      if opt.get("dict_loaded"):
          dfname = opt["dict_file"]
          if PathManager.exists(f"{dfname}-merges.txt"):
              opt["bpe_merge"] = f"{dfname}-merges.txt"
          if PathManager.exists(f"{dfname}-vocab.json"):
              opt["bpe_vocab"] = f"{dfname}-vocab.json"
      try:
          from tokenizers import ByteLevelBPETokenizer
      except ImportError:
          raise ImportError(
              "Please install HuggingFace tokenizer with: pip install tokenizers"
          )
  
      if self.bpe_dropout:
          raise NotImplementedError(
              "--bpe-dropout is not supported with ByteLevelBPE because tokenizers "
              "library does not allow dynamically turning BPE on/off. You can use "
              "--dict-tokenizer slow_bytelevel_bpe to gain this feature."
          )
  
      if self.lower:
          warn_once(
              "Are you sure you want to lower case your BPE dictionary?"
          )
      if self.maxtokens > 0 or self.minfreq > 0:
          raise ValueError(
              "You should not filter vocabulary with using --dict-tokenizer bytelevelbpe"
              " (no --dict-minfreq or --dict-maxtokens)."
          )
      if "bpe_vocab" not in opt:
          raise ValueError(
              "--bpe-vocab is required for loading pretrained tokenizer"
          )
      if "bpe_merge" not in opt:
          raise ValueError(
              "--bpe-merge is required for loading pretrained tokenizer"
          )
  
      self.vocab_path = opt["bpe_vocab"]
      self.merge_path = opt["bpe_merge"]
  
      if not self.vocab_path or not self.merge_path:
          raise IOError(
              "--bpe-vocab and --bpe-merge are mandatory with "
              "--dict-tokenizer bytelevelbpe"
          )
  
      if not PathManager.exists(self.vocab_path):
          raise IOError(
              f"File {self.vocab_path} does not exist. --bpe-vocab must be pretrained."
          )
      if not PathManager.exists(self.merge_path):
          raise IOError(
              f"File {self.merge_path} does not exist. --bpe-merge must be pretrained."
          )
  
      self.tokenizer = ByteLevelBPETokenizer(
          self.vocab_path, self.merge_path, self.add_prefix_space
      )
  
imports: from parlai.core.params import ParlaiParser
  from abc import ABC, abstractmethod
  from functools import lru_cache
  import json
  import os
  import random
  import re
  from typing import Dict, List, Optional, Set, Tuple
  from typing_extensions import final
  from parlai.core.build_data import download, make_dir
  from parlai.core.opt import Opt
  from parlai.utils.misc import warn_once
  from parlai.utils.typing import TShared
  from parlai.utils.io import PathManager
  import parlai.utils.logging
label_desc: Use image node_id 1 to create a new HuggingFaceBpeHelper object from inherited base classes: BPEHelper with example: obj = HuggingFaceBpeHelper(opt, shared)