bstraehle commited on
Commit
18410c3
·
verified ·
1 Parent(s): 2744c36

Update util.py

Browse files
Files changed (1) hide show
  1. util.py +19 -22
util.py CHANGED
@@ -17,28 +17,25 @@ def get_questions():
17
 
18
  def get_final_answer(question, initial_answer):
19
  prompt_template = """
20
- You are an expert question answering assistant. Given a question and an initial answer, your task is to determine the final answer.
21
-
22
- **Instructions:**
23
- - 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.
24
- - 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.
25
- - 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.
26
- - 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.
27
- - In case of a single word answer, start the word with an uppercase letter.
28
-
29
- **Question:** """
30
- question + """
31
-
32
- **Initial answer:** """
33
- initial_answer + """
34
-
35
- **Example 1:** What is the opposite of white? Black
36
- **Example 2:** How many 'r's are in the word strawberry? 3
37
- **Example 3:** What is the biggest city in California? Los Angeles
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(