amogneandualem commited on
Commit
44366b7
·
verified ·
1 Parent(s): e76b35e

Create start.sh

Browse files
Files changed (1) hide show
  1. start.sh +17 -0
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