mriusero commited on
Commit
7ebe774
·
1 Parent(s): ade3428

feat: improve prompts

Browse files
Files changed (1) hide show
  1. prompts.yaml +8 -8
prompts.yaml CHANGED
@@ -7,7 +7,7 @@
7
  Then in the 'Code:' sequence, you should write the code in simple Python. The code sequence must end with '<end_code>' sequence.
8
  During each intermediate step, you can use 'print()' to save whatever important information you will then need.
9
  These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step.
10
- In the end you have to return a final answer using the `final_answer` tool.
11
 
12
  Here are a few examples using notional tools:
13
  ---
@@ -25,17 +25,17 @@
25
  Code:
26
  ```py
27
  image = image_generator("A portrait of John Doe, a 55-year-old man living in Canada.")
28
- final_answer(image)
29
  ```<end_code>
30
 
31
  ---
32
  Task: "What is the result of the following operation: 5 + 3 + 1294.678?"
33
 
34
- Thought: I will use python code to compute the result of the operation and then return the final answer using the `final_answer` tool
35
  Code:
36
  ```py
37
  result = 5 + 3 + 1294.678
38
- final_answer(result)
39
  ```<end_code>
40
 
41
  ---
@@ -50,7 +50,7 @@
50
  translated_question = translator(question=question, src_lang="French", tgt_lang="English")
51
  print(f"The translated question is {translated_question}.")
52
  answer = image_qa(image=image, question=translated_question)
53
- final_answer(f"The answer is {answer}")
54
  ```<end_code>
55
 
56
  ---
@@ -98,7 +98,7 @@
98
  Thought: I now have the final answer: from the webpages visited, Stanislaus Ulam says of Einstein: "He learned too much mathematics and sort of diminished, it seems to me personally, it seems to me his purely physics creativity." Let's answer in one word.
99
  Code:
100
  ```py
101
- final_answer("diminished")
102
  ```<end_code>
103
 
104
  ---
@@ -117,7 +117,7 @@
117
  Thought: Now I know that Shanghai has the highest population.
118
  Code:
119
  ```py
120
- final_answer("Shanghai")
121
  ```<end_code>
122
 
123
  ---
@@ -138,7 +138,7 @@
138
  Code:
139
  ```py
140
  pope_current_age = 88 ** 0.36
141
- final_answer(pope_current_age)
142
  ```<end_code>
143
 
144
  Above example were using notional tools that might not exist for you. On top of performing computations in the Python code snippets that you create, you only have access to these tools:
 
7
  Then in the 'Code:' sequence, you should write the code in simple Python. The code sequence must end with '<end_code>' sequence.
8
  During each intermediate step, you can use 'print()' to save whatever important information you will then need.
9
  These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step.
10
+ In the end you have to return a final answer using the `final_answer` tool. Make sure to provide a detailed explanation in the final answer.
11
 
12
  Here are a few examples using notional tools:
13
  ---
 
25
  Code:
26
  ```py
27
  image = image_generator("A portrait of John Doe, a 55-year-old man living in Canada.")
28
+ final_answer(f"The oldest person in the document is John Doe, a 55-year-old lumberjack living in Newfoundland. Here is an image of him: {image}")
29
  ```<end_code>
30
 
31
  ---
32
  Task: "What is the result of the following operation: 5 + 3 + 1294.678?"
33
 
34
+ Thought: I will use python code to compute the result of the operation and then return the final answer using the `final_answer` tool.
35
  Code:
36
  ```py
37
  result = 5 + 3 + 1294.678
38
+ final_answer(f"The result of the operation 5 + 3 + 1294.678 is {result}.")
39
  ```<end_code>
40
 
41
  ---
 
50
  translated_question = translator(question=question, src_lang="French", tgt_lang="English")
51
  print(f"The translated question is {translated_question}.")
52
  answer = image_qa(image=image, question=translated_question)
53
+ final_answer(f"The answer to the question 'Quel est l'animal sur l'image?' is {answer}.")
54
  ```<end_code>
55
 
56
  ---
 
98
  Thought: I now have the final answer: from the webpages visited, Stanislaus Ulam says of Einstein: "He learned too much mathematics and sort of diminished, it seems to me personally, it seems to me his purely physics creativity." Let's answer in one word.
99
  Code:
100
  ```py
101
+ final_answer("The consequence of Einstein learning too much math on his creativity was that it 'diminished'.")
102
  ```<end_code>
103
 
104
  ---
 
117
  Thought: Now I know that Shanghai has the highest population.
118
  Code:
119
  ```py
120
+ final_answer("Shanghai has the highest population with 26 million inhabitants compared to Guangzhou's 15 million.")
121
  ```<end_code>
122
 
123
  ---
 
138
  Code:
139
  ```py
140
  pope_current_age = 88 ** 0.36
141
+ final_answer(f"The current age of the pope raised to the power 0.36 is {pope_current_age}.")
142
  ```<end_code>
143
 
144
  Above example were using notional tools that might not exist for you. On top of performing computations in the Python code snippets that you create, you only have access to these tools: