Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
|
| 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": {
|