Cannot access gated repo You must be authenticated to access it.

#93
by liketheflower - opened

Got the following error today and it works yesterday.
Cannot access gated repo for url https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/resolve/main/config.json.
Repo model mistralai/Mistral-7B-Instruct-v0.2 is gated. You must be authenticated to access it.

Any ideas about how to get the authentication? Thanks!

I passed hugging face token to constructor and it worked

How do I do that?

why?

same

istrli

I have another machine with cached file. By using that cached file, it works but needs to find a formal solution.
The cache file can be found in ~/.cache/huggingface

Same problem I can face today so what is the solution of this problem or how to handle it?

Make a request to access the repo and then pass a access token by passing token=<your_token>.

from huggingface_hub import login
login(token="your_access_token")

An access_token_can be get by your hugging face account settings

This worked for me:
I went to model card and clicked "Agree and access repository". Then I was able to start downloading.
image.png

This worked for me:
I went to model card and clicked "Agree and access repository". Then I was able to start downloading.
image.png

sadly this did not work for me. I also tried putting my huggingface token in my privategpt settings.yaml file without success. Not sure what others have done here. The information is too vague (I do not understand it well enough) for me to follow.

Same issue... I am trying to use this with VLLM. How to pass token with vllm

pip install --upgrade huggingface_hub

huggingface-cli login

YOUR_ACCESS_TOKEN

Done

pip install --upgrade huggingface_hub

huggingface-cli login

YOUR_ACCESS_TOKEN

Done

THANK YOU.

why? without any heads up, this just broke so many pipelines in production.

deleted
edited Apr 20

why? without any heads up, this just broke so many pipelines in production.

if you rely on a free service, and dont plan ahead for it to vanish totally tomorow. you get burnt. What happens when HF start charging for any access? Or they vanish, due technical problems, throw in the towel, or are shut down forcefully.. "whaaaa i should have got the files downloaded locally to keep" ( or even a project. )

it worked for me after "Agree and access repository" but now it's not working again. What could be the possible solution.

This comment has been hidden
deleted
edited Apr 21

bla bla nonsense bla bla whining

ignore

This comment has been hidden
deleted

Well i did say id ignore but one last comment before i disable updates: You are an entitled whiny ass gen Z bitch. If you dont pay, you have ZERO right to complain. YOU are part of the problem.

This comment has been hidden

I passed hugging face token to constructor and it worked

Why do we need to use this token to run this model on local environment?

This worked for me:
I went to model card and clicked "Agree and access repository". Then I was able to start downloading.
image.png

sadly this did not work for me. I also tried putting my huggingface token in my privategpt settings.yaml file without success. Not sure what others have done here. The information is too vague (I do not understand it well enough) for me to follow.

What if I need to handle this on server, How to do this in server?

It works for me in google collab in doing this after cliking on the model "Agree and access repository"

!pip install --upgrade huggingface_hub
!huggingface-cli login --token $REPLACE_WITH_YOUR_TOKEN_ON_HUGGING_FACE

Result : The token has not been saved to the git credentials helper. Pass `add_to_git_credential=True` in this function directly or `--add-to-git-credential` if using via `huggingface-cli` if you want to set the git credential as well. Token is valid (permission: read). Your token has been saved to /root/.cache/huggingface/token Login successful

When you want to do through your terminal where you have your active environment .
Just run two command.

  1. pip install --upgrade huggingface_hub
  2. huggingface-cli login --token "Your access token"
    Then you will see something like this
    The token has not been saved to the git credentials helper. Pass add_to_git_credential=True in this function directly or --add-to-git-credential if using via huggingface-cli if you want to set the git credential as well.
    Token is valid (permission: write).
    Your token has been saved to /home/.cache/huggingface/token
    Login successful
    All set!!!!!!!!!!!!!!1

I had to go to the model's page on huggingface and click "I accept the terms" in order for the download to work.

Everybody talks about the TOKEN but where is this token gotten from? How do we get this token?

I passed hugging face token to constructor and it worked

What token?

I passed hugging face token to constructor and it worked

What token?

Obviously and like any API service you use, you should go to your user settings and generate a token for using the API.
Just google "how to generate token for huggingface hub".

Sign up or log in to comment