chatCPU / run.sh
SkyNetWalker's picture
Update run.sh
9e5bc05 verified
raw
history blame
835 Bytes
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
# Start the Ollama server in the background.
# The OLLAMA_HOST environment variable is already set in the Dockerfile, so it will listen on all interfaces.
ollama serve &
# Wait for the Ollama server to become available.
echo "Waiting for Ollama to start..."
while ! curl -s http://localhost:11434 > /dev/null; do
sleep 1
done
echo "Ollama started."
# Create the model from the Modelfile. This registers the downloaded GGUF file with Ollama.
# 'gemma-unsloth' is the name we will use to refer to this model in our application.
echo "Creating model 'create gemma3_4b_it_qat'..."
ollama create gemma3_4b_it_qat -f Modelfile
echo "Model created."
# Run the Gradio application.
# It will connect to the Ollama server running on localhost.
python app.py