Spaces:
Runtime error
Runtime error
Fangyu Liu
commited on
Commit
•
ac0b0ba
1
Parent(s):
de690c7
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,9 @@ _TABLE = """Year | Democrats | Republicans | Independents
|
|
32 |
_INSTRUCTION = 'Read the table below to answer the following questions.'
|
33 |
|
34 |
|
35 |
-
_TEMPLATE = f"""
|
|
|
|
|
36 |
{_add_markup(_TABLE)}
|
37 |
Q: In which year republicans have the lowest favor rate?
|
38 |
A: Let's find the column of republicans. Then let's extract the favor rates, they [45.0, 42.0, 38.0, 49.0, 51.2, 48.0, 41.0]. The smallest number is 38.0, that's Row 3. Row 3 is year 2007. The answer is 2007.
|
@@ -144,7 +146,8 @@ def evaluate(
|
|
144 |
)
|
145 |
s = generation_output.sequences[0]
|
146 |
output = tokenizer.decode(s)
|
147 |
-
return output.split("### Response:")[1].strip()
|
|
|
148 |
|
149 |
|
150 |
|
|
|
32 |
_INSTRUCTION = 'Read the table below to answer the following questions.'
|
33 |
|
34 |
|
35 |
+
_TEMPLATE = f"""First read an example then the complete question for the second table.
|
36 |
+
------------
|
37 |
+
{_INSTRUCTION}
|
38 |
{_add_markup(_TABLE)}
|
39 |
Q: In which year republicans have the lowest favor rate?
|
40 |
A: Let's find the column of republicans. Then let's extract the favor rates, they [45.0, 42.0, 38.0, 49.0, 51.2, 48.0, 41.0]. The smallest number is 38.0, that's Row 3. Row 3 is year 2007. The answer is 2007.
|
|
|
146 |
)
|
147 |
s = generation_output.sequences[0]
|
148 |
output = tokenizer.decode(s)
|
149 |
+
#return output.split("### Response:")[1].strip()
|
150 |
+
return output
|
151 |
|
152 |
|
153 |
|