File size: 552 Bytes
d2ba52b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# Start Ollama server in background
ollama serve &

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

echo "Ollama server started!"

# Pull the LLaVA model for vision analysis
echo "Pulling LLaVA model for vision analysis..."
ollama pull llava:7b

echo "Model pulled successfully!"

# Start FastAPI on port 7860 (HF Spaces requirement)
echo "Starting FastAPI server on port 7860..."
cd /app
python3 -m uvicorn fast:app --host 0.0.0.0 --port 7860