Error 403! What to do about it?

This helped me. Thank you!

1 Like

Wow, this worked immediately. Use write token

I changed it to write token, but I am still getting the same error. Kindly help.

3 Likes

I tried with a ‘write’ token and deleted the commite message and it still not working!!! any solutions?

Great, generating a write mode token in huggingface works immediately

Thanks lot

_____thank yo _________

I am using the token with write permission still stucked with same issue, please help me.
In my case i am getting the 403 error and the error message is:
“Access to model meta-llama/Llama-2-7b-chat-hf is restricted and you are not in the authorized list. Visit meta-llama/Llama-2-7b-chat-hf · Hugging Face to ask for access.”

Same issue using colab and have tried several different write tokens. This is a ridiculous problem and is infuriating after a 30 min epoch to have it fail. I’ve tried 20 different ways to get this to work. Please explain a way to debug this more precisely.

1 Like

Yes, I have the same issue. Different write tokens used, logged in as correct user etc. Any ideas?

The only way I found around it in Colab was to

(I) disable Notebook Access for any and all keys (the key shaped menu item on the left side of the Colab UI)
(Ii) Go to Runtime > Disconnect and delete runtime
(Iii) Reconnect to a new runtime
(Iv) Replace any huggingfae-cli logins with :

from huggingface_hub import notebook_login
notebook_login()

(v) Enter your ‘write’ token when prompted

Basically, colab seems to cache any prior “read” tokens in a very persistent way that doesn’t get overwritten or replaced when you load a separate write token later in your notebook.

Hopefully this helps someone. Cost me like 5 hours I’m not getting back.

4 Likes

I had the same issue, you can navigate to meta-llama/Llama-2-7b-chat-hf · Hugging Face, and you need to sign the license agreement to gain access.

1 Like

I had the same problem and I solved it:
setting in environment variables HF_TOKEN and HUGGING_FACE_HUB_TOKEN to the same “write” token
huggingface-cli login
huggingface-cli download

2 Likes

Thanks Milyyiyo, Your Answer is helped me

Same here with google colab – I have a “write” access to token that apparently can’t “write”.

Thanks you so so much I can resolve similar issue :grinning:

Than you so much!!!

That works!! Thanks a lot :saluting_face: :saluting_face: :saluting_face:

Those having trouble writing into repo with WRITE token - also check you are using the right username in the repo_id parameter (“your_user_name/ppo-LunarLander-v2”).

i had the same problem getting Error 403, and not able to write to my own huggingface space, in spite of having a valid token with write permission (i was using transformers library version 0.44.2). It turned out that with the later versions of the transformers libraries, it is not enough if you login to huggingface with a valid write token, but you have to pass it as part of TrainingArguments(…) as follows: args = TrainingArguments(…, hub_token=<YOUR_HF_HUB_TOKEN_WITH_WRITE_PERMISSIONS>,…) and pass this args when you invoke the SFTTrainer.
For transformers library version 0.44.2, this worked for me.