Update app.py
Browse files
app.py
CHANGED
@@ -490,7 +490,22 @@ async def warmup_start(payload: Optional[Dict[str, Any]] = Body(None)):
|
|
490 |
def warmup_status():
|
491 |
""" Retourne l'état courant du warm-up (progression, logs, etc.). """
|
492 |
with warmup_lock:
|
493 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
data["ts"] = time.time()
|
495 |
return data
|
496 |
|
@@ -923,12 +938,21 @@ async function refreshWarmupUI(){
|
|
923 |
if (warmupStatusEl) {
|
924 |
const tot = (s.total ?? 0);
|
925 |
if (running) {
|
|
|
|
|
|
|
926 |
const idx = (s.idx ?? 0) + 1;
|
927 |
warmupStatusEl.textContent = `⏳ ${pct}% — ${s.current||''} (${idx}/${tot})`;
|
928 |
-
} else if (s.done && tot > 0) {
|
929 |
-
warmupStatusEl.textContent = `✅ Terminé (${tot} modèles)`;
|
930 |
} else {
|
931 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
932 |
}
|
933 |
}
|
934 |
|
|
|
490 |
def warmup_status():
|
491 |
""" Retourne l'état courant du warm-up (progression, logs, etc.). """
|
492 |
with warmup_lock:
|
493 |
+
|
494 |
+
|
495 |
+
|
496 |
+
|
497 |
+
data = deepcopy(warmup_state)
|
498 |
+
|
499 |
+
# --- AJOUT : état du cache actuel ---
|
500 |
+
cached = _list_cached_repos()
|
501 |
+
data["audit_count"] = len(cached)
|
502 |
+
data["audit_cached"] = cached
|
503 |
+
# --- FIN AJOUT ---
|
504 |
+
|
505 |
+
|
506 |
+
|
507 |
+
|
508 |
+
|
509 |
data["ts"] = time.time()
|
510 |
return data
|
511 |
|
|
|
938 |
if (warmupStatusEl) {
|
939 |
const tot = (s.total ?? 0);
|
940 |
if (running) {
|
941 |
+
|
942 |
+
|
943 |
+
|
944 |
const idx = (s.idx ?? 0) + 1;
|
945 |
warmupStatusEl.textContent = `⏳ ${pct}% — ${s.current||''} (${idx}/${tot})`;
|
|
|
|
|
946 |
} else {
|
947 |
+
const nCache = Number.isFinite(s.audit_count)
|
948 |
+
? s.audit_count
|
949 |
+
: (Array.isArray(s.audit_cached) ? s.audit_cached.length : 0);
|
950 |
+
if (nCache > 0) {
|
951 |
+
warmupStatusEl.textContent = `✅ Terminé (${nCache} modèles en cache)`;
|
952 |
+
} else {
|
953 |
+
warmupStatusEl.textContent = `Prêt (aucun run)`;
|
954 |
+
}
|
955 |
+
|
956 |
}
|
957 |
}
|
958 |
|