Spaces:
Running
Running
Create start.sh
Browse files
start.sh
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
export OLLAMA_HOST=0.0.0.0
|
| 4 |
+
echo "Starting Ollama server in background (listening on $OLLAMA_HOST:11434)..."
|
| 5 |
+
ollama serve &
|
| 6 |
+
|
| 7 |
+
echo "Waiting 45 seconds for Ollama server to fully initialize..."
|
| 8 |
+
sleep 45
|
| 9 |
+
|
| 10 |
+
MODEL="moondream:1.8b"
|
| 11 |
+
echo "Ensuring model $MODEL is pulled and ready..."
|
| 12 |
+
ollama pull "$MODEL"
|
| 13 |
+
ollama run "$MODEL" "Describe a house" --verbose --system "You are a helpful assistant." --keep < /dev/null
|
| 14 |
+
|
| 15 |
+
echo "Starting Gradio application on port 7860..."
|
| 16 |
+
# Launch Gradio app directly using Python
|
| 17 |
+
exec python app.py
|