mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-22 16:25:30 +00:00
Python - Make the trainer optional on Tokenizer.train
This commit is contained in:
@ -138,11 +138,11 @@ tokenizer.post_processor = processors.ByteLevel(trim_offsets=True)
|
||||
|
||||
# And then train
|
||||
trainer = trainers.BpeTrainer(vocab_size=20000, min_frequency=2)
|
||||
tokenizer.train(trainer, [
|
||||
tokenizer.train([
|
||||
"./path/to/dataset/1.txt",
|
||||
"./path/to/dataset/2.txt",
|
||||
"./path/to/dataset/3.txt"
|
||||
])
|
||||
], trainer=trainer)
|
||||
|
||||
# And Save it
|
||||
tokenizer.save("byte-level-bpe.tokenizer.json", pretty=True)
|
||||
|
Reference in New Issue
Block a user