Unable to access Llama3.1 model despite having access granted
HTTPError: 400 Client Error: Bad Request for url:https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3.1-8B-Instruct
2024-09-09T03:30:37Z
That’s normal. This model isGated, so you have to provide personal information and use a token for your account to use it.If that’s not possible, you’ll have to find another copy of one of these.Is there llama3 api for hugging face to use?BeginnersHi, 
HF provides theserverless Inference APIto do just that. It comes with OpenAI-compatible APIs. 
Usage is as follows (add your HF token): 
# instead of `from openai import OpenAI`
from huggingface_hub import InferenceClient

# instead of `client = OpenAI(...)`
client = InferenceClient(
    "meta-llama/Meta-Llama-3.1-8B-Instruct",
    token=<your-hf-token>,
)

output = client.chat.completions.create(
    model="meta-llama/Meta-Llama-3-8B-Instruct",
    messages=[
        {"role": "system", "…