Unable to access model - Error 401 Gated model error although I have access

I have access to the gated PaliGemma-3b-mix-224 model from Google, however, when trying to access it through HF, I get the following error:

I’ve logged in to HF, created a new access token, used it in the Colab notebook, but it doesn’t work. This used to work before the recent issues with HF access tokens. Any help is appreciated.

from huggingface_hub import notebook_login
notebook_login()

Hi,

The strategy regarding tokens recently changed. Basically when going to Hugging Face – The AI community building the future., you can refresh and obtain a new token, but unlike before, you can no longer access this token when you close that page and come back to it later. Hence it’s advised to keep its value somewhere in a safe space (like a password manager), and use it anywhere you’d like to use it (like setting it as a HF_TOKEN environment variable or as a Google Colab secret).

So my assumption is that you’re probably still using an older token.

@nielsr so to be clear, access to gated models is now no longer via accounts but via a specific tokens within my account?

If so,

  1. How do I know which token(s) correspond to which gated models?

  2. For a gated model and a specific token, how do I give that token access to that gated model?

Also, this change just burned about 168 A100 hours I desperately needed before a deadline :frowning_face:

The access to gated models happens through your account. Tokens are just meant as a way to authenticate with the account. You can authenticate with your token by creating one and copying it from Hugging Face – The AI community building the future.. You can create multiple tokens, all of which allow you to authenticate with your account.

1 Like