Skip to content

Commit 7f2f534

Browse files
authored
Update test_spm_converter_bytefallback_warning (#40284)
fff Co-authored-by: ydshieh <[email protected]>
1 parent 11a49dd commit 7f2f534

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/utils/test_convert_slow_tokenizer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ def test_spm_converter_bytefallback_warning(self):
2020

2121
with warnings.catch_warnings(record=True) as w:
2222
_ = SpmConverter(original_tokenizer_without_bytefallback)
23+
# We are looking for if there is any `UserWarning` with
24+
# `The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the fast tokenizers.`
25+
w = [x for x in w if x.category.__name__ != "DeprecationWarning"]
2326
self.assertEqual(len(w), 0)
2427

2528
original_tokenizer_with_bytefallback = FakeOriginalTokenizer(vocab_file=spm_model_file_with_bytefallback)
2629

2730
with warnings.catch_warnings(record=True) as w:
2831
_ = SpmConverter(original_tokenizer_with_bytefallback)
32+
w = [x for x in w if x.category.__name__ != "DeprecationWarning"]
2933
self.assertEqual(len(w), 1)
3034

3135
self.assertIn(

0 commit comments

Comments
 (0)