diff --git a/examples/chat-13B.sh b/examples/chat-13B.sh index 4265d7b662427..04a4afb2e38da 100755 --- a/examples/chat-13B.sh +++ b/examples/chat-13B.sh @@ -1,4 +1,18 @@ -#!/bin/bash +#!/usr/env/bin bash + +while getopts "m:u:a:t:p:g:" opt; do + case $opt in + m) MODEL="--model $OPTARG";; + u) USER_NAME="$OPTARG";; + a) AI_NAME="$OPTARG";; + t) N_THREAD="$OPTARG";; + p) N_PREDICTS="$OPTARG";; + g) GEN_OPTIONS="$OPTARG";; + \?) echo "Invalid option -$OPTARG" >&2; exit 1;; + esac +done + +shift $((OPTIND-1)) cd "$(dirname "$0")/.." || exit @@ -17,7 +31,7 @@ GEN_OPTIONS="${GEN_OPTIONS:---ctx_size 2048 --temp 0.7 --top_k 40 --top_p 0.5 -- # shellcheck disable=SC2086 # Intended splitting of GEN_OPTIONS ./main $GEN_OPTIONS \ - --model "$MODEL" \ + $MODEL \ --threads "$N_THREAD" \ --n_predict "$N_PREDICTS" \ --color --interactive \ diff --git a/examples/reason-act.sh b/examples/reason-act.sh index e7fe655dbcea3..a8c1346869380 100755 --- a/examples/reason-act.sh +++ b/examples/reason-act.sh @@ -1,15 +1,18 @@ +#!/usr/env/bin bash -#!/bin/bash +while getopts "m:" opt; do + case $opt in + m) MODEL="-m $OPTARG";; + \?) echo "Invalid option -$OPTARG" >&2; exit 1;; + esac +done -cd `dirname $0` -cd .. +shift $((OPTIND-1)) -# get -m model parameter otherwise defer to default -if [ "$1" == "-m" ]; then - MODEL="-m $2 " -fi +cd "$(dirname "$0")" +cd .. -./main $MODEL --color \ +./bin/main $MODEL --color \ -f ./prompts/reason-act.txt \ -i --interactive-first \ --top_k 10000 --temp 0.2 --repeat_penalty 1 -t 7 -c 2048 \