This commit is contained in:
Dobromir Popov
2025-07-30 11:40:30 +03:00
parent 6ca19f4536
commit 36f429a0e2
6 changed files with 528 additions and 211 deletions

View File

@ -513,29 +513,47 @@ class ModelsTrainingPanel:
)
], style={"flex": "1"}),
# Toggle switches with pattern matching IDs
# Interactive toggles for inference and training
html.Div([
# Inference toggle
html.Div([
html.Label("Inf", className="text-muted small me-1", style={"font-size": "10px"}),
dcc.Checklist(
html.Label("Inf", className="text-muted", style={
"font-size": "9px",
"margin-bottom": "0",
"margin-right": "3px",
"font-weight": "500"
}),
dbc.Switch(
id={'type': 'model-toggle', 'model': model_name, 'toggle_type': 'inference'},
options=[{"label": "", "value": True}],
value=[True] if model_data.get('inference_enabled', True) else [],
className="form-check-input me-2",
style={"transform": "scale(0.7)"}
value=['enabled'] if model_data.get('inference_enabled', True) else [],
className="model-toggle-switch",
style={
"transform": "scale(0.6)",
"margin": "0",
"padding": "0"
}
)
], className="d-flex align-items-center me-2"),
], className="d-flex align-items-center me-2", style={"height": "18px"}),
# Training toggle
html.Div([
html.Label("Trn", className="text-muted small me-1", style={"font-size": "10px"}),
dcc.Checklist(
html.Label("Trn", className="text-muted", style={
"font-size": "9px",
"margin-bottom": "0",
"margin-right": "3px",
"font-weight": "500"
}),
dbc.Switch(
id={'type': 'model-toggle', 'model': model_name, 'toggle_type': 'training'},
options=[{"label": "", "value": True}],
value=[True] if model_data.get('training_enabled', True) else [],
className="form-check-input",
style={"transform": "scale(0.7)"}
value=['enabled'] if model_data.get('training_enabled', True) else [],
className="model-toggle-switch",
style={
"transform": "scale(0.6)",
"margin": "0",
"padding": "0"
}
)
], className="d-flex align-items-center")
], className="d-flex")
], className="d-flex align-items-center", style={"height": "18px"})
], className="d-flex align-items-center", style={"gap": "8px"})
], className="d-flex align-items-center mb-2"),
# Model metrics