Davit6174 commited on
Commit
3150fec
·
verified ·
1 Parent(s): 9531108

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -7
app.py CHANGED
@@ -46,14 +46,27 @@ class ZephyrAPI:
46
 
47
  def __call__(self, question: str, scratchpad: str = "") -> str:
48
  prompt = f"""<|system|>
49
- You are a general AI assistant. I will ask you a question.
50
- Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
51
- YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
52
- 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.
53
- 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.
54
- 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.
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
- Available tools:
57
  {self.tool_descriptions}
58
 
59
  <|user|>
@@ -61,6 +74,7 @@ class ZephyrAPI:
61
 
62
  <|assistant|>
63
  {scratchpad}"""
 
64
  payload = {
65
  "inputs": prompt,
66
  "parameters": {
 
46
 
47
  def __call__(self, question: str, scratchpad: str = "") -> str:
48
  prompt = f"""<|system|>
49
+ You are a helpful AI assistant that can answer questions using tools if needed.
50
+
51
+ Use the following reasoning format to answer questions:
52
+
53
+ Thought: [your reasoning]
54
+ Action: [tool name]
55
+ Action Input: [JSON-encoded input arguments for the tool]
56
+
57
+ After you see an Observation from a tool, continue reasoning:
58
+
59
+ Observation: [tool output]
60
+ Thought: [continue reasoning]
61
+ FINAL ANSWER: [your final answer]
62
+
63
+ Answer rules:
64
+ - YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
65
+ - 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.
66
+ - 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.
67
+ - 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.
68
 
69
+ You have access to the following tools:
70
  {self.tool_descriptions}
71
 
72
  <|user|>
 
74
 
75
  <|assistant|>
76
  {scratchpad}"""
77
+
78
  payload = {
79
  "inputs": prompt,
80
  "parameters": {