Skip to content
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

Fix data path in test_continuing_prefix_trainer_mismatch #1747

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GaetanLepage
Copy link

@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.

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.

1 participant