prueba / appurl.py
adri017's picture
Ahora bien
70e3c59
raw
history blame contribute delete
512 Bytes
import os
import requests
API_URL = "https://router.huggingface.co/v1/chat/completions"
headers = {
"Authorization": f"Bearer ",
}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
response = query({
"messages": [
{
"role": "user",
"content": "Tell me the name of the arcs of one piece"
}
],
"model": "meta-llama/Llama-3.1-8B-Instruct:novita"
})
print(response["choices"][0]["message"])