Skip to content

Fix data path in test_continuing_prefix_trainer_mismatch#1747

Merged
ArthurZucker merged 1 commit intohuggingface:mainfrom
GaetanLepage:test-fix
May 27, 2025
Merged

Fix data path in test_continuing_prefix_trainer_mismatch#1747
ArthurZucker merged 1 commit intohuggingface:mainfrom
GaetanLepage:test-fix

Conversation

@GaetanLepage
Copy link
Copy Markdown
Contributor

@GaetanLepage GaetanLepage commented Mar 13, 2025

Context: bumping the tokenizer version in nixpkgs.
NixOS/nixpkgs#389517

I observed the following test failure:

=================================== FAILURES ===================================
_____________ TestUnigram.test_continuing_prefix_trainer_mismatch ______________

self = <tests.bindings.test_trainers.TestUnigram object at 0x7ffff4ce1d30>

    def test_continuing_prefix_trainer_mismatch(self):
        UNK = "[UNK]"
        special_tokens = [UNK]
        tokenizer = Tokenizer(models.BPE(unk_token=UNK, continuing_subword_prefix="##"))
        trainer = trainers.BpeTrainer(special_tokens=special_tokens)
        tokenizer.pre_tokenizer = pre_tokenizers.Sequence(
            [pre_tokenizers.Whitespace(), pre_tokenizers.Digits(individual_digits=True)]
        )
>       tokenizer.train(files=["data/big.txt"], trainer=trainer)
E       Exception: No such file or directory (os error 2)

tests/bindings/test_trainers.py:298: Exception

This PR provides a patch that fixes the test.
Feel free to propose an alternative solution if needed.

Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay, sur thanks! 🤗

@ArthurZucker ArthurZucker merged commit 23e7e42 into huggingface:main May 27, 2025
@GaetanLepage GaetanLepage deleted the test-fix branch May 27, 2025 22:30
@GaetanLepage
Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants