ollama_server / entrypoint.sh
Teenu0Detect's picture
Added Ollama server files
e95d3cf verified
raw
history blame contribute delete
613 Bytes
#!/bin/bash
# Source the virtual environment
source /app/venv/bin/activate
# Starting server
echo "Starting Ollama server"
ollama serve &
sleep 1
# Try to get the model environment variable
if [ -n "${MODEL}" ]; then
# Split the MODEL variable into an array
IFS=',' read -ra MODELS <<< "${MODEL}"
else
# Use the default list of models
MODELS=(llava llama3.2-vision)
fi
# Splitting the models by comma and pulling each
#IFS=',' read -ra MODELS <<< "$model"
for m in "${MODELS[@]}"; do
echo "Pulling $m"
ollama pull "$m"
sleep 5
done
# Run the Python application
exec python ./src/run1.py