Spaces:
Running
Running
File size: 663 Bytes
37673ad 03af398 b84d489 37673ad 03af398 37673ad 03af398 37673ad 03af398 37673ad 03af398 2d04af5 d5ad3d6 37673ad 03af398 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#!/bin/bash
# Set the OLLAMA_ROOT to a writable directory
export OLLAMA_ROOT=/tmp/ollama
# Start the Ollama server in the background
echo "Starting Ollama server..."
ollama serve &
pid=$!
# Wait for the server to be ready
echo "Waiting for server to start..."
while ! curl -s -o /dev/null http://127.0.0.1:11434; do
echo "Server not yet available, waiting..."
sleep 1
done
echo "Server is up and running."
# Pull the models
echo "Pulling models..."
ollama pull gemma3:1b
ollama pull gemma3:270m
ollama pull nomic-embed-text
echo "All models pulled."
# Wait for the server process to exit
# This brings the background process to the foreground
wait $pid
|