-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert : auto-determine model name based on dir + scripts update
- Loading branch information
Showing
6 changed files
with
95 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
qnt=(q8_0 q6_k q5_k q5_1 q5_0 q4_k q4_1 q4_0 q3_k q2_k) | ||
args="" | ||
|
||
if [ -z "$1" ]; then | ||
echo "usage: $0 <model> [qnt] [args]" | ||
echo "default: $0 <model> \"${qnt[@]}\" \"${args}\"" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -z "$2" ]; then | ||
qnt=($2) | ||
fi | ||
|
||
if [ ! -z "$3" ]; then | ||
args="$3" | ||
fi | ||
|
||
model="$1" | ||
out="../tmp/results-${model}" | ||
|
||
mkdir -p ${out} | ||
|
||
for q in ${qnt[@]}; do | ||
time ./bin/quantize ../models/${model}/ggml-model-f16.gguf ../models/${model}/ggml-model-${q}.gguf ${q} 2>&1 ${args} | tee ${out}/qnt-${q}.txt | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
qnt=(f16 q8_0 q6_k q5_k q5_1 q5_0 q4_k q4_1 q4_0 q3_k q2_k) | ||
args="-ngl 999 -n 64 -p 512" | ||
|
||
if [ -z "$1" ]; then | ||
echo "usage: $0 <model> [qnt] [args]" | ||
echo "default: $0 <model> \"${qnt[@]}\" \"${args}\"" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -z "$2" ]; then | ||
qnt=($2) | ||
fi | ||
|
||
if [ ! -z "$3" ]; then | ||
args="$3" | ||
fi | ||
|
||
model="$1" | ||
out="../tmp/results-${model}" | ||
|
||
mkdir -p ${out} | ||
|
||
mstr="" | ||
|
||
for q in ${qnt[@]}; do | ||
mstr="${mstr} -m ../models/${model}/ggml-model-${q}.gguf" | ||
done | ||
|
||
./bin/llama-bench ${mstr} ${args} 2> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
qnt=(f16 q8_0 q6_k q5_k q5_1 q5_0 q4_k q4_1 q4_0 q3_k q2_k) | ||
args="--no-mmap -ngl 999 -t 8" | ||
|
||
if [ -z "$1" ]; then | ||
echo "usage: $0 <model> [qnt] [args]" | ||
echo "default: $0 <model> \"${qnt[@]}\" \"${args}\"" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -z "$2" ]; then | ||
qnt=($2) | ||
fi | ||
|
||
if [ ! -z "$3" ]; then | ||
args="$3" | ||
fi | ||
|
||
model="$1" | ||
out="../tmp/results-${model}" | ||
|
||
mkdir -p ${out} | ||
|
||
for q in ${qnt[@]}; do | ||
time ./bin/perplexity -m ../models/${model}/ggml-model-f16.gguf -f ./wiki.test.raw ${args} 2>&1 | tee ${out}/ppl-${q}.txt | ||
done |