File size: 665 Bytes
bc0d655
 
 
 
 
 
 
 
 
 
 
 
 
 
cc132ff
3645a0a
 
 
bc0d655
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

echo "Starting Ollama server in background..."
ollama serve &

echo "Waiting for Ollama to initialize..."
sleep 10 

until curl -s http://localhost:11434/api/tags > /dev/null; do
  echo "Ollama not ready yet, waiting..."
  sleep 5
done
echo "Ollama is ready!"

MODEL_NAME="gemma3:1b" 
echo "Pulling Ollama model: ${MODEL_NAME}..."
ollama pull "${MODEL_NAME}" || { echo "Failed to pull model ${MODEL_NAME}. Exiting."; exit 1; }

echo "Starting Streamlit app..."
streamlit run streamlit_app.py --server.port=8501 --server.enableCORS=false --server.enableXsrfProtection=false

# Keep the script running so the container doesn't exit if streamlit dies
wait