deeppavlov / deeppavlov/AutoIntent
Upgrade transformers to 5.x (drops conftest mistral monkey-patch)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 54
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Background
tests/conftest.py currently monkey-patches transformers.PreTrainedTokenizerBase._patch_mistral_regex to a no-op as a workaround for a confirmed transformers bug: on every tokenizer load with vocab_size > 100000 (e.g. our default intfloat/multilingual-e5-*), the method calls huggingface_hub.model_info() unconditionally. On CI that hammers the 1000-req/5-min HF rate limit and 429s.
Upstream issues / PRs documenting the bug:
- huggingface/transformers#44843
- huggingface/transformers#43200
- huggingface/transformers#45545
- huggingface/transformers#45444
- huggingface/transformers#43603
The #45444 merge commit message explicitly says:
faulty mistral tokenizers saved with version 4.57.{3,4,5,6} will load incorrectly... use 5.0.0 as 5.0.0rc0 introduced the fix... Exclusively check for mistral BEFORE v5
So:
- transformers 4.57.x has the bug — we're on 4.57.6, confirmed buggy
- transformers 5.0.0+ has the fix — latest is 5.10.2 (released yesterday)
- The fix was not backported to 4.x — it's "v5-only" by design
Task
Upgrade transformers to >=5.0 in pyproject.toml, then delete _disable_transformers_mistral_regex_patch() from tests/conftest.py.
Risk
transformers 5.0 is a major version bump (Mistral 4 support, removed deprecated APIs, etc). Likely surfaces breaking changes elsewhere in the codebase that would need addressing separately.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pyproject.toml and tests/conftest.py: inspect the transformers dependency and _disable_transformers_mistral_regex_patch() helper, then review the linked upstream issue context. Upgrade transformers to >=5.0, remove the helper, and run the project tests to identify regressions from the major version change. Done means the workaround is gone, the dependency is upgraded, and tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, python
- Domain
- machine-learning, testing-qa
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100