paascorb commited on
Commit
ac1928f
1 Parent(s): 1ec839c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -22,15 +22,15 @@ def validate_dataset(dataset):
22
 
23
  def do_ask(question, button, dataset):
24
 
25
- global docs
26
- docs_ready = dataset.iloc[-1, 0] != ""
27
- if button == "✨Listo✨" and docs_ready:
28
- path = dataset["filepath"]
29
- txt = Path('path.txt').read_text()
30
- question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
31
- return question_answerer(question, context=text)
32
- else:
33
- return ""
34
 
35
  # def do_ask(question, button, dataset, progress=gr.Progress()):
36
  # global docs
 
22
 
23
  def do_ask(question, button, dataset):
24
 
25
+ global docs
26
+ docs_ready = dataset.iloc[-1, 0] != ""
27
+ if button == "✨Listo✨" and docs_ready:
28
+ path = dataset["filepath"]
29
+ txt = Path('path.txt').read_text()
30
+ question_answerer = pipeline("question-answering", model='distilbert-base-cased-distilled-squad')
31
+ return question_answerer(question, context=text)
32
+ else:
33
+ return ""
34
 
35
  # def do_ask(question, button, dataset, progress=gr.Progress()):
36
  # global docs