aliabd HF staff commited on
Commit
64546a4
1 Parent(s): 377dd27

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +2 -1
run.py CHANGED
@@ -11,7 +11,8 @@ question = "Which continent is the Amazon rainforest in?"
11
 
12
 
13
  def predict(context, question):
14
- return nlp({"question": question, "context": context})
 
15
 
16
  gr.Interface(predict, inputs=[
17
  gr.inputs.Textbox(lines=7, default=context, label="Context Paragraph"),
 
11
 
12
 
13
  def predict(context, question):
14
+ res = nlp({"question": question, "context": context})
15
+ return res["answer"], res["score"]
16
 
17
  gr.Interface(predict, inputs=[
18
  gr.inputs.Textbox(lines=7, default=context, label="Context Paragraph"),