Spaces:
Running
Running
File size: 853 Bytes
7d988b6 |
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 31 32 33 |
#!/bin/bash
# Function to check if Ollama is installed
is_ollama_installed() {
command -v ollama >/dev/null 2>&1
}
# Install Ollama only if not already installed
if is_ollama_installed; then
echo "β
Ollama is already installed. Skipping installation..."
else
echo "π Installing Ollama..."
sudo apt-get update && sudo apt-get install -y curl
curl -fsSL https://ollama.com/install.sh | sh
echo "β
Ollama installation completed!"
fi
# Start Ollama
echo "π Starting Ollama..."
ollama serve &
sleep 5
# Pull the model if not already present
if ollama list | grep -q "deepseek-r1:1.5b"; then
echo "β
Model 'deepseek-r1:1.5b' is already available."
else
echo "π Pulling model 'deepseek-r1:1.5b'..."
ollama pull deepseek-r1:1.5b
echo "β
Model pulled successfully!"
fi
echo "π Ollama is running!"
|