File size: 1,373 Bytes
d91e7cf d6ab723 d91e7cf 2b59313 d91e7cf 2b59313 d91e7cf ccefb81 d6ab723 22e19ef 2b59313 4056112 e921aad |
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 |
#!/bin/bash
# if 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
KOBOLDCPP_GIT=$HOME/Work/koboldcpp
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-cli "$BIN_PATH"/llava
install -c -v -m 755 bin/finetune "$BIN_PATH/llama-finetune"
install -c -v -m 755 bin/speculative "$BIN_PATH/llama-speculative"
install -c -v -m 755 bin/server "$BIN_PATH/llama-server"
# if koboldcpp directory does not exist, clone it
if [ ! -d "$KOBOLDCPP_GIT" ]; then
git clone https://github.com/LostRuins/koboldcpp "$KOBOLDCPP_GIT"
else
cd "$KOBOLDCPP_GIT" || exit
git pull
fi
# update koboldcpp
cd "$KOBOLDCPP_GIT" || exit
make clean
make LLAMA_METAL=1 # LLAMA_CLBLAST=1
echo "Clear cache"
llama-clear-cache.sh
|