From bab97c83d0c9f040bfe1be02c047f272c1a43841 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 29 Apr 2023 12:32:18 +0300 Subject: [PATCH] tests : add "threads" to run-tests.sh --- tests/run-tests.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/run-tests.sh b/tests/run-tests.sh index eda6bbeb..38fa5cea 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -13,7 +13,7 @@ # # Usage: # -# ./tests/run-tests.sh +# ./tests/run-tests.sh [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