File size: 622 Bytes
3be03dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
set -e

# Train ML models if not already present (first boot only)
if [ ! -f "data/signal_model_stock.pkl" ]; then
    echo "==> ML models not found, training now (this takes ~2-3 min)..."
    python -c "
import os
os.makedirs('data', exist_ok=True)
from tools.tool_ml_train import train_model, train_etf_model
print('Training stock model...')
train_model()
print('Training ETF model...')
train_etf_model()
print('ML training complete.')
" || echo "Warning: ML training failed, app will run without ML signals"
fi

echo "==> Starting FastAPI server..."
exec uvicorn backend.main:app --host 0.0.0.0 --port 7860