SAN_Chat / app.py
MOHAMED4543's picture
Update app.py
4c902ee verified
raw
history blame contribute delete
485 Bytes
import requests
api_url = "https://router.huggingface.co/hyperbolic/v1/chat/completions" # استبدل بالرابط الصحيح
headers = {
"Authorization": f"Bearer {api_token}"
}
data = {
"inputs": " مخترع المصباح من "
}
response = requests.post(api_url, headers=headers, json=data)
if response.status_code == 200:
print("Response from model:")
print(response.json())
else:
print(f"Error: {response.status_code}")
print(response.text)