[fix] fix token healing tests and usage errors (#33931)

* auto-gptq requirement is removed & model is changed & tokenizer pad token is assigned

* values func is changed with extensions & sequence key value bug is fixed

* map key value check is added in ExtensionsTree

* empty trimmed_ids bug is fixed

* tail_id IndexError is fixed

* empty trimmed_ids bug fix is updated for failed test

* too much specific case for specific tokenizer is removed

* input_ids check is updated

* require auto-gptq import is removed

* key error check is changed with empty list check

* empty input_ids check is added

* empty trimmed_ids fix is checked with numel function

* usage change comments are added

* test changes are commented

* comment style and quality bugs are fixed

* test comment style and quality bug is fixed
This commit is contained in:
alpertunga-bile
2024-10-16 15:22:55 +03:00
committed by GitHub
parent 9ba021ea75
commit 98bad9c6d6
4 changed files with 44 additions and 17 deletions

View File

@@ -325,8 +325,9 @@ class ExtensionsTrieTest(unittest.TestCase):
def test_no_extension_match(self):
trie = ExtensionsTrie()
# Test searching for a prefix that doesn't match any key
with self.assertRaises(KeyError):
trie.extensions("unknown")
values = trie.extensions("unknown")
self.assertEqual(len(values), 0)
def test_update_value(self):
trie = ExtensionsTrie()