/ examples / jeopardy / jeopardy.sh
jeopardy.sh
 1  #!/bin/bash
 2  set -e
 3  
 4  MODEL=./models/ggml-vicuna-13b-1.1-q4_0.bin
 5  MODEL_NAME=Vicuna
 6  
 7  # exec options
 8  prefix="Human: " # Ex. Vicuna uses "Human: "
 9  opts="--temp 0 -n 80" # additional flags
10  nl='
11  '
12  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)."
13  
14  # file options
15  question_file=./examples/jeopardy/questions.txt
16  touch ./examples/jeopardy/results/$MODEL_NAME.txt
17  output_file=./examples/jeopardy/results/$MODEL_NAME.txt
18  
19  counter=1
20  
21  echo 'Running'
22  while IFS= read -r question
23  do
24    exe_cmd="./llama-cli -p "\"$prefix$introduction$nl$prefix$question\"" "$opts" -m ""\"$MODEL\""" >> ""\"$output_file\""
25    echo $counter
26    echo "Current Question: $question"
27    eval "$exe_cmd"
28    echo -e "\n------" >> $output_file
29    counter=$((counter+1))
30  done < "$question_file"