Repository navigation
Expand file tree
/
Copy pathstart_scriptotic.sh
More file actions
86 lines (69 loc) · 2.36 KB
/
Copy pathstart_scriptotic.sh
File metadata and controls
86 lines (69 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Scriptotic Launcher - Shows server status in visible terminal
# Press Ctrl+C to stop both servers
echo "========================================"
echo " Scriptotic Server Console"
echo "========================================"
echo ""
echo "This terminal shows the Voxtral server status."
echo "Press Ctrl+C to stop both servers."
echo ""
echo "Web interface will be available at:"
echo " http://localhost:5000"
echo ""
echo "Starting servers..."
echo "========================================"
# Get to project directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Check environment
if [ ! -d "~/venv-vllm-stable" ]; then
echo "❌ Error: Voxtral environment not found!"
echo "Run setup first: bash scripts/setup_wsl2_voxtral.sh"
exit 1
fi
echo "✅ Environment checks passed"
echo ""
# Function to cleanup on exit
cleanup() {
echo ""
echo "========================================"
echo "Stopping servers..."
echo "========================================"
# Kill web server
if [ ! -z "$WEB_PID" ]; then
echo "🌐 Stopping web server (PID: $WEB_PID)..."
kill $WEB_PID 2>/dev/null || true
fi
# Kill Voxtral server
echo "🤖 Stopping Voxtral server..."
pkill -f "vllm serve" || true
# Additional cleanup for any Python processes
echo "🧹 Cleaning up remaining processes..."
pkill -f "web_server.py" || true
pkill -f "python.*src/core" || true
# Free GPU memory
echo "🧹 Clearing GPU memory cache..."
python3 -c "import torch; torch.cuda.empty_cache()" 2>/dev/null || true
echo "✅ All servers stopped and memory cleared. Goodbye!"
exit 0
}
# Set up cleanup on Ctrl+C
trap cleanup SIGINT SIGTERM
# Start web server in background
echo "🌐 Starting web server..."
source ~/venv-vllm-stable/bin/activate
python src/core/web_server.py &
WEB_PID=$!
# Give web server time to start
sleep 3
echo "✅ Web server started at http://localhost:5000(PID: $WEB_PID)"
echo ""
# Start Voxtral server with live output (foreground)
echo "🤖 Starting Voxtral server (this may take 2-3 minutes for first-time model loading)..."
echo "Server output:"
echo "----------------------------------------"
# This runs in foreground so you see all output
bash wsl2/start_voxtral_server.sh
# If we get here, server stopped normally
cleanup