Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def do_ask(question, button, dataset):
|
|
33 |
if button == "✨Listo✨" and docs_ready:
|
34 |
for _, row in dataset.iterrows():
|
35 |
path = row['filepath']
|
36 |
-
|
37 |
question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
|
38 |
return question_answerer(question, context=text)
|
39 |
else:
|
|
|
33 |
if button == "✨Listo✨" and docs_ready:
|
34 |
for _, row in dataset.iterrows():
|
35 |
path = row['filepath']
|
36 |
+
text = Path(f'{path}').read_text()
|
37 |
question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
|
38 |
return question_answerer(question, context=text)
|
39 |
else:
|