Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -141,24 +141,11 @@ def testQA(question):
|
|
141 |
time = datetime.now()
|
142 |
context = list(filter(lambda x: x['benefitName']==predictedBenefit and x['coreName']==predictedCore, benefits))[0]
|
143 |
answer = question_answerer(question = question, context = context['context'])['answer']
|
144 |
-
time3 = (datetime.now() - time).total_seconds()
|
145 |
-
|
146 |
|
147 |
-
spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
|
148 |
-
csv_url='https://docs.google.com/spreadsheets/d/' + spreadsheet_id + '/export?format=csv&id=' + spreadsheet_id + '&gid=0'
|
149 |
|
150 |
-
|
151 |
-
open('google2.csv', 'wb').write(res.content)
|
152 |
-
df = pd.read_csv('google2.csv')
|
153 |
|
154 |
|
155 |
-
spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
|
156 |
-
url = 'https://script.google.com/macros/s/AKfycbwXP5fsDgOXJ9biZQC293o6bTBL3kDOJ07PlmxKjabzdTej6WYdC8Yos6NpDVqAJeVM/exec?spreadsheetId=' + spreadsheet_id
|
157 |
-
body = {
|
158 |
-
"arguments": {"range": "Sheet1!C"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
|
159 |
-
"body": {"values": [[answer]]}
|
160 |
-
}
|
161 |
-
res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
|
162 |
|
163 |
|
164 |
|
|
|
141 |
time = datetime.now()
|
142 |
context = list(filter(lambda x: x['benefitName']==predictedBenefit and x['coreName']==predictedCore, benefits))[0]
|
143 |
answer = question_answerer(question = question, context = context['context'])['answer']
|
|
|
|
|
144 |
|
|
|
|
|
145 |
|
146 |
+
time3 = (datetime.now() - time).total_seconds()
|
|
|
|
|
147 |
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
|
151 |
|