Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|