tosin2013 commited on
Commit
8fae716
1 Parent(s): 49ad6d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -11,11 +11,19 @@ def answer_question(context, question):
11
  return answer, f"{score:.2f}"
12
 
13
  # Define the Gradio interface
14
- with gr.Interface(
15
- fn=answer_question,
16
- inputs=[gr.inputs.Textbox(lines=10, placeholder="Enter the context here..."), gr.inputs.Textbox(lines=2, placeholder="Enter your question here...")],
17
- outputs=[gr.outputs.Textbox(label="Answer"), gr.outputs.Textbox(label="Confidence Score")],
18
- title="Question Answering System",
19
- description="Upload a document and ask questions to get answers based on the context."
20
- ) as qa_app:
21
- qa_app.launch()
 
 
 
 
 
 
 
 
 
11
  return answer, f"{score:.2f}"
12
 
13
  # Define the Gradio interface
14
+ interface = gr.Interface(
15
+ fn=answer_question,
16
+ inputs=[
17
+ gr.Textbox(lines=10, placeholder="Enter the context here...", label="Context"),
18
+ gr.Textbox(lines=2, placeholder="Enter your question here...", label="Question")
19
+ ],
20
+ outputs=[
21
+ gr.Textbox(label="Answer"),
22
+ gr.Textbox(label="Confidence Score")
23
+ ],
24
+ title="Question Answering System",
25
+ description="Upload a document and ask questions to get answers based on the context."
26
+ )
27
+
28
+ if __name__ == "__main__":
29
+ interface.launch()