-
Notifications
You must be signed in to change notification settings - Fork 13
Fix custom progress bar with huggingface_hub >= 1.1.0 #391
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
Fix custom progress bar with huggingface_hub >= 1.1.0 #391
Conversation
Starting with version 1.1.0, huggingface_hub passes a "name" argument to the custom progress bar. However, the base tqdm class rejects unknown arguments, so it needs to be removed before passsing it to its constructor. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #391 +/- ##
==========================================
- Coverage 94.72% 94.65% -0.08%
==========================================
Files 45 45
Lines 5385 5389 +4
==========================================
Hits 5101 5101
- Misses 284 288 +4
🚀 New features to boost your workflow:
|
|
thanks a lot! The last version I tested was 1.1.0 of hf_hub, looking up the changelog was smart :) |
kyteinsky
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.
works like a charm!
cloud-py-api/nc_py_api#391 version bump for nc_py_api will follow
It would have been, but I did not until you mentioned it 🙈 I directly dived into the code when I got the error 😅 Beauty of FOSS ;-) |
Starting with version 1.1.0, huggingface_hub initially passes 0 as the total when creating the progress bar and then updates it to the proper value. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
d07cf6c to
a722af0
Compare
oleksandr-nc
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.
Thank you for this PR, looks good now
|
@kyteinsky wdyt, is it worth releasing a new version with this fix? |
|
@oleksandr-nc yeah, let's have one. I suppose the model download feature might be used in many apps, for now we need this for live_transcription. |
Fixes #389
Starting with version 1.1.0, huggingface_hub passes a
nameargument to the custom progress bar. However, the basetqdmclass rejects unknown arguments, so it needs to be removed before passsing it to its constructor (like done in the progress bar provided by huggingface_hub).Besides that, since the same huggingface_hub change mentioned above 0 is initially passed as the total when creating the progress bar, so its use in the custom progress bar has been guarded to prevent a division by zero error.
Note, however, that I am not familiar at all with tqdm, huggingface_hub or nc_py_api, so there might be better fixes :-) (like showing an Initializing... message rather than just guarding the call to
nc.set_init_statusiftotal <= 0or things like that).