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.

"no-token" is passed to `huggingface_hub` when token is `None`

See original GitHub issue

Describe the bug

In the 2 lines listed below, a token is passed to huggingface_hub to get information from a dataset. If no token is provided, a “no-token” string is passed. What is the purpose of it ? If no real, I would prefer if the None value could be sent directly to be handle by huggingface_hub. I feel that here it is working because we assume the token will never be validated.

https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L753 https://github.com/huggingface/datasets/blob/5b23f58535f14cc4dd7649485bce1ccc836e7bca/src/datasets/load.py#L1121

Expected results

Pass token=None to huggingface_hub.

Actual results

token="no-token" is passed.

Environment info

huggingface_hub v0.10.0dev

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
albertvillanovacommented, Sep 21, 2022

Hi @Wauplin, thanks for the warning about the deprecation of token in favor of use_auth_token.

Indeed, in datasets we use internally use_auth_token, which in this case was transformed to token to call HfApi.dataset_info: https://github.com/huggingface/datasets/blob/1a9385d7cc8a3241b44015145ef56a230fdadc51/src/datasets/load.py#L747

Therefore, for the new hfh release, the fix will be trivial: we will pass directly use_auth_token.

As discussed during our meeting yesterday, due to the fact that at datasets we support multiple hfh versions, I think we should handle passing token or use_auth_token depending on the hfh version.

1reaction
lhoestqcommented, Sep 20, 2022

As soon as token is deprecated and hfh has a new release, we’ll update datasets to use the new argument instead. Does it sound good to you ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to login to Huggingface Hub with Access Token - Beginners
I simply want to login to Huggingface HUB using an access token. I signed up, read the card, accepted its terms by checking...
Read more >
How to fix no token found error while downloading hugging ...
use generate token from https://huggingface.co/settings/tokens and past it. install python lib huggingface_hub pip install huggingface_hub ...
Read more >
Code To Align Annotations With Huggingface Tokenizers
This post demonstrates an end to end implementation of token alignment and ... if token_ix is not None: # White spaces have no...
Read more >
huggingface-hub Changelog - pyup.io
Now possible to login with a hardcoded token (non-blocking) ... `token` parameter can now be passed to every method in `huggingface_hub`.
Read more >
huggingface-hub - PyPI
Client library to download and publish models, datasets and other repos on the huggingface.co hub.
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