2023-04-30 17:51:57 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
printf "Usage: $0 <upload>"
|
|
|
|
|
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
printf "\nError: Invalid number of arguments\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
qtype0="q5_0"
|
|
|
|
qtype1="q5_1"
|
|
|
|
upload="$1"
|
2023-06-28 21:07:02 +02:00
|
|
|
declare -a filedex
|
2023-04-30 17:51:57 +02:00
|
|
|
|
|
|
|
cd `dirname $0`
|
|
|
|
cd ../
|
|
|
|
|
2023-11-12 14:31:08 +01:00
|
|
|
for i in `ls ./models | grep ^ggml-.*.bin | grep -v "\-q"`; do
|
|
|
|
m="models/$i"
|
|
|
|
if [ -f "$m" ]; then
|
|
|
|
if [ "${m##*.}" == "bin" ]; then
|
|
|
|
./quantize "${m}" "${m::${#m}-4}-${qtype1}.bin" ${qtype1};
|
|
|
|
./quantize "${m}" "${m::${#m}-4}-${qtype0}.bin" ${qtype0};
|
|
|
|
filedex+=( "${m::${#m}-4}-${qtype1}.bin" "${m::${#m}-4}-${qtype0}.bin" )
|
2023-06-28 21:07:02 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
2023-04-30 17:51:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$upload" == "1" ]; then
|
2023-06-28 21:07:02 +02:00
|
|
|
for i in ${!filedex[@]}; do
|
|
|
|
if [ "${filedex[$i]:9:8}" != "for-test" ]; then
|
|
|
|
scp ${filedex[$i]} root@linode0:/mnt/Data/ggml/ggml-model-${filedex[$i]:9}
|
|
|
|
fi
|
|
|
|
done
|
2023-04-30 17:51:57 +02:00
|
|
|
fi
|