File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ echo " 💪🏼 Download and compile Llama.cpp"
2
+ if [ ! -f " ./llama.cpp/main" ]
3
+ then
4
+ if [ ! -d " ./llama.cpp/" ]
5
+ then
6
+ git clone https://github.com/StrikingLoo/llama.cpp
7
+ fi
8
+ cd llama.cpp && \
9
+ make && \
10
+ mv main ../api/llama
11
+ cd ..
12
+ else
13
+ echo " ✅ Repository already cloned and compiled"
14
+ fi
15
+
16
+ echo " 💬 Convert weights"
17
+ if ls models/* /* .bin 1> /dev/null 2>&1 ; then
18
+ echo " ✅ Weights already converted"
19
+ else
20
+ if ls models/* /* .pth 1> /dev/null 2>&1 ; then
21
+ # Convert model to ggml FP16 format
22
+ python3 llama.cpp/convert-pth-to-ggml.py weights/7B/ 1
23
+ # Quantize the model to 4-bits
24
+ python3 llama.cpp/quantize.py weights/7B
25
+ else
26
+ echo " ⚠️ Weight files do not exist. Please download them and place them inside the models folder"
27
+ fi
28
+ fi
You can’t perform that action at this time.
0 commit comments