MarcBrun commited on
Commit
5db96f7
·
1 Parent(s): 532c8ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -21,8 +21,8 @@ def answer_question(question, context, pipe):
21
 
22
  return [answer["answer"], answer["score"]]
23
 
24
- iface1 = gr.Interface.load(fn=answer_question(question=question, context=context, pipe="qa1"))
25
- iface2 = gr.Interface.load(fn=answer_question(question=question, context=context, pipe="qa2"))
26
- iface3 = gr.Interface.load(fn=answer_question(pipe="qa3"), inputs=[gr.inputs.Textbox(lines=1, default=question, placeholder="Question Here...", label="Question"),gr.inputs.Textbox(lines=7, default=context, placeholder="Context Here...", label="Context")], outputs=[gr.outputs.Textbox(label="Answer"),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!\n\nI offer you a default question and answer for qick testing, but feel free to use your own examples.")
27
 
28
  Parallel(iface1,iface2, iface3).launch()
 
21
 
22
  return [answer["answer"], answer["score"]]
23
 
24
+ iface1 = gr.Interface(fn=answer_question(question=question, context=context, pipe="qa1"))
25
+ iface2 = gr.Interface(fn=answer_question(question=question, context=context, pipe="qa2"))
26
+ iface3 = gr.Interface(fn=answer_question(pipe="qa3"), inputs=[gr.inputs.Textbox(lines=1, default=question, placeholder="Question Here...", label="Question"),gr.inputs.Textbox(lines=7, default=context, placeholder="Context Here...", label="Context")], outputs=[gr.outputs.Textbox(label="Answer"),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!\n\nI offer you a default question and answer for qick testing, but feel free to use your own examples.")
27
 
28
  Parallel(iface1,iface2, iface3).launch()