GatedRepoError: 401 Client Error; "You must be authenticated to access it."
WenhongXu opened this issue · comments
WenhongXu commented
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 Hannun commented
I use the HF CLI to login https://huggingface.co/docs/huggingface_hub/en/guides/cli#huggingface-cli-login
Does that work for you?