llama-cpp-scripts / bin /llama-update.sh
iandennismiller's picture
llama.cpp updater script
d91e7cf
raw
history blame
832 Bytes
#!/bin/bash
# if $HOME/.config/llama/llama-hf-to-q6_k.conf does not exist, create it
if [ ! -f "$HOME/.config/llama/llama-update.conf" ]; then
mkdir -p "$HOME/.config/llama"
cat <<EOF > "$HOME/.config/llama/llama-update.conf"
LLAMA_CPP_GIT=$HOME/Work/llama.cpp
BIN_PATH=$HOME/.local/bin
EOF
fi
source $HOME/.config/llama/llama-update.conf
# if llama.cpp directory does not exist, clone it
if [ ! -d "$LLAMA_CPP_GIT" ]; then
git clone https://github.com/ggerganov/llama.cpp "$LLAMA_CPP_GIT"
else
cd "$LLAMA_CPP_GIT" || exit
git pull
fi
cd "$LLAMA_CPP_GIT" || exit
rm -rf build
mkdir build
cd build || exit
cmake ..
cmake --build . --config Release
mkdir -p "$BIN_PATH"
install -c -v -m 755 bin/main "$BIN_PATH/llama"
install -c -v bin/ggml-metal.metal "$BIN_PATH"
install -c -v -m 755 bin/llava "$BIN_PATH"