Download entrypoint.sh from abanm/Backend_1: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/spaces/abanm/Backend_1/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/abanm/Backend_1/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/abanm/Backend_1/resolve/main/entrypoint.sh
619 Bytes
| # 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 | |