model checkpoints
This commit is contained in:
@ -366,9 +366,13 @@ class DashboardComponentManager:
|
||||
pred_action = last_prediction.get('action', 'NONE')
|
||||
pred_confidence = last_prediction.get('confidence', 0)
|
||||
|
||||
# 5MA Loss
|
||||
# 5MA Loss - with safe comparison handling
|
||||
loss_5ma = model_info.get('loss_5ma', 0.0)
|
||||
loss_class = "text-success" if loss_5ma < 0.1 else "text-warning" if loss_5ma < 0.5 else "text-danger"
|
||||
if loss_5ma is None:
|
||||
loss_5ma = 0.0
|
||||
loss_class = "text-muted"
|
||||
else:
|
||||
loss_class = "text-success" if loss_5ma < 0.1 else "text-warning" if loss_5ma < 0.5 else "text-danger"
|
||||
|
||||
# Model size/parameters
|
||||
model_size = model_info.get('parameters', 0)
|
||||
@ -381,14 +385,20 @@ class DashboardComponentManager:
|
||||
else:
|
||||
size_str = str(model_size)
|
||||
|
||||
# Get checkpoint filename for tooltip
|
||||
checkpoint_filename = model_info.get('checkpoint_filename', 'No checkpoint info')
|
||||
checkpoint_status = "LOADED" if model_info.get('checkpoint_loaded', False) else "FRESH"
|
||||
|
||||
# Model card
|
||||
model_card = html.Div([
|
||||
# Header with model name and toggle
|
||||
html.Div([
|
||||
html.Div([
|
||||
html.I(className=f"{status_icon} me-2 {status_class}"),
|
||||
html.Strong(f"{model_name.upper()}", className=status_class),
|
||||
html.Span(f" ({size_str} params)", className="text-muted small ms-2")
|
||||
html.Strong(f"{model_name.upper()}", className=status_class,
|
||||
title=f"Checkpoint: {checkpoint_filename}"),
|
||||
html.Span(f" ({size_str} params)", className="text-muted small ms-2"),
|
||||
html.Span(f" [{checkpoint_status}]", className=f"small {'text-success' if checkpoint_status == 'LOADED' else 'text-warning'} ms-1")
|
||||
], style={"flex": "1"}),
|
||||
|
||||
# Activation toggle (if easy to implement)
|
||||
|
Reference in New Issue
Block a user