Not able to login using notebook_login()/!huggingface-cli login

Hi, I am a complete beginner and this was my first attempt to use use the Huggingface products. I tried experimenting with this notebook (Audio-classification). The instructions up top said in clear words ‘First you have to store your authentication token from the Hugging Face website if you haven’t already!) then execute the following cell and input your username and password:’ I signed up and created a token and the prompt asked me to enter Username & Password
Screenshot 2024-03-17 at 8.02.13 PM
I entered the details and this was the message I got

404 Client Error: Not Found for url: https://huggingface.co/api/login

Error
Cannot POST /api/login

I tried entering my token instead of my password
I tried changing my password
Same result. Everywhere I go all the forums & tutorials login using a token. Am I doing something wrong?

I’ve found that using login() rather than notebook_login() works better. The code looks like:
from huggingface_hub import login

login(new_session=False, # Won’t request token if one is already saved on machine
write_permission=True, # Requires a token with write permission
token=‘Your token’, # The name of your token
add_to_git_credential=True)
Have a hugging face token ready ahead of time that you can copy and paste into the ‘token’ argument. If you created a token with a write permission, use write_permission=True. You won’t have to use the cli if you do it this way.

2 Likes

You may have specified the wrong space.
Make sure the access token you are using is for the intended space.