From d08356700e3348a973528098ac982ecd73a7b3de Mon Sep 17 00:00:00 2001 From: CRD716 Date: Thu, 27 Apr 2023 00:49:47 -0500 Subject: [PATCH] Y'all ready to get funky? --- examples/jeopardy/README.md | 21 +++++++++++++++++++++ examples/jeopardy/graph.py | 6 +++++- examples/jeopardy/jeopardy.sh | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 examples/jeopardy/README.md diff --git a/examples/jeopardy/README.md b/examples/jeopardy/README.md new file mode 100644 index 000000000..4c42e3cdb --- /dev/null +++ b/examples/jeopardy/README.md @@ -0,0 +1,21 @@ +# llama.cpp/example/jeopardy + +This is pretty much just a straight port of aigoopy/llm-jeopardy/ with an added graph viewer. + +The jeopardy test can be used to compare the fact knowledge of different models and compare them to eachother. This is in contrast to some other tests, which test logical deduction, creativity, writing skills, etc. + + +Step 1: Open jeopardy.sh and modify the following: +``` +MODEL=(path to your model) +MODEL_NAME=(name of your model) +prefix=(basically, if you use vicuna it's Human: , if you use something else it might be User: , etc) +opts=(add -instruct here if needed for your model, or anything else you want to test out) +``` +Step 2: Run `jeopardy.sh` from the llama.cpp folder + +Step 3: Repeat steps 1 and 2 until you have all the results you need. + +Step 4: Run `graph.py`, and follow the instructions. At the end, it will generate your final graph. + +Note: The Human bar is based off of the full, original 100 sample questions. If you modify the question count or questions, it will not be valid. diff --git a/examples/jeopardy/graph.py b/examples/jeopardy/graph.py index edbdf8e68..d00b28652 100644 --- a/examples/jeopardy/graph.py +++ b/examples/jeopardy/graph.py @@ -4,7 +4,7 @@ import csv labels = [] numbers = [] -numEntries = 0 +numEntries = 1 rows = [] @@ -49,4 +49,8 @@ def calculatecorrect(): if __name__ == '__main__': calculatecorrect() pos = list(range(numEntries)) + labels.append("Human") + numbers.append(48.11) bar_chart(numbers, labels, pos) + print(labels) + print(numbers) diff --git a/examples/jeopardy/jeopardy.sh b/examples/jeopardy/jeopardy.sh index 875a67503..9bdbc755c 100644 --- a/examples/jeopardy/jeopardy.sh +++ b/examples/jeopardy/jeopardy.sh @@ -5,8 +5,8 @@ MODEL=./models/ggml-vicuna-13b-1.1-q4_0.bin MODEL_NAME=Vicuna # exec options -opts="--temp 0 -n 80" # additional flags 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)."