summaryrefslogtreecommitdiff
path: root/quantize.sh
diff options
context:
space:
mode:
authorPavol Rusnak <pavol@rusnak.io>2023-03-13 17:15:20 +0100
committerGitHub <noreply@github.com>2023-03-13 18:15:20 +0200
commitd1f224712d78ab2cbb78777acfeb6739f660eb96 (patch)
treed08e2637149b43ce20aed276bef37575b179cf88 /quantize.sh
parent1808ee0500ea674b4bc2911acd0489ee5cbcef87 (diff)
Add quantize script for batch quantization (#92)
* Add quantize script for batch quantization * Indentation * README for new quantize.sh * Fix script name * Fix file list on Mac OS --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Diffstat (limited to 'quantize.sh')
-rwxr-xr-xquantize.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/quantize.sh b/quantize.sh
new file mode 100755
index 00000000..6194649b
--- /dev/null
+++ b/quantize.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+if ! [[ "$1" =~ ^[0-9]{1,2}B$ ]]; then
+ echo
+ echo "Usage: quantize.sh 7B|13B|30B|65B [--remove-f16]"
+ echo
+ exit 1
+fi
+
+for i in `ls models/$1/ggml-model-f16.bin*`; do
+ ./quantize "$i" "${i/f16/q4_0}" 2
+ if [[ "$2" == "--remove-f16" ]]; then
+ rm "$i"
+ fi
+done