Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -125,18 +125,7 @@ else:
|
|
125 |
except Exception as e:
|
126 |
st.warning("Please retype your question and make sure to use the column name and cell value correctly.")
|
127 |
|
128 |
-
|
129 |
-
# Get raw answer again from TAPAS
|
130 |
-
raw_answer = tqa(table=df, query=question, truncation=True)
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
# Get the answer, coordinates, cells, and aggregator from the raw TAPAS output
|
135 |
-
answer = raw_answer['answer']
|
136 |
-
aggregator = raw_answer.get('aggregator', '')
|
137 |
-
coordinates = raw_answer.get('coordinates', [])
|
138 |
-
cells = raw_answer.get('cells', [])
|
139 |
-
|
140 |
# Manually fix the aggregator if it returns an incorrect one
|
141 |
if 'MEDIAN' in question.upper() and 'AVERAGE' in aggregator.upper():
|
142 |
aggregator = 'MEDIAN'
|
|
|
125 |
except Exception as e:
|
126 |
st.warning("Please retype your question and make sure to use the column name and cell value correctly.")
|
127 |
|
128 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
# Manually fix the aggregator if it returns an incorrect one
|
130 |
if 'MEDIAN' in question.upper() and 'AVERAGE' in aggregator.upper():
|
131 |
aggregator = 'MEDIAN'
|