MarcBrun commited on
Commit
8bc7261
·
1 Parent(s): a38743a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ def answer_question(question, answer_text):
8
 
9
  answer = qa(question=question, context=answer_text)
10
 
11
- return answer["answer"]
12
 
13
- iface = gr.Interface(fn=answer_question, inputs=[gr.inputs.Textbox(lines=1, placeholder="Question Here...", label="Question"),gr.inputs.Textbox(lines=5, placeholder="Context Here...", label="Context")], outputs=gr.outputs.Textbox(label="Answer"), capture_session=True, title="Question Answering in English, Spanish and Basque", description="Write or paste a text and a question about something that appears in the text and see if the model can answer correctly. It works best in English, but it has proven itself to also understand Spanish and Basque!")
14
  iface.launch()
 
8
 
9
  answer = qa(question=question, context=answer_text)
10
 
11
+ return {"Answer": answer["answer"], "Score": answer["score"]}
12
 
13
+ iface = gr.Interface(fn=answer_question, inputs=[gr.inputs.Textbox(lines=1, placeholder="Question Here...", label="Question"),gr.inputs.Textbox(lines=5, placeholder="Context Here...", label="Context")], outputs=gr.outputs.Textbox(label="Answer"), outputs=gr.outputs.Textbox(label="Score"), capture_session=True, title="Question Answering in English, Spanish and Basque", description="Write or paste a text and a question about something that appears in the text and see if the model can answer correctly. It works best in English, but it has proven itself to also understand Spanish and Basque!")
14
  iface.launch()