fix: Fixed raising TypeError instead of ValueError for invalid type (#32111)

* Raised TypeError instead of ValueError for invalid types.

* Updated formatting using ruff.

* Retrieved few changes.

* Retrieved few changes.

* Updated tests accordingly.
This commit is contained in:
Sai-Suraj-27
2024-07-22 22:16:17 +05:30
committed by GitHub
parent d1ec36b94f
commit 12b6880c81
58 changed files with 111 additions and 113 deletions

View File

@@ -188,7 +188,7 @@ class LukeTokenizerTest(TokenizerTesterMixin, unittest.TestCase):
with self.assertRaises(ValueError):
tokenizer(sentence, entities=tuple(entities), entity_spans=spans)
with self.assertRaises(ValueError):
with self.assertRaises(TypeError):
tokenizer(sentence, entities=entities, entity_spans=tuple(spans))
with self.assertRaises(ValueError):