fix(import): derive model name from selected GGUF for repo-root URIs#10589
Open
Dennisadira wants to merge 1 commit into
Open
fix(import): derive model name from selected GGUF for repo-root URIs#10589Dennisadira wants to merge 1 commit into
Dennisadira wants to merge 1 commit into
Conversation
When importing a HuggingFace GGUF model from a repository-root URI (no file component, e.g. hf://owner/repo) with the Model Name field left blank, the importer named the model after the repository (filepath.Base(details.URI)) instead of the GGUF file it actually selected from the repo listing (issue mudler#10587). Track whether the user supplied an explicit name; the URI base is now only a fallback. In the HuggingFace branch, once the model group is picked, re-derive the name from the selected GGUF via a new modelNameFromShardGroup helper that uses ShardGroup.Base minus the .gguf extension. For sharded models this yields a clean logical name (e.g. Qwen3-30B-A3B-Q4_K_M) rather than a shard filename like ...-00001-of-00002. An explicit name preference still always wins, and the .gguf/URL/OCI paths are unchanged. Add network-free unit specs covering name-from-GGUF, clean-name-from-shard-base, and explicit-name precedence, and update the live integration specs that had encoded the previous repo-name behaviour. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Adira Denis Muhando <dennisadira@gmail.com>
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
Fixes #10587.
When importing a HuggingFace GGUF model from a repository-root URI (no file component, e.g.
hf://owner/repo) with the Model Name field left blank, the importer named the model after the repository (filepath.Base(details.URI)) instead of the GGUF file it actually selected from the repo listing. The emittedname:, themodel:path, and the galleryFilenamedirectory all inherited the repo name rather than the model.Fix
nameProvided); the URI base is now only a fallback.modelNameFromShardGrouphelper that usesShardGroup.Baseminus the.ggufextension.Qwen3-30B-A3B-Q4_K_M) rather than a shard filename like...-00001-of-00002.namepreference still always wins. The.gguf/ URL / OCI import paths are unchanged.Tests
llama-cpp_test.go: name-from-single-GGUF, clean-name-from-shard-base, and explicit-name precedence.importers_test.gothat had encoded the previous repo-name behaviour to assert the GGUF-derived name.All importer specs pass;
go vetandgofmtclean.🤖 Generated with Claude Code