I get bug when tokenize ByteLevelBPETokenizer() for diacritic language in utf-16 such as 'Viet Nam' language. Bellow are my code initialize tokenizer.
%%time
from pathlib import Path
from tokenizers import ByteLevelBPETokenizer
paths = ['file1.txt', 'file2.txt']
print(paths)
# Initialize a tokenizer
tokenizer = ByteLevelBPETokenizer()
# Customize training
tokenizer.train(files=paths, vocab_size=52000, min_frequency=2, special_tokens=[
"<s>",
"<pad>",
"</s>",
"<unk>",
"<mask>",
])
And bug log:
in train(self, files, vocab_size, min_frequency, show_progress, special_tokens)
90 files = [files]
91 print('files list: \n', files)
---> 92 self._tokenizer.train(trainer, files)
Exception: stream did not contain valid UTF-8
my file1.txt and file2.txt contain words like:
xin chào tôi đến từ Việt Nam, tôi gặp vấn đề với tokenizer.
I try to find what self._tokenizer.train() does to fix it myself but project code are complicated. Can you explain what i was wrong?
I get bug when tokenize ByteLevelBPETokenizer() for diacritic language in utf-16 such as 'Viet Nam' language. Bellow are my code initialize tokenizer.
And bug log:
my
file1.txtandfile2.txtcontain words like:xin chào tôi đến từ Việt Nam, tôi gặp vấn đề với tokenizer.I try to find what self._tokenizer.train() does to fix it myself but project code are complicated. Can you explain what i was wrong?