fix: ensure /proxy/8000 path is included for HF space secrets
Browse files
agents.py
CHANGED
|
@@ -185,16 +185,13 @@ async def _call_amd_vllm(
|
|
| 185 |
"temperature": 0.1, # Low temperature for deterministic structured output
|
| 186 |
}
|
| 187 |
|
| 188 |
-
# Candidate endpoints
|
| 189 |
base_url = AMD_INFERENCE_URL.rstrip("/")
|
| 190 |
if not base_url.startswith("http"):
|
| 191 |
base_url = f"http://{base_url}"
|
|
|
|
|
|
|
| 192 |
candidates = [
|
| 193 |
-
f"{base_url}/
|
| 194 |
-
f"{base_url}/proxy/8001/v1/chat/completions",
|
| 195 |
-
f"{base_url}:8000/v1/chat/completions",
|
| 196 |
-
f"{base_url}:8001/v1/chat/completions",
|
| 197 |
-
f"{base_url}/v1/chat/completions",
|
| 198 |
]
|
| 199 |
|
| 200 |
headers = {}
|
|
|
|
| 185 |
"temperature": 0.1, # Low temperature for deterministic structured output
|
| 186 |
}
|
| 187 |
|
|
|
|
| 188 |
base_url = AMD_INFERENCE_URL.rstrip("/")
|
| 189 |
if not base_url.startswith("http"):
|
| 190 |
base_url = f"http://{base_url}"
|
| 191 |
+
if "/proxy/8000" not in base_url:
|
| 192 |
+
base_url = f"{base_url}/proxy/8000"
|
| 193 |
candidates = [
|
| 194 |
+
f"{base_url}/v1/chat/completions"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
]
|
| 196 |
|
| 197 |
headers = {}
|
app.py
CHANGED
|
@@ -216,10 +216,11 @@ async def api_get_telemetry():
|
|
| 216 |
status = "Connected"
|
| 217 |
error_msg = None
|
| 218 |
|
| 219 |
-
# Try current proxy endpoint
|
| 220 |
base_url = AMD_INFERENCE_URL.rstrip('/')
|
| 221 |
if not base_url.startswith("http"):
|
| 222 |
base_url = f"http://{base_url}"
|
|
|
|
|
|
|
| 223 |
url = f"{base_url}/v1/models"
|
| 224 |
headers = {}
|
| 225 |
if AMD_INFERENCE_TOKEN:
|
|
|
|
| 216 |
status = "Connected"
|
| 217 |
error_msg = None
|
| 218 |
|
|
|
|
| 219 |
base_url = AMD_INFERENCE_URL.rstrip('/')
|
| 220 |
if not base_url.startswith("http"):
|
| 221 |
base_url = f"http://{base_url}"
|
| 222 |
+
if "/proxy/8000" not in base_url:
|
| 223 |
+
base_url = f"{base_url}/proxy/8000"
|
| 224 |
url = f"{base_url}/v1/models"
|
| 225 |
headers = {}
|
| 226 |
if AMD_INFERENCE_TOKEN:
|