Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GatedRepoError: 401 Client Error; "You must be authenticated to access it." #759

Open
WenhongXu opened this issue May 7, 2024 · 1 comment

Comments

@WenhongXu
Copy link

when i run the code below

model,tokenizer = load("mistralai/Mistral-7B-Instruct-v0.2")

error:

GatedRepoError: 401 Client Error. (Request ID: Root=1-66389f5d-0f09a9387397c642253a3cab;07f44087-7a0e-4f26-a444-29193404cbc8)
Cannot access gated repo for url https://huggingface.co/api/models/mistralai/Mistral-7B-Instruct-v0.2/revision/main.
Access to model mistralai/Mistral-7B-Instruct-v0.2 is restricted. You must be authenticated to access it.

I add the parameter named "token" in the "snapshot_download" function in "utils.py", then the error is gone.

should we expose the "token" parameter in the "load" function?

@awni
Copy link
Member

awni commented May 7, 2024

I use the HF CLI to login https://huggingface.co/docs/huggingface_hub/en/guides/cli#huggingface-cli-login

Does that work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants