-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
55 lines (44 loc) · 1.38 KB
/
setup.sh
File metadata and controls
55 lines (44 loc) · 1.38 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
set -e
echo "Detecting package manager..."
if command -v apt &> /dev/null; then
PM="apt"
sudo apt update
sudo apt install -y git cmake build-essential python3 python3-pip libopenblas-dev curl
elif command -v dnf &> /dev/null; then
PM="dnf"
sudo dnf install -y git cmake make gcc gcc-c++ python3 python3-pip openblas-devel curl
elif command -v yum &> /dev/null; then
PM="yum"
sudo yum install -y git cmake make gcc gcc-c++ python3 python3-pip openblas-devel curl
elif command -v pacman &> /dev/null; then
PM="pacman"
sudo pacman -Sy --noconfirm git cmake base-devel python python-pip openblas curl
else
echo "Unsupported package manager. Please install git, cmake, build tools, python3, pip, and OpenBLAS manually."
exit 1
fi
echo "Cloning llama.cpp repository..."
if [ ! -d llama.cpp ]; then
git clone https://github.com/ggml-org/llama.cpp.git
else
echo "llama.cpp directory already exists. Pulling latest changes..."
cd llama.cpp
git pull
cd ..
fi
echo "Building llama.cpp..."
cd llama.cpp
make
echo "llama.cpp built successfully!"
# Optional: Build Python bindings
echo "Installing Python bindings for llama.cpp (optional)..."
cd python
pip3 install -r requirements.txt
pip3 install .
cd ..
cd ..
curl -fSsL https://ollama.com/install.sh | sh
echo "Setup complete!"
pip3 install -r requirements.txt
streamlit run setup.py