diff options
author | CRD716 <crd716@gmail.com> | 2023-04-28 11:13:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 19:13:33 +0300 |
commit | 5fba3c016bfd1d73a070e7c93dac14162ce118d0 (patch) | |
tree | cddf05d07766950f565f3b4bb644ba9466d240cc /examples/jeopardy/jeopardy.sh | |
parent | 1481a9cf25ea2e4abef6b13a57660a35f3e66af1 (diff) |
examples : add Jeopardy example (#1168)
* Basic Setup
* Prevent Results.txt from coming up
* Prefixes, Line separators, etc
* editorcheck
* introduction to give more consistent results
* Basic graph thing
* Grading, ready for testing!
* Y'all ready to get funky?
* fix column removal stuff
* missed a few
Diffstat (limited to 'examples/jeopardy/jeopardy.sh')
-rw-r--r-- | examples/jeopardy/jeopardy.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/jeopardy/jeopardy.sh b/examples/jeopardy/jeopardy.sh new file mode 100644 index 00000000..9bdbc755 --- /dev/null +++ b/examples/jeopardy/jeopardy.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +MODEL=./models/ggml-vicuna-13b-1.1-q4_0.bin +MODEL_NAME=Vicuna + +# exec options +prefix="Human: " # Ex. Vicuna uses "Human: " +opts="--temp 0 -n 80" # additional flags +nl=' +' +introduction="You will be playing a game of Jeopardy. Simply answer the question in the correct format (Ex. What is Paris, or Who is George Washington)." + +# file options +question_file=./examples/jeopardy/questions.txt +touch ./examples/jeopardy/results/$MODEL_NAME.txt +output_file=./examples/jeopardy/results/$MODEL_NAME.txt + +counter=1 + +echo 'Running' +while IFS= read -r question +do + exe_cmd="./main -p "\"$prefix$introduction$nl$prefix$question\"" "$opts" -m ""\"$MODEL\""" >> ""\"$output_file\"" + echo $counter + echo "Current Question: $question" + eval "$exe_cmd" + echo -e "\n------" >> $output_file + counter=$((counter+1)) +done < "$question_file" |