No access to the model even after getting permission

#184
by SofiaMO - opened

When I use:

model_id = "meta-llama/Meta-Llama-3-8B"
access_token = "hf_..."

pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
token=access_token,
device_map="auto",
)

I still get the access error:
Make sure to have access to it at https://huggingface.co/meta-llama/Meta-Llama-3-8B.
Access to model meta-llama/Meta-Llama-3-8B is restricted. You must be authenticated to access it.

I got access to the model 2 days ago, and I am using my account token.
Can anyone help me to troubleshoot this?

hi,

I had a similar issue and fixed it by using the login() function from hugging face_hub module.

For example:

from transformers import pipeline
from huggingface_hub import login

login("your_token_here") # this will be cached so you don't need to login again next time you want to use it 

pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3-8B")
pipe("your prompt here")

Sign up or log in to comment