FABLESLIP commited on
Commit
e2b2b1d
·
verified ·
1 Parent(s): 2b33875

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -0
app.py CHANGED
@@ -147,6 +147,14 @@ def _default_model_list() -> List[str]:
147
  return []
148
 
149
  def _log_warmup(msg: str):
 
 
 
 
 
 
 
 
150
  print(f"[WARMUP] {msg}", file=sys.stdout)
151
  with warmup_lock:
152
  warmup_state["logs"].append(msg)
@@ -1036,6 +1044,31 @@ function buildFinalSummary(s){
1036
  const failL = Array.isArray(s.failed_repos) ? s.failed_repos : [];
1037
  const cached = Array.isArray(s.audit_cached) ? s.audit_cached : [];
1038
  const tot = s.total ?? asked.length ?? 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1039
 
1040
  const lines = [];
1041
  lines.push("RÉCAP FINAL");
@@ -1209,6 +1242,22 @@ if (warmupStartBtn){
1209
  warmupPreface = '';
1210
  }
1211
  // Ouvre la popup et affiche immédiatement la liste demandée
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1212
  userClosedWarmupPopup = false;
1213
  openWarmupPopup();
1214
  if (warmupPopupStatus) warmupPopupStatus.textContent = 'Téléchargement en cours…';
 
147
  return []
148
 
149
  def _log_warmup(msg: str):
150
+ # >>> ICONES LOGS (ajout) <<<
151
+ if msg.startswith("[CACHE]"): msg = "⬛ " + msg # ignoré: déjà en cache
152
+ elif msg.startswith("[START]"): msg = "⏳ " + msg # démarrage d'un dépôt
153
+ elif msg.startswith("[DONE]"): msg = "✅ " + msg # téléchargement OK
154
+ elif msg.startswith("[FAIL]"): msg = "❌ " + msg # échec
155
+ elif msg.startswith("[STOP]"): msg = "⏹️ " + msg # arrêt demandé
156
+ # >>> FIN AJOUT <<<
157
+
158
  print(f"[WARMUP] {msg}", file=sys.stdout)
159
  with warmup_lock:
160
  warmup_state["logs"].append(msg)
 
1044
  const failL = Array.isArray(s.failed_repos) ? s.failed_repos : [];
1045
  const cached = Array.isArray(s.audit_cached) ? s.audit_cached : [];
1046
  const tot = s.total ?? asked.length ?? 0;
1047
+ // >>> RÉSUMÉ LISIBLE (ajout) <<<
1048
+ const ignored = asked.filter(m => cached.includes(m) && !okL.includes(m) && !failL.includes(m));
1049
+ const out = [];
1050
+ out.push("RÉCAP FINAL");
1051
+ out.push(`Demandés : ${asked.length}`);
1052
+ if (asked.length) out.push(asked.map(m => ' • ' + m).join('\n'));
1053
+
1054
+ out.push("");
1055
+ out.push(`⬛ Ignorés (déjà en cache) : ${ignored.length}`);
1056
+ if (ignored.length) out.push(ignored.map(m => ' • ' + m).join('\n'));
1057
+
1058
+ out.push("");
1059
+ out.push(`✅ Téléchargés : ${okL.length}`);
1060
+ if (okL.length) out.push(okL.map(m => ' • ' + m).join('\n'));
1061
+
1062
+ out.push("");
1063
+ out.push(`❌ Échecs : ${failL.length}`);
1064
+ if (failL.length) out.push(failL.map(m => ' • ' + m).join('\n'));
1065
+
1066
+ out.push("");
1067
+ out.push(`📦 En cache maintenant : ${cached.length}`);
1068
+ if (cached.length) out.push(cached.map(m => ' • ' + m).join('\n'));
1069
+
1070
+ return out.join('\n');
1071
+ // >>> FIN AJOUT <<<
1072
 
1073
  const lines = [];
1074
  lines.push("RÉCAP FINAL");
 
1242
  warmupPreface = '';
1243
  }
1244
  // Ouvre la popup et affiche immédiatement la liste demandée
1245
+ // >>> PRÉAMBULE EXPLICITE (ajout) <<<
1246
+ try {
1247
+ const ra2 = await fetch('/warmup/audit');
1248
+ const audit2 = ra2.ok ? await ra2.json() : null;
1249
+ const cached2 = (audit2 && Array.isArray(audit2.cached)) ? audit2.cached : [];
1250
+ const ignored = models.filter(m => cached2.includes(m));
1251
+ warmupPreface =
1252
+ 'Demandés (' + models.length + '):\n' +
1253
+ models.map(m => ' • ' + m).join('\n') + '\n\n' +
1254
+ '⬛ Ignorés (déjà en cache) (' + ignored.length + '):\n' +
1255
+ ignored.map(m => ' • ' + m).join('\n') + '\n\n' +
1256
+ '📦 Déjà en cache global (' + cached2.length + '):\n' +
1257
+ cached2.map(m => ' • ' + m).join('\n');
1258
+ } catch(_) { /* no-op */ }
1259
+ // >>> FIN AJOUT <<<
1260
+
1261
  userClosedWarmupPopup = false;
1262
  openWarmupPopup();
1263
  if (warmupPopupStatus) warmupPopupStatus.textContent = 'Téléchargement en cours…';