Team Ai
Apppublic

Xenobd/whisper.cpp

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
quantize-all.sh38 linesDownload Raw Back to scripts
1#!/bin/bash2 3printf "Usage: $0 <upload>"4 5if [ $# -ne 1 ]; then6    printf "\nError: Invalid number of arguments\n"7    exit 18fi9 10qtype0="q5_0"11qtype1="q5_1"12upload="$1"13declare -a filedex14 15cd `dirname $0`16cd ../17 18for i in `ls ./models | grep ^ggml-.*.bin | grep -v "\-q"`; do19    m="models/$i"20    if [ -f "$m" ]; then21        if [ "${m##*.}" == "bin" ]; then22            ./build/bin/whisper-quantize "${m}" "${m::${#m}-4}-${qtype1}.bin" ${qtype1};23            ./build/bin/whisper-quantize "${m}" "${m::${#m}-4}-${qtype0}.bin" ${qtype0};24            filedex+=( "${m::${#m}-4}-${qtype1}.bin" "${m::${#m}-4}-${qtype0}.bin" )25        fi26    fi27done28 29 30 31if [ "$upload" == "1" ]; then32    for i in ${!filedex[@]}; do33        if [ "${filedex[$i]:9:8}" != "for-test" ]; then34            scp ${filedex[$i]} root@linode0:/mnt/Data/ggml/ggml-model-${filedex[$i]:9}35        fi36    done37fi38