-
Notifications
You must be signed in to change notification settings - Fork 581
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
Implemented CLI download functionality #1617
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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.
Hi @martinbrose, thanks a ton for working on this PR! It is a quite expected feature that will drastically simplify how some users are downloading weights from the Hub. The goal is to kinda replace git clone
-like commands by this one 🚀 🤗
I started to try the CLI locally and got opinionated on how the command should look like which lead to me making changes directly on your PR. I hope you didn't find it offensive :) Here is how the command looks like now:
# Download file
huggingface-cli download gpt2 config.json
# Download entire repo
huggingface-cli download fffiloni/zeroscope --repo-type=space --revision=refs/pr/78
# Download repo with filters
huggingface-cli download gpt2 --include="*.safetensors"
# Download with token
huggingface-cli download Wauplin/private-model --token=hf_***
# Download quietly (no progress bar, no warnings, only the returned path)
huggingface-cli download gpt2 config.json --quiet
EDIT: I have also added some content in the download guide to make sure it's documented somewhere.
Thanks @Wauplin, I've reviewed your changes with interest and they made sense to me. Cheers |
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.
@LysandreJik @julien-c Would you mind having a look to this PR as it adds a quite important command IMO (also cc @osanseviero). Might be interesting to showcase this command in the "Clone this model repository" pop-up on the Hub. Before doing so, we would need the --to-local-dir
option to be implemented but that can be done in a future PR.
cc @stevhliu I have added a small section in the docs if you can have a look at it 🙏
EDIT: implemented --to-local-dir
in 874b70e
Do you think we could have a shorter command ( |
I'm definitely in favor of a simple |
re shorter command name, i wouldn't recommend because:
|
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.
API-wise, looks great to me!
and i liked the detailed pre-spec in #1105 (comment) cc @Wauplin
I think this will be quite a useful feature!
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.
Super cool! 🤩
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
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.
Played with it, works well! I like the API. Thanks for working on it @Wauplin
Addresses #1105.