Invalid token passed?

Token:
Traceback (most recent call last):
File “C:\Users\paint\anaconda3\Scripts\huggingface-cli-script.py”, line 9, in
sys.exit(main())
File “C:\Users\paint\anaconda3\lib\site-packages\huggingface_hub\commands\huggingface_cli.py”, line 41, in main
service.run()
File “C:\Users\paint\anaconda3\lib\site-packages\huggingface_hub\commands\user.py”, line 176, in run
_login(self._api, token=token)
File “C:\Users\paint\anaconda3\lib\site-packages\huggingface_hub\commands\user.py”, line 343, in _login
token, name = hf_api._validate_or_retrieve_token(token)
File “C:\Users\paint\anaconda3\lib\site-packages\huggingface_hub\hf_api.py”, line 691, in _validate_or_retrieve_token
raise ValueError(“Invalid token passed!”)
ValueError: Invalid token passed!

I use windows 10 and anaconda prompt. When I use huggingface-cli login, I get asked for a token, which I created and pasted but I still get Invalid token passed?

I have the exact same issue - is there a workaround?

I get that error as well. Me and a friend have been trying for 5 hours to fix and find solutions for it.

The solution is quite simple, yet unexpected.

you need to copy your token but instead of pasting it via CTRL+V you need to paste it into the console via a right click of your mouse.

1 Like

that doesn’t work either

go to your “\virtualenv\Lib\site-packages\huggingface_hub\commands” folder and there is a file in there called “user” or “userpy”. Edit the file and go to the area in the middle that looks like the huggingface login. The line should say token = getpass ("Token: ") Change this line to say token = “this is where your hugging face token goes including the quotation marks#getpass("Token: ")

Save file, then run huggingface-cli login again