Cannot access gated repo

#123
by Kandhuri - opened

Hi, I am Kiran, I have been granted access to use llma 3 by hugging face, but when try to access the model from the VScode it says Cannot access gated repo. I am using hugging face token (Read only) to access the model from vscode.

Hi this worked.
if you are using the Vscosde follow the instructions below

from huggingface_hub import login
from transformers import AutoTokenizer, AutoModelForCausalLM
from transformers import pipeline

login(token = 'your_token')

tokenizer = AutoTokenizer.from_pretrained(
"meta-llama/Meta-Llama-3-8B",
cache_dir="/kaggle/working/"
)

model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Meta-Llama-3-8B",
cache_dir="/kaggle/working/",
device_map="auto",
)

osanseviero changed discussion status to closed

Sign up or log in to comment