forked from jgravelle/AutoGroq
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
install_ollama.sh
41 lines (31 loc) · 1001 Bytes
/
install_ollama.sh
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
34
35
36
37
38
39
40
41
#!/bin/bash
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check if curl is installed
if ! command_exists curl; then
echo "Error: curl is not installed. Please install curl and try again."
exit 1
fi
# Install Ollama
echo "Installing Ollama..."
curl -fsSL https://ollama.com/install.sh | sh
# Check if Ollama was installed successfully
if ! command_exists ollama; then
echo "Error: Ollama installation failed. Please check the output above for any error messages."
exit 1
fi
echo "Ollama installed successfully."
# Start Ollama service
echo "Starting Ollama service..."
ollama serve &
# Wait for Ollama service to start
echo "Waiting for Ollama service to start..."
sleep 10
# Pull Mistral models
echo "Pulling mistral:instruct model..."
ollama pull mistral:instruct
echo "Pulling mistral:7b-instruct-v0.2-q8_0 model..."
ollama pull mistral:7b-instruct-v0.2-q8_0
echo "Installation and model pulling completed successfully!"