Update util.py
Browse files
util.py
CHANGED
|
@@ -17,28 +17,25 @@ def get_questions():
|
|
| 17 |
|
| 18 |
def get_final_answer(question, initial_answer):
|
| 19 |
prompt_template = """
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
**Final answer:**
|
| 40 |
-
|
| 41 |
-
"""
|
| 42 |
|
| 43 |
client = OpenAI()
|
| 44 |
completion = client.chat.completions.create(
|
|
|
|
| 17 |
|
| 18 |
def get_final_answer(question, initial_answer):
|
| 19 |
prompt_template = """
|
| 20 |
+
You are an expert GAIA benchmark question answering assistant, given a question and an initial answer.
|
| 21 |
+
Your final answer must be a number and/or string OR as few words as possible OR a comma separated list of numbers and/or strings.
|
| 22 |
+
If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
|
| 23 |
+
If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
| 24 |
+
If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
|
| 25 |
+
|
| 26 |
+
**Question:** """ + question + """
|
| 27 |
+
|
| 28 |
+
**Initial answer:** """ + initial_answer + """
|
| 29 |
+
|
| 30 |
+
**Example 1:** How many 'r's are in strawberry? 3
|
| 31 |
+
**Example 2:** What is the opposite of white? Black
|
| 32 |
+
**Example 3:** What is the biggest city in California? Los Angeles
|
| 33 |
+
**Example 4:** What is the superlative of good? Best
|
| 34 |
+
**Example 5:** How many states are in the USA? 50
|
| 35 |
+
|
| 36 |
+
**Final answer:**
|
| 37 |
+
|
| 38 |
+
"""
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
client = OpenAI()
|
| 41 |
completion = client.chat.completions.create(
|