Spaces:
Sleeping
Sleeping
# 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 | |