mirror of
https://github.com/mii443/tokenizers.git
synced 2025-09-01 14:59:20 +00:00
Make sure TrainerWrapper can only train the right Model
This commit is contained in:
@ -92,3 +92,10 @@ class TestUnigram:
|
||||
"t ",
|
||||
"[SEP]",
|
||||
]
|
||||
|
||||
def test_cannot_train_different_model(self):
|
||||
tokenizer = Tokenizer(models.BPE())
|
||||
trainer = trainers.UnigramTrainer(show_progress=False)
|
||||
|
||||
with pytest.raises(Exception, match="UnigramTrainer can only train a Unigram"):
|
||||
tokenizer.train([], trainer)
|
||||
|
Reference in New Issue
Block a user