small fix tokenizer regex patch#42528
Merged
ArthurZucker merged 6 commits intomainfrom Dec 1, 2025
Merged
Conversation
vasqu
reviewed
Dec 1, 2025
|
|
||
| # Optionally patches mistral tokenizers with wrong regex | ||
| if vocab_size > 100000 and getattr(self._tokenizer, "pre_tokenizer", None) is not None: | ||
| kwargs.pop("tokenizer", None) |
Contributor
There was a problem hiding this comment.
We dont need the kwargs in the patch fn, how about we change the signature and remove the **kwargs instead? This was how it was before
Collaborator
Author
There was a problem hiding this comment.
Yeah but I had to re-introduce them IDR why but the ci was complaining post refactor
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
winglian
approved these changes
Dec 1, 2025
sarathc-cerebras
pushed a commit
to sarathc-cerebras/transformers
that referenced
this pull request
Dec 7, 2025
* small fix * update * we prob still had 1 issue * fix * pop in case
Killusions
reviewed
Dec 15, 2025
Comment on lines
+1093
to
+1098
| if is_offline_mode(): | ||
| is_local = True | ||
|
|
||
| if pretrained_model_name_or_path is not None and ( | ||
| is_local or (not is_local and is_base_mistral(pretrained_model_name_or_path)) | ||
| ): |
There was a problem hiding this comment.
@ArthurZucker Can we get a backport of this fix, specifically:
if is_offline_mode():
is_local = Trueand
if pretrained_model_name_or_path is not None and (
is_local or (not is_local and is_base_mistral(pretrained_model_name_or_path))
):Without this offline loading is broken (also for non-mistral models).
There was a problem hiding this comment.
@ArthurZucker Created a minimal backport PR for these lines #42880
Killusions
added a commit
to Killusions/transformers
that referenced
this pull request
Dec 15, 2025
Backport of a small part of huggingface#42528, the model_info call currently breaks offline loading
This was referenced Dec 15, 2025
Killusions
added a commit
to Killusions/transformers
that referenced
this pull request
Dec 16, 2025
Backport of a small part of huggingface#42528, the model_info call currently breaks offline loading
ArthurZucker
pushed a commit
that referenced
this pull request
Jan 13, 2026
* fix: make mistral base check-conditional to fix offline loading Backport of a small part of #42528, the model_info call currently breaks offline loading * test: test that model info api is not called in offline mode
SangbumChoi
pushed a commit
to SangbumChoi/transformers
that referenced
this pull request
Jan 23, 2026
* small fix * update * we prob still had 1 issue * fix * pop in case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Were issues