2023-03-25 00:53:39 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
test -n "$VERBOSE" && set -x
|
|
|
|
|
|
|
|
D="$(cd "$(dirname "$0")"/.. && pwd)"
|
|
|
|
VERSION="$(basename "$D")"
|
2023-07-24 23:43:32 +03:00
|
|
|
MODEL_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/models/OpenLLaMA"
|
2023-03-25 00:53:39 +03:00
|
|
|
|
2023-07-24 23:43:32 +03:00
|
|
|
"$D"/libexec/llama-fetch "$MODEL_DIR" "$VERSION"
|
2023-03-25 00:53:39 +03:00
|
|
|
|
2023-07-24 23:43:32 +03:00
|
|
|
if [ "$1" = '--fetch' ]; then
|
|
|
|
exit
|
|
|
|
fi
|
2023-03-25 00:53:39 +03:00
|
|
|
|
2023-07-24 23:43:32 +03:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
exec "$D"/libexec/llama.cpp \
|
|
|
|
--model "$MODEL_DIR/OpenLLaMA-3Bv2.ggml.f16.bin" \
|
|
|
|
--ctx-size 512 \
|
|
|
|
--batch-size 1024 \
|
|
|
|
--n-predict 256 \
|
|
|
|
--keep 48 \
|
2023-03-25 00:53:39 +03:00
|
|
|
--repeat_penalty 1.0 \
|
|
|
|
--color \
|
2023-07-24 23:43:32 +03:00
|
|
|
--interactive \
|
|
|
|
--reverse-prompt "User:" \
|
|
|
|
--file "$D"/share/prompts/chat-with-bob.txt
|
2023-03-25 00:53:39 +03:00
|
|
|
fi
|
2023-07-24 23:43:32 +03:00
|
|
|
|
|
|
|
# detect --model arg or not
|
|
|
|
for arg in "$@"; do
|
|
|
|
if [ "$arg" = "--model" -o "$arg" = "-m" ]; then
|
|
|
|
exec "$D"/libexec/llama.cpp "$@"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
exec "$D"/libexec/llama.cpp "$@" --model "$MODEL_DIR/OpenLLaMA-3Bv2.ggml.f16.bin"
|