mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 05:48:47 +01:00
examples : improve base-translate.sh script (#4783)
This commit is contained in:
parent
eec22a1c63
commit
96e80dabc6
@ -8,14 +8,19 @@
|
|||||||
# cd llama.cpp
|
# cd llama.cpp
|
||||||
# make -j
|
# make -j
|
||||||
#
|
#
|
||||||
# ./examples/base-translate.sh <model-base> "<text>"
|
# ./examples/base-translate.sh <model-base> "<text>" [extra-main-args]
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
echo "Usage: ./base-translate.sh <model-base> \"<text>\""
|
echo "Usage: ./base-translate.sh <model-base> \"<text>\" [extra-main-args]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
eargs=""
|
||||||
|
if [ $# -gt 2 ]; then
|
||||||
|
eargs="${@:3}"
|
||||||
|
fi
|
||||||
|
|
||||||
ftmp="__llama.cpp_example_tmp__.txt"
|
ftmp="__llama.cpp_example_tmp__.txt"
|
||||||
trap "rm -f $ftmp" EXIT
|
trap "rm -f $ftmp" EXIT
|
||||||
|
|
||||||
@ -52,5 +57,5 @@ echo "$2
|
|||||||
|
|
||||||
model=$1
|
model=$1
|
||||||
|
|
||||||
# generate the most likely continuation, run on the CPU until the string "===" is found
|
# 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 -ngl 0 -r "==="
|
./main -m $model -f $ftmp -n 64 --temp 0 --repeat-penalty 1.0 --no-penalize-nl -r "===" $eargs
|
||||||
|
Loading…
Reference in New Issue
Block a user