Files
bakery-ia/services
Claude c64585af57 Fix training hang by wrapping blocking ML operations in thread pool
Root Cause:
Training process was stuck at 40% because blocking synchronous ML operations
(model.fit(), model.predict(), study.optimize()) were freezing the asyncio
event loop, preventing RabbitMQ heartbeats, WebSocket communication, and
progress updates.

Changes:
1. prophet_manager.py:
   - Wrapped model.fit() at line 189 with asyncio.to_thread()
   - Wrapped study.optimize() at line 453 with asyncio.to_thread()

2. hybrid_trainer.py:
   - Made _train_xgboost() async and wrapped model.fit() with asyncio.to_thread()
   - Made _evaluate_hybrid_model() async and wrapped predict() calls
   - Fixed predict() method to wrap blocking predict() calls

Impact:
- Event loop no longer blocks during ML training
- RabbitMQ heartbeats continue during training
- WebSocket progress updates work correctly
- Training can now complete successfully

Fixes: Training hang at 40% during onboarding phase
2025-11-05 14:34:53 +00:00
..
2025-11-05 13:34:56 +01:00
2025-10-31 18:57:58 +01:00
2025-10-31 11:54:19 +01:00
2025-11-01 21:35:03 +01:00
2025-11-02 20:24:44 +01:00
2025-11-05 13:34:56 +01:00
2025-11-05 13:34:56 +01:00
2025-11-05 13:34:56 +01:00
2025-11-02 20:24:44 +01:00
2025-11-02 20:24:44 +01:00
2025-11-05 13:34:56 +01:00
2025-11-05 13:34:56 +01:00
2025-11-02 20:24:44 +01:00
2025-11-02 20:24:44 +01:00
2025-11-02 20:24:44 +01:00
2025-11-05 13:34:56 +01:00