Update app.py
Browse files
app.py
CHANGED
@@ -17,11 +17,11 @@ def answer_question(context, question):
|
|
17 |
result = nlp(question=question, context=context)
|
18 |
return result['answer']
|
19 |
|
20 |
-
# Define the Gradio interface
|
21 |
iface = gr.Interface(fn=answer_question,
|
22 |
-
inputs=[gr.
|
23 |
-
gr.
|
24 |
-
outputs=gr.
|
25 |
title="Question and Answer Assistant",
|
26 |
description="Provide a context and ask a question based on that context. The assistant will find the answer for you.")
|
27 |
|
|
|
17 |
result = nlp(question=question, context=context)
|
18 |
return result['answer']
|
19 |
|
20 |
+
# Define the Gradio interface with the updated API
|
21 |
iface = gr.Interface(fn=answer_question,
|
22 |
+
inputs=[gr.Textbox(label="Context", placeholder="Enter the text here...", lines=7),
|
23 |
+
gr.Textbox(label="Question", placeholder="Enter your question here...")],
|
24 |
+
outputs=gr.Textbox(label="Answer"),
|
25 |
title="Question and Answer Assistant",
|
26 |
description="Provide a context and ask a question based on that context. The assistant will find the answer for you.")
|
27 |
|