Spaces:
Runtime error
Runtime error
| 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) |