-
Notifications
You must be signed in to change notification settings - Fork 19
Add support for modelFile generate via model providers model_url #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @avinashsingh77, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant new capability to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a valuable feature for generating a modelfile directly from a Hugging Face model URL. The implementation is well-structured, primarily by leveraging the huggingface-cli tool. My review focuses on enhancing user experience, ensuring proper resource management, and improving code clarity. I've suggested making the <path> argument and the --model_url flag mutually exclusive to prevent user confusion, adding cleanup for temporary directories, refining output handling within the hfhub package, and simplifying test logic for better maintainability.
4f37fb2 to
fb50643
Compare
chlins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we abstract a generic interface for the download part, and then support different drivers or vendors? Because in addition to Hugging Face, there are also model hubs like ModelScope.
|
Make sense. What all model vendors do we plan to support to start with?
…On Wed, 19 Nov 2025 at 1:47 PM, Chlins Zhang ***@***.***> wrote:
***@***.**** commented on this pull request.
Can we abstract a generic interface for the download part, and then
support different drivers or vendors? Because in addition to Hugging Face,
there are also model hubs like ModelScope.
—
Reply to this email directly, view it on GitHub
<#329 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZR3OPKI24M24EMC26FQON335QRR7AVCNFSM6AAAAACLYFAAOKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTIOBRGM3TQMZSGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Avinash Singh <[email protected]>
Signed-off-by: Avinash Singh <[email protected]>
Signed-off-by: Avinash Singh <[email protected]>
1a81c96 to
6d7fb90
Compare
|
@chlins Implemented a provider interface and added providers for HuggingFace and ModelScope as suggested. Does it look okay now? |
@avinashsingh77 Great work! thanks for adding the provider interface with HuggingFace and ModelScope implementations. I'll take a look at the changes in a bit and share my thoughts. |
|
|
||
| // Create a temporary directory for downloading the model | ||
| // Clean up the temporary directory after the function returns | ||
| tmpDir, err := os.MkdirTemp("", "modctl-model-downloads-*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to consider expose this temp dir to user? because in some limited environment, user may only have write access to specific dirs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want users to specify which directory should be used to download models directly? As we are providing "" as the dir parameter's value to os.MkdirTemp , MkdirTemp uses the default directory for temporary files, as returned by TempDir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some scenarios, the disk space of the temporary directory may not be large enough to store all model files.
Signed-off-by: Avinash Singh <[email protected]>
|
|
||
| // Use huggingface-cli to download the model | ||
| // The --local-dir-use-symlinks=False flag ensures files are copied, not symlinked | ||
| cmd := exec.CommandContext(ctx, "huggingface-cli", "download", repoID, "--local-dir", downloadPath, "--local-dir-use-symlinks", "False") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that we must rely on the CLI to download the model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @chlins , do you think its not a good design?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether having to rely on external third-party command-line tools is convenient for users, and there might also be compatibility issues related to different versions. However, I think for the first version we can simplify things and just rely on the command line for now. In phase 2, we can consider whether it's possible to implement this directly via API calls in the future.
This PR adds support for providing model_url to
modctl modelfile generateTests added, run output:
Closes #308