Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -403,6 +403,7 @@ def _load_user_submissions(username: str) -> List[Dict]:
|
|
| 403 |
except Exception:
|
| 404 |
status = {"state": "unknown"}
|
| 405 |
metrics = status.get("metrics", {}) if status.get("state") == "done" else {}
|
|
|
|
| 406 |
results.append({
|
| 407 |
"submission_id": sid,
|
| 408 |
"team": meta.get("team", ""),
|
|
@@ -411,6 +412,7 @@ def _load_user_submissions(username: str) -> List[Dict]:
|
|
| 411 |
"challenge_type": meta.get("challenge_type", ""),
|
| 412 |
"timestamp": meta.get("timestamp", 0),
|
| 413 |
"state": status.get("state", "unknown"),
|
|
|
|
| 414 |
**metrics,
|
| 415 |
})
|
| 416 |
except Exception:
|
|
@@ -592,7 +594,7 @@ def page_my_submissions():
|
|
| 592 |
if "state" in df.columns:
|
| 593 |
df["status"] = df["state"].apply(lambda s: f"{state_colors.get(s, '⚪')} {s.capitalize()}")
|
| 594 |
|
| 595 |
-
display_cols = ["submitted_at", "status", "team", "model", "phase", "challenge_type"]
|
| 596 |
metric_cols = [m for m in LEADERBOARD_METRICS if m in df.columns]
|
| 597 |
display_cols += metric_cols
|
| 598 |
df_display = df[[c for c in display_cols if c in df.columns]].copy()
|
|
@@ -601,6 +603,7 @@ def page_my_submissions():
|
|
| 601 |
"submitted_at": st.column_config.DatetimeColumn("Submitted At", format="D MMM YYYY, h:mm a"),
|
| 602 |
"status": "Status", "team": "Team", "model": "Model",
|
| 603 |
"phase": "Phase", "challenge_type": "Challenge Type",
|
|
|
|
| 604 |
}
|
| 605 |
for m in metric_cols:
|
| 606 |
col_config[m] = st.column_config.NumberColumn(m, format="%.4f")
|
|
|
|
| 403 |
except Exception:
|
| 404 |
status = {"state": "unknown"}
|
| 405 |
metrics = status.get("metrics", {}) if status.get("state") == "done" else {}
|
| 406 |
+
error = status.get("error", "") if status.get("state") == "failed" else ""
|
| 407 |
results.append({
|
| 408 |
"submission_id": sid,
|
| 409 |
"team": meta.get("team", ""),
|
|
|
|
| 412 |
"challenge_type": meta.get("challenge_type", ""),
|
| 413 |
"timestamp": meta.get("timestamp", 0),
|
| 414 |
"state": status.get("state", "unknown"),
|
| 415 |
+
"error": error[:120] if error else "",
|
| 416 |
**metrics,
|
| 417 |
})
|
| 418 |
except Exception:
|
|
|
|
| 594 |
if "state" in df.columns:
|
| 595 |
df["status"] = df["state"].apply(lambda s: f"{state_colors.get(s, '⚪')} {s.capitalize()}")
|
| 596 |
|
| 597 |
+
display_cols = ["submitted_at", "status", "team", "model", "phase", "challenge_type", "error"]
|
| 598 |
metric_cols = [m for m in LEADERBOARD_METRICS if m in df.columns]
|
| 599 |
display_cols += metric_cols
|
| 600 |
df_display = df[[c for c in display_cols if c in df.columns]].copy()
|
|
|
|
| 603 |
"submitted_at": st.column_config.DatetimeColumn("Submitted At", format="D MMM YYYY, h:mm a"),
|
| 604 |
"status": "Status", "team": "Team", "model": "Model",
|
| 605 |
"phase": "Phase", "challenge_type": "Challenge Type",
|
| 606 |
+
"error": "Error Message",
|
| 607 |
}
|
| 608 |
for m in metric_cols:
|
| 609 |
col_config[m] = st.column_config.NumberColumn(m, format="%.4f")
|