-
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
feat: add hf_transfer
upload
#1395
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1395 +/- ##
==========================================
- Coverage 84.30% 83.97% -0.33%
==========================================
Files 48 48
Lines 4956 4980 +24
==========================================
+ Hits 4178 4182 +4
- Misses 778 798 +20
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
Thank you for this PR @McPatate! (and the one in hf_transfer
). I left a few comments but yes, I definitely think it's a good integration. I've looked at huggingface/hf_transfer#7 but honestly don't have much feedback on it. I don't think it's worth to make parallel_failures
configurable if it's to set it to max_files-1
but that's all.
Out of curiosity, is there a concept of threads in Rust i.e. is it using os-based threads or is it clever than that? And in the implementation, do you control the number of parallel upload at the same time or not?
Here you go: https://docs.rs/tokio/latest/tokio/task/#what-are-tasks 😄 |
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.
Approving it but let's wait for @Narsil's review + merge and deploy huggingface/hf_transfer#7 first
rather than using unnecessary compound assignment Co-authored-by: Lucain <[email protected]>
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.
small nit, good to me otherwise
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.
lgtm ! thanks for cleaning the code up, looks better like this
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.
Always weird to review stuff that we just changed 😄 But PR looks good to me now :)
Thanks for adding this @McPatate! Making sure that everything's aligned in 3 repos is never an easy task 🥳
hf_transfer
uploadhf_transfer
upload
hf_transfer
uploadhf_transfer
upload
🎉 🎉 🎉 |
Add
hf_transfer.upload
Happy to discuss if there is a more appropriate way to do things, this seems to me like a good implementation.
Linked to huggingface/hf_transfer#7 & huggingface/moon-landing#5722
Here's the result of my test:
The file I tested for is 50MiB and I tested on my personal laptop on my home network, so it may even be more than x3 improvement !