hf_hub_download and cached_download should read the token by default
See original GitHub issueDescribe 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:
- Created a year ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sgugger pointed me to this
transformers
PR for the original discussion https://github.com/huggingface/transformers/pull/9141one example of internal convo but earlier discussions were probably more interesting