Spaces:
Sleeping
Sleeping
Commit ·
327b2ac
1
Parent(s): c15ec0b
Fix health check to accept both ok and healthy
Browse files- inference.py +13 -4
- inference_log.txt +0 -0
inference.py
CHANGED
|
@@ -246,13 +246,22 @@ def main():
|
|
| 246 |
print(f"Env : {ENV_URL}", file=sys.stderr)
|
| 247 |
|
| 248 |
# Smoke-test health endpoint
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
|
| 253 |
scores = {}
|
| 254 |
for task_id in [1, 2, 3]:
|
| 255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
|
| 257 |
print("\n" + "="*60, file=sys.stderr)
|
| 258 |
print(" BASELINE RESULTS", file=sys.stderr)
|
|
|
|
| 246 |
print(f"Env : {ENV_URL}", file=sys.stderr)
|
| 247 |
|
| 248 |
# Smoke-test health endpoint
|
| 249 |
+
try:
|
| 250 |
+
health = api_get("/health")
|
| 251 |
+
assert health.get("status") in ("ok", "healthy"), f"Unexpected status: {health}"
|
| 252 |
+
print("Health check: OK\n", file=sys.stderr)
|
| 253 |
+
except Exception as exc:
|
| 254 |
+
print(f"[ERROR] Environment not reachable at {ENV_URL}: {exc}", file=sys.stderr)
|
| 255 |
+
print("[ERROR] Make sure the server is running and ENV_URL is correct.", file=sys.stderr)
|
| 256 |
+
sys.exit(1)
|
| 257 |
|
| 258 |
scores = {}
|
| 259 |
for task_id in [1, 2, 3]:
|
| 260 |
+
try:
|
| 261 |
+
scores[f"task{task_id}"] = run_task(task_id)
|
| 262 |
+
except Exception as exc:
|
| 263 |
+
print(f"[ERROR] Task {task_id} failed: {exc}", file=sys.stderr)
|
| 264 |
+
scores[f"task{task_id}"] = 0.0
|
| 265 |
|
| 266 |
print("\n" + "="*60, file=sys.stderr)
|
| 267 |
print(" BASELINE RESULTS", file=sys.stderr)
|
inference_log.txt
CHANGED
|
Binary files a/inference_log.txt and b/inference_log.txt differ
|
|
|