gguf-py: preserve MoE size labels for mmproj metadata#23618
Open
ooovenenoso wants to merge 2 commits into
Open
gguf-py: preserve MoE size labels for mmproj metadata#23618ooovenenoso wants to merge 2 commits into
ooovenenoso wants to merge 2 commits into
Conversation
Contributor
|
I don't think this is the right choice here, the mmproj for I think the mmproj should either always or never take the size label of the model it belongs to, no matter if it's number of parameters would allow part of the name as a label. |
Author
|
Updated the PR based on the mmproj feedback:
Verified locally: PYTHONPATH=gguf-py python -m pytest gguf-py/tests/test_metadata.py -q
ruff check gguf-py/gguf/metadata.py gguf-py/tests/test_metadata.py conversion/base.py |
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.
Fixes #23448.
For mmproj exports,
total_paramsrefers to the projector, while the parsed Hugging Face model id still refers to the parent model. This preserves the parent model size label for mmproj metadata so Gemma 4 projector exports do not turn the parent size into finetune text.Covered cases:
google/gemma-4-26B-A4B-itwith projector-sizedtotal_paramskeepsgeneral.size_label = 26B-A4Bandgeneral.finetune = itgoogle/gemma-4-31B-itwith projector-sizedtotal_paramskeepsgeneral.size_label = 31Bandgeneral.finetune = itTested with:
AI assistance was used for code exploration and validation. I reviewed the change and understand the metadata parsing logic.