Override Transformers defaults by GGUF defaults#42770
Merged
SunMarc merged 3 commits intohuggingface:mainfrom Dec 10, 2025
Merged
Override Transformers defaults by GGUF defaults#42770SunMarc merged 3 commits intohuggingface:mainfrom
SunMarc merged 3 commits intohuggingface:mainfrom
Conversation
39a970b to
cfd48f7
Compare
In some models, GGUF uses default or fixed values different from this library. To integrate GGUF-based models without additional configuration, we need some kind of compatibility layer. This commit provides additional mapping to provide GGUF-specific default values to initialize parameters in this library. Currently, only fixed "norm_topk_prob" value of Qwen3 MoE (True) is defined because (a) it differs from the default value of this library (False) and (b) if this parameter is incorrectly set, it results in almost completely garbled output. Signed-off-by: Tsukasa OI <floss_llm@irq.a4lg.com>
cfd48f7 to
68d2175
Compare
MekkCyber
approved these changes
Dec 10, 2025
Contributor
MekkCyber
left a comment
There was a problem hiding this comment.
Thank you for iterating
|
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. |
Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com>
Merged
5 tasks
SangbumChoi
pushed a commit
to SangbumChoi/transformers
that referenced
this pull request
Jan 23, 2026
* Override Transformers defaults by GGUF defaults In some models, GGUF uses default or fixed values different from this library. To integrate GGUF-based models without additional configuration, we need some kind of compatibility layer. This commit provides additional mapping to provide GGUF-specific default values to initialize parameters in this library. Currently, only fixed "norm_topk_prob" value of Qwen3 MoE (True) is defined because (a) it differs from the default value of this library (False) and (b) if this parameter is incorrectly set, it results in almost completely garbled output. Signed-off-by: Tsukasa OI <floss_llm@irq.a4lg.com> * Apply suggestions from code review Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com> --------- Signed-off-by: Tsukasa OI <floss_llm@irq.a4lg.com> Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com>
5 tasks
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?
In some models, GGUF uses default or fixed values different from this library.
To integrate GGUF-based models without additional configuration (and/or individual
config.json), we need some kind of compatibility layer (like tensor processors insrc/transformers/modeling_gguf_pytorch_utils.pywhile loading/converting GGUF-based model tensors).This commit provides additional mapping to provide GGUF-specific default values to initialize parameters in this library.
Currently, only fixed
norm_topk_probvalue of Qwen3 MoE (True) is defined because:False) andI'm sure that Qwen3 MoE + GGUF issue should be addressed somehow but I'm not sure whether this PR is the right way to fix the issue.
So, feel free to leave a review!
I could not check all parameters but at least I checked important parameters for MoE models with GGUF support in this library.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@Cyrilvallez @SunMarc @MekkCyber