-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·37 lines (29 loc) · 987 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·37 lines (29 loc) · 987 Bytes
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
#!/usr/bin/env bash
# BitWiser — environment bootstrap for Apple Silicon.
# Builds llama.cpp with Metal acceleration and installs Python deps.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
VENDOR="$ROOT/vendor"
LLAMA="$VENDOR/llama.cpp"
mkdir -p "$VENDOR"
if ! command -v cmake >/dev/null 2>&1; then
echo "cmake is required. Install with: brew install cmake"
exit 1
fi
if [ ! -d "$LLAMA" ]; then
echo "==> Cloning llama.cpp"
git clone https://github.com/ggerganov/llama.cpp "$LLAMA"
else
echo "==> Updating llama.cpp"
git -C "$LLAMA" pull --ff-only
fi
echo "==> Configuring with Metal"
cmake -S "$LLAMA" -B "$LLAMA/build" -DGGML_METAL=ON -DLLAMA_CURL=OFF
echo "==> Building (Release)"
cmake --build "$LLAMA/build" --config Release -j
echo "==> Installing Python deps"
python3 -m pip install --upgrade pip
python3 -m pip install -r "$ROOT/requirements.txt"
echo
echo "Done. Binaries:"
ls "$LLAMA/build/bin" | grep -E '^(llama-quantize|llama-cli)$' || true