Skip to content

Commit

Permalink
Fix: Fixed directory path for utils folder in `test_tokenization_util…
Browse files Browse the repository at this point in the history
…s.py` (#32601)

* Removed un-necessary expressions.

* Fixed directory path for utils folder in test_tokenization_utils.py
  • Loading branch information
Sai-Suraj-27 authored Aug 13, 2024
1 parent cc25757 commit c3cd9d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def main():

short_validation_dataset = dataset.filter(lambda x: (len(x["question"]) + len(x["context"])) < 4 * 4096)
short_validation_dataset = short_validation_dataset.filter(lambda x: x["category"] != "null")
short_validation_dataset

model_id = "vasudevgupta/flax-bigbird-natural-questions"
model = FlaxBigBirdForNaturalQuestions.from_pretrained(model_id)
Expand Down
3 changes: 1 addition & 2 deletions tests/utils/test_tokenization_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from transformers.tokenization_utils import ExtensionsTrie, Trie


sys.path.append(str(Path(__file__).parent.parent / "utils"))
sys.path.append(str(Path(__file__).parent.parent.parent / "utils"))

from test_module.custom_tokenization import CustomTokenizer # noqa E402

Expand Down Expand Up @@ -253,7 +253,6 @@ def test_trie(self):
trie.add("Hello 友達")
self.assertEqual(trie.data, {"H": {"e": {"l": {"l": {"o": {" ": {"友": {"達": {"": 1}}}}}}}}})
trie.add("Hello")
trie.data
self.assertEqual(trie.data, {"H": {"e": {"l": {"l": {"o": {"": 1, " ": {"友": {"達": {"": 1}}}}}}}}})

def test_trie_split(self):
Expand Down

0 comments on commit c3cd9d8

Please sign in to comment.