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.

hf_hub_download and cached_download should read the token by default

See original GitHub issue

Describe the bug

Right now, hf_hub_download does not work for private repos unless you set use_auth_token=True. This is inconsistent with other methods in which the token is automatically retrieved if not specified. I think we should change https://github.com/huggingface/huggingface_hub/blob/7e80140bc5ea0a3991418d2cb6a6ecda90c4f38f/src/huggingface_hub/file_download.py#L577-L586 to always get the token if it’s not explicitly passed.

WDYT @LysandreJik @julien-c?

Reproduction

No response

Logs

No response

System Info

-

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
julien-ccommented, Jun 24, 2022

@sgugger pointed me to this transformers PR for the original discussion https://github.com/huggingface/transformers/pull/9141

0reactions
julien-ccommented, Jun 24, 2022

one example of internal convo but earlier discussions were probably more interesting

Read more comments on GitHub >

github_iconTop Results From Across the Web

User access tokens - Hugging Face
Access tokens allow applications and notebooks to perform specific actions specified by the scope of the roles shown in the following: read :...
Read more >
Automatic token authentication - GitHub Docs
If the default permissions for the GITHUB_TOKEN are restrictive, you may have to elevate the permissions to allow some actions and commands to...
Read more >
Microsoft identity platform access tokens
Learn about access tokens emitted by the Azure AD v1.0 and Microsoft identity platform (v2.0) endpoints.
Read more >
Access Tokens - Auth0
Read how Auth0 uses self-contained JSON Web Token (JWTs) access tokens that ... To validate an opaque token, the recipient of the token...
Read more >
Token - Auth Methods - HTTP API | Vault - HashiCorp Developer
Second, this will cause Vault's memory usage to balloon up, because the default Vault internal cache is unlimited in size and every value...
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