mann / start.sh
gcharanteja
mcp integration
af49805
Raw
History Blame Contribute Delete
707 Bytes
#!/bin/bash
echo "=== [HF Space] Starting Ollama + Qwen2.5 7B ==="
echo "Time: $(date)"
export OLLAMA_HOST=0.0.0.0
echo "Starting Ollama server..."
ollama serve &
sleep 5
echo "Waiting for Ollama..."
for i in {1..60}; do
if curl -s http://127.0.0.1:11434/api/tags >/dev/null 2>&1; then
echo "βœ… Ollama ready!"
break
fi
sleep 3
done
# Pull the new model
if ! ollama list | grep -q "qwen2.5"; then
echo "πŸ“₯ Downloading qwen2.5:7b-instruct (~4.7GB) - This will take time on first build..."
ollama pull qwen2.5:7b-instruct
else
echo "βœ… Model already downloaded"
fi
echo "πŸš€ Starting FastAPI..."
uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860} --workers 1