ggerganov commited on
Commit
d880fda
·
unverified ·
1 Parent(s): a899032

tests : add "threads" to run-tests.sh

Browse files
Files changed (1) hide show
  1. tests/run-tests.sh +8 -3
tests/run-tests.sh CHANGED
@@ -13,7 +13,7 @@
13
  #
14
  # Usage:
15
  #
16
- # ./tests/run-tests.sh <model_name>
17
  #
18
 
19
  cd `dirname $0`
@@ -32,7 +32,7 @@ function list_models {
32
  }
33
 
34
  if [ $# -eq 0 ]; then
35
- printf "Usage: $0 [model]\n\n"
36
  printf "No model specified. Aborting\n"
37
  list_models
38
  exit 1
@@ -41,6 +41,11 @@ fi
41
  model=$1
42
  main="../main"
43
 
 
 
 
 
 
44
  if [ ! -f ../models/ggml-$model.bin ]; then
45
  printf "Model $model not found. Aborting\n"
46
  list_models
@@ -105,7 +110,7 @@ function run_lang() {
105
  fi
106
  fi
107
 
108
- $main -m ../models/ggml-$model.bin -f $fname_dst -l $lang -otxt 2> /dev/null
109
 
110
  git diff --no-index --word-diff=color --word-diff-regex=. $lang-$i-ref.txt $fname_dst.txt
111
 
 
13
  #
14
  # Usage:
15
  #
16
+ # ./tests/run-tests.sh <model_name> [threads]
17
  #
18
 
19
  cd `dirname $0`
 
32
  }
33
 
34
  if [ $# -eq 0 ]; then
35
+ printf "Usage: $0 [model] [threads]\n\n"
36
  printf "No model specified. Aborting\n"
37
  list_models
38
  exit 1
 
41
  model=$1
42
  main="../main"
43
 
44
+ threads=""
45
+ if [ $# -eq 2 ]; then
46
+ threads="-t $2"
47
+ fi
48
+
49
  if [ ! -f ../models/ggml-$model.bin ]; then
50
  printf "Model $model not found. Aborting\n"
51
  list_models
 
110
  fi
111
  fi
112
 
113
+ $main -m ../models/ggml-$model.bin $threads -f $fname_dst -l $lang -otxt 2> /dev/null
114
 
115
  git diff --no-index --word-diff=color --word-diff-regex=. $lang-$i-ref.txt $fname_dst.txt
116