How to login to Huggingface Hub with Access Token

I initially created read and write tokens at Hugging Face – The AI community building the future. as below:

In the python code, I am using the following import and the necessary access token.

from huggingface_hub import login
access_token_read = “abc”
access_token_write = “xyz”
login(token = access_token_read)

1 Like

That worked !!

So I’m guessing you guys are on Windows, the EASIEST thing is in your command prompt set the environment variable HF_TOKEN and the download-model.py script will do the rest assuming you’re using oogabooga

set HF_TOKEN=<YOUR_TOKEN>

ctrl + “right click”