question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] huggingface_hub.cached_download() takes 1 positional argument but 2 were given

See original GitHub issue

Hi!

Followed this model speechbrain/asr-crdnn-transformerlm-librispeech from huggingface models hub.

Error

code:

EncoderDecoderASR.from_hparams(
    source=asr_model_source,
    savedir=to_absolute_path('./models'),
    run_opts={'device': torch.device('cpu')}
)

trace (catched in pytest):

score.py:101: in main
    asr_model = EncoderDecoderASR.from_hparams(
../miniconda3/lib/python3.9/site-packages/speechbrain/pretrained/interfaces.py:335: in from_hparams
    pymodule_local_path = fetch(


>               fetched_file = huggingface_hub.cached_download(url, use_auth_token)
E               TypeError: cached_download() takes 1 positional argument but 2 were given

../miniconda3/lib/python3.9/site-packages/speechbrain/pretrained/fetching.py:116: TypeError

Versions

pip freeze | grep -E hugging|speech:

huggingface-hub==0.8.1
speechbrain==0.5.11

version of huggingface-hub<0.8 works fine

Solution

use_auth_token should be a keyword argument

Here is my contribution #1458

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

2reactions
serkansuluncommented, Jun 22, 2022

Try downgrading huggingface_hub: pip uninstall huggingface_hub && pip install huggingface_hub==0.7

0reactions
Arnold-gitcommented, Jun 24, 2022

@taylorchu this is just a future warning, you can ignore it with

import warnings
warnings.filterwarnings("ignore", category=FutureWarning) 
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: method() takes 1 positional argument but 2 were ...
When the method dispatch tries to call method(arg): and match up two parameters self, arg against it, you get that error. – smci....
Read more >
Python takes 1 positional argument but 2 were given Solution
In this article, we discuss this error and why it is raised. We walk through an example of this error to help you...
Read more >
speechbrain/emotion-recognition-wav2vec2-IEMOCAP
We're on a journey to advance and democratize artificial intelligence through ... TypeError: cached_download() takes 1 positional argument but 2 were given.
Read more >
save() takes 1 positional argument but 2 were given : r/django
I am trying to register as a seller ( is_seller=True). But I am getting this issue of save() function cant take two positional...
Read more >
method() takes 1 positional argument but 2 were given - Finxter
Problem Formulation: Method Takes One Arguments But Two Are Given. Consider the following minimal example where this error occurs. Most occurrences of this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found