Skip to content

Commit

Permalink
examples : improve base-translate.sh script (ggerganov#4783)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jan 6, 2024
1 parent eec22a1 commit 96e80da
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions examples/base-translate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
# cd llama.cpp
# make -j
#
# ./examples/base-translate.sh <model-base> "<text>"
# ./examples/base-translate.sh <model-base> "<text>" [extra-main-args]
#

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

eargs=""
if [ $# -gt 2 ]; then
eargs="${@:3}"
fi

ftmp="__llama.cpp_example_tmp__.txt"
trap "rm -f $ftmp" EXIT

Expand Down Expand Up @@ -52,5 +57,5 @@ echo "$2

model=$1

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

0 comments on commit 96e80da

Please sign in to comment.