Skip to content

Commit 20c75a1

Browse files
ggerganovhodlen
authored andcommitted
examples : improve base-translate.sh script (ggml-org#4783)
1 parent 4adb316 commit 20c75a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

examples/base-translate.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
# cd llama.cpp
99
# make -j
1010
#
11-
# ./examples/base-translate.sh <model-base> "<text>"
11+
# ./examples/base-translate.sh <model-base> "<text>" [extra-main-args]
1212
#
1313

14-
if [ $# -ne 2 ]; then
15-
echo "Usage: ./base-translate.sh <model-base> \"<text>\""
14+
if [ $# -lt 2 ]; then
15+
echo "Usage: ./base-translate.sh <model-base> \"<text>\" [extra-main-args]"
1616
exit 1
1717
fi
1818

19+
eargs=""
20+
if [ $# -gt 2 ]; then
21+
eargs="${@:3}"
22+
fi
23+
1924
ftmp="__llama.cpp_example_tmp__.txt"
2025
trap "rm -f $ftmp" EXIT
2126

@@ -52,5 +57,5 @@ echo "$2
5257

5358
model=$1
5459

55-
# generate the most likely continuation, run on the CPU until the string "===" is found
56-
./main -m $model -f $ftmp -n 64 --temp 0 --repeat-penalty 1.0 --no-penalize-nl -ngl 0 -r "==="
60+
# generate the most likely continuation until the string "===" is found
61+
./main -m $model -f $ftmp -n 64 --temp 0 --repeat-penalty 1.0 --no-penalize-nl -r "===" $eargs

0 commit comments

Comments
 (0)