Spaces:
Running
Running
Commit
·
c47044e
1
Parent(s):
e910aad
typo
Browse files
vms/ui/project/services/training.py
CHANGED
@@ -1166,7 +1166,7 @@ class TrainingService:
|
|
1166 |
)
|
1167 |
# Set buttons for active training
|
1168 |
ui_updates.update({
|
1169 |
-
"start_btn": {"interactive": False, "variant": "secondary", "value": "
|
1170 |
"stop_btn": {"interactive": True, "variant": "primary", "value": "Stop at Last Checkpoint"},
|
1171 |
"delete_checkpoints_btn": {"interactive": False, "variant": "stop", "value": "Delete All Checkpoints"},
|
1172 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False}
|
@@ -1182,7 +1182,7 @@ class TrainingService:
|
|
1182 |
logger.error(f"Failed to auto-resume training: {str(e)}")
|
1183 |
# Set buttons for manual recovery
|
1184 |
ui_updates.update({
|
1185 |
-
"start_btn": {"interactive": True, "variant": "primary", "value": "
|
1186 |
"stop_btn": {"interactive": False, "variant": "secondary", "value": "Stop at Last Checkpoint"},
|
1187 |
"delete_checkpoints_btn": {"interactive": True, "variant": "stop", "value": "Delete All Checkpoints"},
|
1188 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False}
|
@@ -1191,7 +1191,7 @@ class TrainingService:
|
|
1191 |
else:
|
1192 |
# Set up UI for manual recovery
|
1193 |
ui_updates.update({
|
1194 |
-
"start_btn": {"interactive": True, "variant": "primary", "value": "
|
1195 |
"stop_btn": {"interactive": False, "variant": "secondary", "value": "Stop at Last Checkpoint"},
|
1196 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False}
|
1197 |
})
|
@@ -1200,7 +1200,7 @@ class TrainingService:
|
|
1200 |
elif self.is_training_running():
|
1201 |
# Process is still running, set buttons accordingly
|
1202 |
ui_updates = {
|
1203 |
-
"start_btn": {"interactive": False, "variant": "secondary", "value": "
|
1204 |
"stop_btn": {"interactive": True, "variant": "primary", "value": "Stop at Last Checkpoint"},
|
1205 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False},
|
1206 |
"delete_checkpoints_btn": {"interactive": False, "variant": "stop", "value": "Delete All Checkpoints"}
|
@@ -1208,7 +1208,7 @@ class TrainingService:
|
|
1208 |
return {"status": "running", "message": "Training process is running", "ui_updates": ui_updates}
|
1209 |
else:
|
1210 |
# No training process, set buttons to default state
|
1211 |
-
button_text = "
|
1212 |
ui_updates = {
|
1213 |
"start_btn": {"interactive": True, "variant": "primary", "value": button_text},
|
1214 |
"stop_btn": {"interactive": False, "variant": "secondary", "value": "Stop at Last Checkpoint"},
|
|
|
1166 |
)
|
1167 |
# Set buttons for active training
|
1168 |
ui_updates.update({
|
1169 |
+
"start_btn": {"interactive": False, "variant": "secondary", "value": "Start over a new training"},
|
1170 |
"stop_btn": {"interactive": True, "variant": "primary", "value": "Stop at Last Checkpoint"},
|
1171 |
"delete_checkpoints_btn": {"interactive": False, "variant": "stop", "value": "Delete All Checkpoints"},
|
1172 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False}
|
|
|
1182 |
logger.error(f"Failed to auto-resume training: {str(e)}")
|
1183 |
# Set buttons for manual recovery
|
1184 |
ui_updates.update({
|
1185 |
+
"start_btn": {"interactive": True, "variant": "primary", "value": "Start over a new training"},
|
1186 |
"stop_btn": {"interactive": False, "variant": "secondary", "value": "Stop at Last Checkpoint"},
|
1187 |
"delete_checkpoints_btn": {"interactive": True, "variant": "stop", "value": "Delete All Checkpoints"},
|
1188 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False}
|
|
|
1191 |
else:
|
1192 |
# Set up UI for manual recovery
|
1193 |
ui_updates.update({
|
1194 |
+
"start_btn": {"interactive": True, "variant": "primary", "value": "Start over a new training"},
|
1195 |
"stop_btn": {"interactive": False, "variant": "secondary", "value": "Stop at Last Checkpoint"},
|
1196 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False}
|
1197 |
})
|
|
|
1200 |
elif self.is_training_running():
|
1201 |
# Process is still running, set buttons accordingly
|
1202 |
ui_updates = {
|
1203 |
+
"start_btn": {"interactive": False, "variant": "secondary", "value": "Start over a new training" if has_checkpoints else "Start Training"},
|
1204 |
"stop_btn": {"interactive": True, "variant": "primary", "value": "Stop at Last Checkpoint"},
|
1205 |
"pause_resume_btn": {"interactive": False, "variant": "secondary", "visible": False},
|
1206 |
"delete_checkpoints_btn": {"interactive": False, "variant": "stop", "value": "Delete All Checkpoints"}
|
|
|
1208 |
return {"status": "running", "message": "Training process is running", "ui_updates": ui_updates}
|
1209 |
else:
|
1210 |
# No training process, set buttons to default state
|
1211 |
+
button_text = "Start over a new training" if has_checkpoints else "Start Training"
|
1212 |
ui_updates = {
|
1213 |
"start_btn": {"interactive": True, "variant": "primary", "value": button_text},
|
1214 |
"stop_btn": {"interactive": False, "variant": "secondary", "value": "Stop at Last Checkpoint"},
|