Skip to content

Fix data path in test_continuing_prefix_trainer_mismatch #1747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025

Conversation

GaetanLepage
Copy link
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
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
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