[BugFix] Fix quant file selection in download_gguf - #123
Merged
Isotr0py merged 2 commits intoAug 30, 2026
Conversation
Signed-off-by: RickyChen / 陳昭儒 <ricky.chen@infinirc.com>
Signed-off-by: RickyChen / 陳昭儒 <ricky.chen@infinirc.com>
Contributor
Author
|
@Isotr0py Can you please take a look? Thanks! |
Isotr0py
approved these changes
Aug 28, 2026
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.
download_ggufhands its patterns tosnapshot_download, which matches them withfnmatchagainst repo-relative paths where*spans/, then re-matches the same patterns locally withglob, where*does not. A repo that publishes each quant in its own folder therefore downloads fine and then dies withDownloaded GGUF files not found. That is most of the big MoE repos: all 363 gguf files inunsloth/Kimi-K2-Instruct-GGUFsit in subdirectories, andunsloth/DeepSeek-V3.1-GGUF,Qwen/Qwen3-235B-A22B-GGUF, andunsloth/gpt-oss-120b-GGUFare the same. Using**withrecursive=Truemakes the local scan see what was downloaded.The same patterns also match the projector. For
:BF16, the candidates aremmproj-BF16.ggufandgemma-3-4b-it-BF16.gguf, and the(count("-"), name)tie-break prefers the mmproj, so the vision tower comes back as the backbone.download_mmprojalready resolves the projector, so I exclude it here and rank on the file name instead of the full path.One behaviour change worth flagging:
unsloth/gemma-3-4b-it-GGUF:F16publishes no F16 backbone, only BF16. It used to resolve to the projector and load it as the model; now it raises the existing "not found" error.test_download_gguf_subdirmockedglob.globinto returning a subdirectory hit for any matching pattern, so it passed against code that could not do it. I left it and added four tests that build a real directory tree.