iandennismiller commited on
Commit
d91e7cf
1 Parent(s): 0c7ad1d

llama.cpp updater script

Browse files
Files changed (2) hide show
  1. bin/llama-update.sh +33 -0
  2. install.sh +1 -0
bin/llama-update.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # if $HOME/.config/llama/llama-hf-to-q6_k.conf does not exist, create it
4
+ if [ ! -f "$HOME/.config/llama/llama-update.conf" ]; then
5
+ mkdir -p "$HOME/.config/llama"
6
+ cat <<EOF > "$HOME/.config/llama/llama-update.conf"
7
+ LLAMA_CPP_GIT=$HOME/Work/llama.cpp
8
+ BIN_PATH=$HOME/.local/bin
9
+ EOF
10
+ fi
11
+
12
+ source $HOME/.config/llama/llama-update.conf
13
+
14
+ # if llama.cpp directory does not exist, clone it
15
+ if [ ! -d "$LLAMA_CPP_GIT" ]; then
16
+ git clone https://github.com/ggerganov/llama.cpp "$LLAMA_CPP_GIT"
17
+ else
18
+ cd "$LLAMA_CPP_GIT" || exit
19
+ git pull
20
+ fi
21
+
22
+ cd "$LLAMA_CPP_GIT" || exit
23
+
24
+ rm -rf build
25
+ mkdir build
26
+ cd build || exit
27
+ cmake ..
28
+ cmake --build . --config Release
29
+
30
+ mkdir -p "$BIN_PATH"
31
+ install -c -v -m 755 bin/main "$BIN_PATH/llama"
32
+ install -c -v bin/ggml-metal.metal "$BIN_PATH"
33
+ install -c -v -m 755 bin/llava "$BIN_PATH"
install.sh CHANGED
@@ -5,5 +5,6 @@ echo "installing"
5
  mkdir -p ~/.local/bin
6
 
7
  install -C -v ./bin/llama-hf-to-q6_k.sh ~/.local/bin
 
8
 
9
  echo "done"
 
5
  mkdir -p ~/.local/bin
6
 
7
  install -C -v ./bin/llama-hf-to-q6_k.sh ~/.local/bin
8
+ install -C -v ./bin/llama-update.sh ~/.local/bin
9
 
10
  echo "done"