Downloads · 30 days
0
ocisd4/llama_tokenizer_ext_zhtw
llama_tokenizer_ext_zhtw is a machine learning model from ocisd4. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Feb 1, 2024
Repo size
549 KB
Likes
0
Public
Click a slice to open those files.
.json1.9 MB · 78%
From the Hugging Face model README
from transformers import LlamaTokenizer
tokenizer = LlamaTokenizer.from_pretrained(
'ocisd4/llama_tokenizer_ext_zhtw',
pad_token='<unk>',
add_bos_token=True,
add_eos_token=False
)
#vocab size: 36128
print(tokenizer.tokenize('今天天氣真好!'))
#['▁', '今', '天', '天', '氣', '真', '好', '!']
print(tokenizer.encode('今天天氣真好!'))
#[1, 29871, 31482, 30408, 30408, 32045, 30848, 31076, 30584]
print(tokenizer.decode(tokenizer.encode('今天天氣真好!')))
# <s>今天天氣真好!