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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -21,8 +21,10 @@ def answer_question(question, context, pipe):
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()
 
21
 
22
  return [answer["answer"], answer["score"]]
23
 
24
+ iface1 = 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)
25
+
26
+ iface2 = 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)
27
+
28
  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.")
29
 
30
  Parallel(iface1,iface2, iface3).launch()