diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-02-12 20:57:17 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-02-12 20:57:17 +0100 |
| commit | b333b06772c89d96aacb5490d6a219fba7c09cc6 (patch) | |
| tree | 211df60083a5946baa2ed61d33d8121b7e251b06 /llama.cpp/tests/test-tokenizers-repo.sh | |
| download | llmnpc-b333b06772c89d96aacb5490d6a219fba7c09cc6.tar.gz | |
Engage!
Diffstat (limited to 'llama.cpp/tests/test-tokenizers-repo.sh')
| -rwxr-xr-x | llama.cpp/tests/test-tokenizers-repo.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/llama.cpp/tests/test-tokenizers-repo.sh b/llama.cpp/tests/test-tokenizers-repo.sh new file mode 100755 index 0000000..94a3d05 --- /dev/null +++ b/llama.cpp/tests/test-tokenizers-repo.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +if [ $# -lt 2 ]; then + printf "Usage: $0 <git-repo> <target-folder> [<test-exe>]\n" + exit 1 +fi + +if [ $# -eq 3 ]; then + toktest=$3 +else + toktest="./test-tokenizer-0" +fi + +if [ ! -x $toktest ]; then + printf "Test executable \"$toktest\" not found!\n" + exit 1 +fi + +repo=$1 +folder=$2 + +if [ -d $folder ] && [ -d $folder/.git ]; then + (cd $folder; git pull) +else + git clone $repo $folder + + # byteswap models if on big endian + if [ "$(uname -m)" = s390x ]; then + for f in $folder/*/*.gguf; do + echo YES | python3 "$(dirname $0)/../gguf-py/gguf/scripts/gguf_convert_endian.py" $f big + done + fi +fi + +shopt -s globstar +for gguf in $folder/**/*.gguf; do + if [ -f $gguf.inp ] && [ -f $gguf.out ]; then + $toktest $gguf + else + printf "Found \"$gguf\" without matching inp/out files, ignoring...\n" + fi +done + |
