mlx-examples icon indicating copy to clipboard operation
mlx-examples copied to clipboard

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

Open WenhongXu opened this issue 1 year ago • 1 comments

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?

WenhongXu avatar May 07 '24 00:05 WenhongXu

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

Does that work for you?

awni avatar May 07 '24 19:05 awni