VLM: special multimodal Tokenizer (#34461)
* kinda works * update * add tests * update * use special tokens in processors * typo * fix copies * fix * fix moshi after rebase * update * fix tests * update * Update docs/source/en/main_classes/tokenizer.md Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * update docs * test for load time adding tokens * fix some more tests which are now fetched better * one more fix --------- Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ef976a7e18
commit
187439c3fa
@@ -185,7 +185,7 @@ class RemBertTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
)
|
||||
EXPECTED_ADDED_TOKENS_DECODER = tokenizer.added_tokens_decoder
|
||||
with self.subTest("Hub -> Slow: Test loading a slow tokenizer from the hub)"):
|
||||
self.assertEqual(tokenizer._eos_token, new_eos)
|
||||
self.assertEqual(tokenizer._special_tokens_map["eos_token"], new_eos)
|
||||
self.assertIn(new_eos, list(tokenizer.added_tokens_decoder.values()))
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmp_dir_2:
|
||||
@@ -223,7 +223,7 @@ class RemBertTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
with self.subTest("Hub -> Fast: Test loading a fast tokenizer from the hub)"):
|
||||
if self.rust_tokenizer_class is not None:
|
||||
tokenizer_fast = self.rust_tokenizer_class.from_pretrained(pretrained_name, eos_token=new_eos)
|
||||
self.assertEqual(tokenizer_fast._eos_token, new_eos)
|
||||
self.assertEqual(tokenizer_fast._special_tokens_map["eos_token"], new_eos)
|
||||
self.assertIn(new_eos, list(tokenizer_fast.added_tokens_decoder.values()))
|
||||
# We can't test the following because for BC we kept the default rstrip lstrip in slow not fast. Will comment once normalization is alright
|
||||
with self.subTest("Hub -> Fast == Hub -> Slow: make sure slow and fast tokenizer match"):
|
||||
|
||||
Reference in New Issue
Block a user