File size: 923 Bytes
d91e7cf
 
d6ab723
d91e7cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d6ab723
 
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
#!/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
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"
install -c -v -m 755 bin/finetune "$BIN_PATH/llama-finetune"
install -c -v -m 755 bin/speculative "$BIN_PATH/llama-speculative"