Spaces:
Running
Running
sync: 157 file da Baida98/AI@c5ce5628 (2026-08-15 12:33 UTC) [deploy-all] (#38)
Browse files- sync: 157 file da Baida98/AI@c5ce5628 (2026-08-15 12:33 UTC) [deploy-all] (b9b4b60ec420ac972c521b39c38a8cc13355e434)
- api/benchmark_handler.py +12 -2
api/benchmark_handler.py
CHANGED
|
@@ -23,8 +23,18 @@ logger = logging.getLogger("agente_ai.benchmark_handler")
|
|
| 23 |
# Lo Space HF esegue il backend in /app; Railway può impostare REPO_ROOT.
|
| 24 |
_REPO_ROOT = os.getenv("REPO_ROOT", "/app")
|
| 25 |
|
| 26 |
-
# Extended v5: 20 categorie.
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
_REPORT_V7 = "/tmp/agente-ai/benchmark-v5-latest.json"
|
| 29 |
# 20 task seriali possono richiedere più di 12 minuti con provider gratuiti.
|
| 30 |
_BENCH_TIMEOUT = float(os.getenv("BENCH_TIMEOUT_SECS", "3600"))
|
|
|
|
| 23 |
# Lo Space HF esegue il backend in /app; Railway può impostare REPO_ROOT.
|
| 24 |
_REPO_ROOT = os.getenv("REPO_ROOT", "/app")
|
| 25 |
|
| 26 |
+
# Extended v5: 20 categorie. Gli Space possono montare il repository in
|
| 27 |
+
# /home/user/app anche quando il Dockerfile dichiara WORKDIR=/app.
|
| 28 |
+
_BENCH_SCRIPT_CANDIDATES = (
|
| 29 |
+
os.getenv("BENCHMARK_RUNNER_PATH", "").strip(),
|
| 30 |
+
os.path.join(_REPO_ROOT, "benchmark-extended.mjs"),
|
| 31 |
+
"/home/user/app/benchmark-extended.mjs",
|
| 32 |
+
"/app/benchmark-extended.mjs",
|
| 33 |
+
)
|
| 34 |
+
_BENCH_SCRIPT = next(
|
| 35 |
+
(candidate for candidate in _BENCH_SCRIPT_CANDIDATES if candidate and os.path.isfile(candidate)),
|
| 36 |
+
os.path.join(_REPO_ROOT, "benchmark-extended.mjs"),
|
| 37 |
+
)
|
| 38 |
_REPORT_V7 = "/tmp/agente-ai/benchmark-v5-latest.json"
|
| 39 |
# 20 task seriali possono richiedere più di 12 minuti con provider gratuiti.
|
| 40 |
_BENCH_TIMEOUT = float(os.getenv("BENCH_TIMEOUT_SECS", "3600"))
|