hyperbolic / app.py
mgokg's picture
Update app.py
a284b3d verified
raw
history blame
626 Bytes
import requests
import os
api_key=os.environ.get("HYPERBOLIC_API_KEY")
url = "https://api.hyperbolic.xyz/v1/chat/completions"
def hyperbolic(prompt):
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
data = {
"messages": [
{
"role": "user",
"content": f"{prompt}"
}
],
"model": "Qwen/Qwen2.5-72B-Instruct",
"max_tokens": 32768,
"temperature": 0.2,
"top_p": 0.9
}
response = requests.post(url, headers=headers, json=data)
print(response.json())