Skip to content

Fix use of huggingface_hub.cached_download#1458

Merged
mravanelli merged 5 commits into
speechbrain:developfrom
SolomidHero:patch-1
Jun 21, 2022
Merged

Fix use of huggingface_hub.cached_download#1458
mravanelli merged 5 commits into
speechbrain:developfrom
SolomidHero:patch-1

Conversation

@SolomidHero

@SolomidHero SolomidHero commented Jun 21, 2022

Copy link
Copy Markdown
Contributor

issue #1459

@mravanelli

mravanelli commented Jun 21, 2022

Copy link
Copy Markdown
Collaborator

It looks like this is due to an interface change in the latest version of HuggingFace Hub. We can fix it in the development branch, but people using the main branch will see this error. Also, it seems your fix doesn't solve the problem:

  File "<stdin>", line 1, in <module>
  File "/network/scratch/r/ravanelm/speechbrain/speechbrain/pretrained/interfaces.py", line 338, in from_hparams
    pymodule_local_path = fetch(
  File "/network/scratch/r/ravanelm/speechbrain/speechbrain/pretrained/fetching.py", line 118, in fetch
    if e.response.status_code == 404:
AttributeError: 'NoneType' object has no attribute 'status_code'

Comment thread speechbrain/pretrained/fetching.py Outdated
Co-authored-by: Julien Chaumond <julien@huggingface.co>
Comment thread speechbrain/pretrained/fetching.py Outdated
@@ -113,7 +113,7 @@ def fetch(
logger.info(MSG)
url = huggingface_hub.hf_hub_url(source, filename)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to also remove that line if possible :)

@SolomidHero

Copy link
Copy Markdown
Contributor Author

Should we also update requirements:

huggingface_hub>=0.0.6

to the moment this hf_hub_download function was proposed (0.0.19 as latest patch version)

@TParcollet

Copy link
Copy Markdown
Collaborator

I hope it won't break other things to do this ...

@mravanelli

Copy link
Copy Markdown
Collaborator

Thank you @SolomidHero @julien-c for the help. I think we can merge it!

@mravanelli mravanelli merged commit 34be08f into speechbrain:develop Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants