-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Description
I get the following error message with Huggingface:
openai.InternalServerError: Error code: 500 - {'error': 'litellm.AuthenticationError: HuggingfaceException - {"error":"Invalid username or password."}'}
I don't know where I should input my Huggingface credentials. This is my code:
import os
from openai import OpenAI
messages=[
{
"role": "user",
"content": "Write a Python program to build an RL model to recite text from any position that the user provides, using only numpy."
}
]
OPENAI_KEY = "optillm"
OPENAI_BASE_URL = "http://localhost:8000/v1"
os.environ["HUGGINGFACEHUB_API_TOKEN"] = "XXX"
client = OpenAI(api_key=OPENAI_KEY, base_url=OPENAI_BASE_URL)
response = client.chat.completions.create(
model="huggingface/meta-llama/Llama-3.2-1B-Instruct",
messages=messages,
temperature=0.2,
)
print(response)
Metadata
Metadata
Assignees
Labels
No labels