Spaces:
Runtime error
Runtime error
Update status line to show push/eval state
Browse files
app.py
CHANGED
|
@@ -34,15 +34,30 @@ def load_online_status(results_path: str = RESULTS_PATH) -> dict:
|
|
| 34 |
|
| 35 |
def build_status_line(status: dict) -> str:
|
| 36 |
finished = format_timestamp_utc8(status.get("finished_at", "n/a"))
|
|
|
|
| 37 |
data_source = status.get("data_source", "n/a")
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
f"
|
| 44 |
-
f"
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
def _dataset_tables(grouped: dict, datasets: list[str]) -> tuple[list, list]:
|
|
|
|
| 34 |
|
| 35 |
def build_status_line(status: dict) -> str:
|
| 36 |
finished = format_timestamp_utc8(status.get("finished_at", "n/a"))
|
| 37 |
+
pushed = format_timestamp_utc8(status.get("pushed_at", ""))
|
| 38 |
data_source = status.get("data_source", "n/a")
|
| 39 |
+
task_count = status.get("task_count")
|
| 40 |
+
eval_status = status.get("status", "unknown")
|
| 41 |
+
push_status = status.get("push_status", "unknown")
|
| 42 |
+
|
| 43 |
+
parts = [
|
| 44 |
+
f"**Live benchmark** · Data: `{data_source}`",
|
| 45 |
+
f"Last eval: **{finished}**",
|
| 46 |
+
]
|
| 47 |
+
if task_count is not None:
|
| 48 |
+
parts.append(f"Tasks: **{task_count}**")
|
| 49 |
+
if eval_status == "no_tasks":
|
| 50 |
+
parts.append("_No tasks collected (showing previous results)_")
|
| 51 |
+
elif eval_status == "partial":
|
| 52 |
+
parts.append("_Partial eval (some models failed)_")
|
| 53 |
+
if pushed and pushed != "n/a":
|
| 54 |
+
parts.append(f"Last pushed: **{pushed}**")
|
| 55 |
+
if push_status == "failed":
|
| 56 |
+
parts.append("_Push to HF failed — retrying next cycle_")
|
| 57 |
+
elif push_status == "pending":
|
| 58 |
+
parts.append("_Push pending_")
|
| 59 |
+
parts.append(f"Auto-refresh every {REFRESH_SECONDS}s")
|
| 60 |
+
return " · ".join(parts)
|
| 61 |
|
| 62 |
|
| 63 |
def _dataset_tables(grouped: dict, datasets: list[str]) -> tuple[list, list]:
|