Spaces:
Runtime error
Runtime error
DJAKOUA KWANKAM BRAYAN STEVE commited on
Commit ·
ecf2f73
1
Parent(s): aabbe2e
fix: use router.huggingface.co/hf endpoint (api-inference DNS not resolvable from Space)
Browse files
app.py
CHANGED
|
@@ -39,7 +39,8 @@ def infer(messages, model, temperature=0.7, top_p=0.9, max_tokens=2048, tools=No
|
|
| 39 |
if tools:
|
| 40 |
payload["tools"] = tools
|
| 41 |
|
| 42 |
-
url = f"https://
|
|
|
|
| 43 |
resp = requests.post(url, headers=headers, json=payload, timeout=120)
|
| 44 |
|
| 45 |
if resp.status_code == 503:
|
|
|
|
| 39 |
if tools:
|
| 40 |
payload["tools"] = tools
|
| 41 |
|
| 42 |
+
url = f"https://router.huggingface.co/hf/v1/chat/completions"
|
| 43 |
+
payload["model"] = model
|
| 44 |
resp = requests.post(url, headers=headers, json=payload, timeout=120)
|
| 45 |
|
| 46 |
if resp.status_code == 503:
|