paascorb commited on
Commit
5150155
1 Parent(s): 2d72da8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -29,10 +29,11 @@ def do_ask(question, button, dataset):
29
  global docs
30
  docs_ready = dataset.iloc[-1, 0] != ""
31
  if button == "✨Listo✨" and docs_ready:
32
- path = dataset[0]["filepath"]
33
- txt = Path(f'{path}').read_text()
34
- question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
35
- return question_answerer(question, context=text)
 
36
  else:
37
  return ""
38
 
 
29
  global docs
30
  docs_ready = dataset.iloc[-1, 0] != ""
31
  if button == "✨Listo✨" and docs_ready:
32
+ for _, row in dataset.iterrows():
33
+ path = row['filepath']
34
+ txt = Path(f'{path}').read_text()
35
+ question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
36
+ return question_answerer(question, context=text)
37
  else:
38
  return ""
39