Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,10 @@ import requests
|
|
| 3 |
api_url = "https://router.huggingface.co/hyperbolic/v1/chat/completions" # استبدل بالرابط الصحيح
|
| 4 |
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
data = {
|
| 7 |
"inputs": " مخترع المصباح من "
|
| 8 |
}
|
|
@@ -14,5 +18,4 @@ if response.status_code == 200:
|
|
| 14 |
print(response.json())
|
| 15 |
else:
|
| 16 |
print(f"Error: {response.status_code}")
|
| 17 |
-
print(response.text)
|
| 18 |
-
|
|
|
|
| 3 |
api_url = "https://router.huggingface.co/hyperbolic/v1/chat/completions" # استبدل بالرابط الصحيح
|
| 4 |
|
| 5 |
|
| 6 |
+
headers = {
|
| 7 |
+
"Authorization": f"Bearer {api_token}"
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
data = {
|
| 11 |
"inputs": " مخترع المصباح من "
|
| 12 |
}
|
|
|
|
| 18 |
print(response.json())
|
| 19 |
else:
|
| 20 |
print(f"Error: {response.status_code}")
|
| 21 |
+
print(response.text)
|
|
|