kimhung0011 commited on
Commit
4960c9d
·
verified ·
1 Parent(s): b55d981

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,13 +13,13 @@ question_answerer = pipeline("question-answering", model=model_checkpoint)
13
 
14
  def answer_question(question, context):
15
  answer = question_answerer(question=question, context=context)
16
- return answer['answer'], answer['score']
17
 
18
 
19
  iface = gr.Interface(
20
  fn=answer_question,
21
  inputs=["text", "text"],
22
- outputs=["text", "float"],
23
  title="Hugging Face Question Answering"
24
  )
25
  iface.launch()
 
13
 
14
  def answer_question(question, context):
15
  answer = question_answerer(question=question, context=context)
16
+ return answer['answer'], answer['score'], answer['start'], answer['end']
17
 
18
 
19
  iface = gr.Interface(
20
  fn=answer_question,
21
  inputs=["text", "text"],
22
+ outputs=["text", "float", "int", "int"],
23
  title="Hugging Face Question Answering"
24
  )
25
  iface.launch()