File size: 723 Bytes
3d83b62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Startup script for running both Gradio and API services

set -e

# Load environment variables
if [ -f .env ]; then
    export $(cat .env | grep -v '^#' | xargs)
fi

# Default mode
MODE=${1:-"both"}

case "$MODE" in
    "api")
        echo "Starting FastAPI service..."
        python main.py
        ;;
    "gradio")
        echo "Starting Gradio service..."
        python app.py
        ;;
    "both")
        echo "Starting both services..."
        python main.py &
        API_PID=$!
        python app.py &
        GRADIO_PID=$!

        # Wait for both processes
        wait $API_PID
        wait $GRADIO_PID
        ;;
    *)
        echo "Usage: $0 {api|gradio|both}"
        exit 1
        ;;
esac