class_docstr: Construct a ChatGLM tokenizer. Based on byte-level Byte-Pair-Encoding.
  
  Args:
      vocab_file (`str`):
          Path to the vocabulary file.
class_docstr_tok: ["Construct","a","ChatGLM","tokenizer",".","Based","on","byte-level","Byte-Pair-Encoding",".","Args",":","vocab_file","(","`","str","`",")",":","Path","to","the","vocabulary","file","."]
code: def __init__(
      self,
      vocab_file,
      do_lower_case=False,
      remove_space=False,
      bos_token="<sop>",
      eos_token="<eop>",
      end_token="</s>",
      mask_token="[MASK]",
      gmask_token="[gMASK]",
      padding_side="left",
      pad_token="<pad>",
      unk_token="<unk>",
      num_image_tokens=20000,
      **kwargs,
  ) -> None:
      super().__init__(
          do_lower_case=do_lower_case,
          remove_space=remove_space,
          padding_side=padding_side,
          bos_token=bos_token,
          eos_token=eos_token,
          end_token=end_token,
          mask_token=mask_token,
          gmask_token=gmask_token,
          pad_token=pad_token,
          unk_token=unk_token,
          num_image_tokens=num_image_tokens,
          **kwargs,
      )
  
      self.do_lower_case = do_lower_case
      self.remove_space = remove_space
      self.vocab_file = vocab_file
  
      self.bos_token = bos_token
      self.eos_token = eos_token
      self.end_token = end_token
      self.mask_token = mask_token
      self.gmask_token = gmask_token
  
      self.sp_tokenizer = SPTokenizer(
          vocab_file, num_image_tokens=num_image_tokens
      )
  
      """ Initialisation """
  
imports: import os
  from typing import Dict, List, Optional, Union
  import numpy
  import sentencepiece
  from transformers.tokenization_utils import PreTrainedTokenizer
  from transformers.tokenization_utils_base import BatchEncoding, EncodedInput
  from transformers.utils import PaddingStrategy, logging
label_desc: Use image node_id 1 to create a new ChatGLMTokenizer object from inherited base classes: PreTrainedTokenizer with example: obj = ChatGLMTokenizer(vocab_file, do_lower_case, remove_space, bos_token, eos_token, end_token, mask_token, gmask_token, padding_side, pad_token, unk_token, num_image_tokens)