]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
tests : add "threads" to run-tests.sh
authorGeorgi Gerganov <redacted>
Sat, 29 Apr 2023 09:32:18 +0000 (12:32 +0300)
committerGeorgi Gerganov <redacted>
Sat, 29 Apr 2023 09:32:28 +0000 (12:32 +0300)
tests/run-tests.sh

index eda6bbeb6400c5858a0331d18086c9c30d12330e..38fa5cea52bfe8ecc2f49e97c7743191c9f0b7c2 100755 (executable)
@@ -13,7 +13,7 @@
 #
 # Usage:
 #
-#   ./tests/run-tests.sh <model_name>
+#   ./tests/run-tests.sh <model_name> [threads]
 #
 
 cd `dirname $0`
@@ -32,7 +32,7 @@ function list_models {
 }
 
 if [ $# -eq 0 ]; then
-    printf "Usage: $0 [model]\n\n"
+    printf "Usage: $0 [model] [threads]\n\n"
     printf "No model specified. Aborting\n"
     list_models
     exit 1
@@ -41,6 +41,11 @@ fi
 model=$1
 main="../main"
 
+threads=""
+if [ $# -eq 2 ]; then
+    threads="-t $2"
+fi
+
 if [ ! -f ../models/ggml-$model.bin ]; then
     printf "Model $model not found. Aborting\n"
     list_models
@@ -105,7 +110,7 @@ function run_lang() {
             fi
         fi
 
-        $main -m ../models/ggml-$model.bin -f $fname_dst -l $lang -otxt 2> /dev/null
+        $main -m ../models/ggml-$model.bin $threads -f $fname_dst -l $lang -otxt 2> /dev/null
 
         git diff --no-index --word-diff=color --word-diff-regex=. $lang-$i-ref.txt $fname_dst.txt