MCPcopy
hub / github.com/huggingface/transformers / test_trie_single

Method test_trie_single

tests/utils/test_tokenization_utils.py:237–241  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

235 self.assertEqual(trie.split("[CLS] This is a extra_id_100"), ["[CLS]", " This is a ", "extra_id_100"])
236
237 def test_trie_single(self):
238 trie = Trie()
239 trie.add("A")
240 self.assertEqual(trie.split("ABC"), ["A", "BC"])
241 self.assertEqual(trie.split("BCA"), ["BC", "A"])
242
243 def test_trie_final(self):
244 trie = Trie()

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
splitMethod · 0.95
TrieClass · 0.90

Tested by

no test coverage detected