Spaces:
Sleeping
Sleeping
Hanzo Dev
commited on
Commit
·
62858a8
1
Parent(s):
7522691
Add auto-start training on Space launch
Browse files
app.py
CHANGED
|
@@ -396,3 +396,17 @@ if __name__ == "__main__":
|
|
| 396 |
server_port=7860,
|
| 397 |
share=False
|
| 398 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 396 |
server_port=7860,
|
| 397 |
share=False
|
| 398 |
)
|
| 399 |
+
|
| 400 |
+
|
| 401 |
+
# AUTO-START TRAINING
|
| 402 |
+
import threading
|
| 403 |
+
def auto_start_training():
|
| 404 |
+
"""Auto-start training when Space launches"""
|
| 405 |
+
time.sleep(5) # Wait for Space to fully initialize
|
| 406 |
+
print("🚀 AUTO-STARTING TRAINING (4B model on A10G)")
|
| 407 |
+
trainer = ZenVLTrainer(model_size="4b", gpu_type="a10g")
|
| 408 |
+
trainer.train()
|
| 409 |
+
|
| 410 |
+
# Launch training in background thread
|
| 411 |
+
training_thread = threading.Thread(target=auto_start_training, daemon=True)
|
| 412 |
+
training_thread.start()
|