Llama 3.2 1G error
Hi, when I try to use Llama 3.2 1G using a Python script, I get this error:“Access to model meta-llama/Llama-3.2-1B is restricted. You must have access to it and be authenticated to access it. Please log in.”Can anyone tell me how to specify my HF credentials so that the Python script can log in?Thanks.
2024-10-03T03:00:11Z
Like this:How to use gated model in inferenceBeginnersYou could do it by making the code look like this.Sample code
import transformers
import torch

model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"

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

messages = [
    {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
    {"role": "user", "content": "Who are you?"},
]

outputs = pipeline(
    messag…