From daedf7ce97caacbd927044e96ba4ec889522624b Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 13 Mar 2023 13:49:46 +0100 Subject: [PATCH] Add quantize script for batch quantization --- quantize.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 quantize.sh diff --git a/quantize.sh b/quantize.sh new file mode 100755 index 000000000..591cb9890 --- /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 "models/$1/ggml-model-f16.bin*"; do + ./quantize "$i" "${i/f16/q4_0}" 2 + if [[ "$2" == "--remove-f16" ]]; then + rm "$i" + fi +done