-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
~/.huggingface/token is loaded with EOL #1634
Comments
@GBR-613 yes indeed, we could add a Regardless to this specific issue, do you know that you can save your token using |
in fact, I'm wondering if it didn't use to be the case that we were stripping any newlines from |
@Wauplin BTW, the documentation says several times:
That gave me impression that
OK, will do. |
Thanks for the quick PR @GBR-613 :) I've approved it and will merge once the CI is green. |
* Fix bug #1634 (drop finishing spaces and EOL) * Update tests/test_utils_hf_folder.py * Update tests/test_utils_hf_folder.py * make style --------- Co-authored-by: Lucain <[email protected]>
Describe the bug
I copy the authentication token from the site and put it into ~/.huggingface/token using vim, nano or what else method.
When I run the code, load_datasets() fails, because a newline character is added to the token.
There is a workaround to solve the problem:
truncate -s -1 .huggingface/token
But I believe correct solution would be to drop the finishing "\n" in the library code, for example in
HfFolder().get_token()
, if it is present, and to drop any finishing space characters too.Reproduction
from datasets import load_dataset
ds = load_dataset("my-company/my-ds", verification_mode="no_checks", token=True)
Logs
System info
The text was updated successfully, but these errors were encountered: