-
Notifications
You must be signed in to change notification settings - Fork 613
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
Progress bar when uploading LFS files #1266
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.
Looks good to me!
src/huggingface_hub/_commit_api.py
Outdated
""" | ||
A context manager that yields a file-like object allowing to read the underlying | ||
data behind `path_or_fileobj`. | ||
|
||
Args: | ||
with_tqdm (bool, *optional*): |
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 think the convention is to have defaults to False
, no?
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.
😫
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.
Still don't know about that. I'm seing a lot of private (
bool, *optional*, defaults to
False):
so I'll put that.
I remember a conversation about that on Slack, wasn't so clear what the output is though 😕
Thanks for the review @LysandreJik :) I've adapted the docstring and will merge. |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
Thanks for the quick turnaround! |
Resolve #1244 (cc @sijunhe).
Add 2 progress bars when creating a commit. A "main" one showing how much LFS files must be uploaded + 1 progress for each individual LFS file. Progress bars can be disabled by setting
HF_HUB_DISABLE_PROGRESS_BARS=1
as environment variable. Example:I based the implementation on @julien-c 's implementation from
transformers
back in 2019 (huggingface/transformers#2078).I kept it as minimal as possible. Especially, only files that are passed as a filepath have a progress bar. Should cover 95% of the cases. I'm not against making it more flexible but it could bring more problems/corner cases to debug.
Also refactored the code to upload files in parallel (now using
thread_map
).