# Ensure OLLAMA_HOME is set | |
export OLLAMA_HOME=/home/appuser/.ollama | |
# Start the Ollama server in the background | |
ollama serve & | |
# Wait for Ollama to initialize (this is arbitrary; you might tune it) | |
sleep 10 | |
# (Optional) Preload the Hugging Face model | |
# Uncomment the line below if desired to warm up the model in Ollama | |
ollama run hf.co/abanm/Dubs-Q8_0-GGUF & | |
# Navigate to the application directory | |
cd /app | |
curl http://localhost:11434/api/generate -d '{"model": "hf.co/abanm/Dubs-Q8_0-GGUF:latest", "keep_alive": -1}' | |
# Start the FastAPI app using Uvicorn | |
uvicorn app:app --host 0.0.0.0 --port 7860 | |