modedl ckpt tooltips

This commit is contained in:
Dobromir Popov
2025-08-10 16:25:49 +03:00
parent ade4e117bf
commit 7289366a35
3 changed files with 48 additions and 7 deletions

View File

@@ -90,6 +90,13 @@ class ModelsTrainingPanel:
if model_states and model_name in model_states:
ckpt_loaded = bool(model_states[model_name].get("checkpoint_loaded", False))
ckpt_failed = bool(model_states[model_name].get("checkpoint_failed", False))
# If model started fresh, mark as stored after first successful autosave/best_loss update
if not ckpt_loaded:
cur = model_states[model_name].get("current_loss")
best = model_states[model_name].get("best_loss")
if isinstance(cur, (int, float)) and isinstance(best, (int, float)) and best is not None and cur is not None and cur <= best:
ckpt_loaded = True
checkpoint_filename = model_states[model_name].get("checkpoint_filename")
model_info = {
"name": model_name,
@@ -105,6 +112,7 @@ class ModelsTrainingPanel:
"routing_enabled": True,
"checkpoint_loaded": ckpt_loaded,
"checkpoint_failed": ckpt_failed,
"checkpoint_filename": checkpoint_filename if model_states and model_name in model_states else None,
"loss_metrics": loss_metrics,
"timing_metrics": timing_metrics,
"signal_stats": {},
@@ -178,11 +186,18 @@ class ModelsTrainingPanel:
timing = model_data.get("timing_metrics", {})
rate = timing.get("inferences_per_second")
# Tooltip title showing checkpoint info (if any)
title_parts: List[str] = [f"{status_text}"]
ckpt_name = model_data.get('checkpoint_filename')
if ckpt_name:
title_parts.append(f"CKPT: {ckpt_name}")
header_title = " | ".join(title_parts)
return html.Div([
html.Div([
html.Div([
html.I(className=f"{status_icon} me-2 {status_class}"),
html.Strong(f"{model_name.upper()}", className=status_class),
html.Strong(f"{model_name.upper()}", className=status_class, title=header_title),
html.Span(f" - {status_text}", className=f"{status_class} small ms-1"),
html.Span(" [CKPT]" if model_data.get("checkpoint_loaded") else (" [FAILED]" if model_data.get("checkpoint_failed") else " [FRESH]"), className=f"small {'text-success' if model_data.get('checkpoint_loaded') else 'text-danger' if model_data.get('checkpoint_failed') else 'text-warning'} ms-1")
], style={"flex": "1"}),