xu-song's picture
update
428b731
raw
history blame
390 Bytes
import os
from transformers import AutoTokenizer
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
TOKENIZER_DIR = os.path.join(CURRENT_DIR, "tokenizer")
tokenizer = AutoTokenizer.from_pretrained(TOKENIZER_DIR, trust_remote_code=True)
# vocab_size = len(tokenizer.get_vocab())
# vocab_size = tokenizer.vocab_size