File size: 490 Bytes
7c4cf70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# 1. Start the Ollama server in the background
ollama serve &

# 2. Wait for the Ollama server to be up and running
echo "Waiting for Ollama server to start..."
while ! curl -s http://localhost:11434/ > /dev/null; do
    sleep 1
done
echo "Ollama server is running."

# 3. Start the FastAPI gateway server in the foreground
# It will listen on port 7860, which is the default for Hugging Face Spaces
echo "Starting FastAPI gateway..."
uvicorn main:app --host 0.0.0.0 --port 7860