code: def __init__(self, model_path: str):
      assert os.path.isfile(model_path), model_path
      self.sp_model = SentencePieceProcessor(model_file=model_path)
      self.n_words: int = self.sp_model.vocab_size()
      self.bos_id: int = self.sp_model.bos_id()
      self.eos_id: int = self.sp_model.eos_id()
      self.pad_id: int = self.sp_model.pad_id()
      assert (
          self.sp_model.vocab_size() == self.sp_model.get_piece_size()
      )
      self.vocab = [
          self.sp_model.id_to_piece(i) for i in range(self.n_words)
      ]
  
file_path: OpenNMT-py/tools/convert_HF.py
imports: import torch
  import json
  import argparse
  import pyonmttok
  import safetensors
  from argparse import Namespace
  from onmt.inputters.inputter import vocabs_to_dict
  from onmt.constants import DefaultTokens
  from sentencepiece import SentencePieceProcessor
  import os
  import huggingface_hub
  from safetensors.torch import save_file
label_desc: Use image node_id 1 to create a new Tokenizer object  with example: obj = Tokenizer(model_path)