-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·59 lines (48 loc) · 1.11 KB
/
install.sh
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
55
56
57
58
59
#!/bin/bash
if ! command -v node &> /dev/null
then
echo "Can't find node.js"
exit 1
fi
if ! command -v npm &> /dev/null
then
echo "Can't find npm"
exit 1
fi
npm install --production
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
if ! command -v make &> /dev/null
then
echo "Compiler is missing"
exit 1
fi
rm -rf llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
make clean
if [ "$machine" == "Mac" ]; then
LLAMA_METAL=1 make
else
make
fi
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"
# Test
./main \
--threads 4 \
--n-gpu-layers 1 \
--model ${MODEL} \
--color \
--ctx-size 2048 \
--temp 0.7 \
--repeat_penalty 1.1 \
--n-predict -1 \
--prompt "[INST] Tell me a joke [/INST]"
echo "If you see a joke above (even a bad one) then it means the process completed successfully"