Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
from bert import QA
|
3 |
|
4 |
-
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
gr.
|
10 |
-
|
11 |
-
|
12 |
-
gr.inputs.Textbox(label="Question"),
|
13 |
-
],
|
14 |
-
gr.outputs.Textbox(label="Answer")).launch()
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
examples = [
|
4 |
+
["It's rainy today but it will stop in a few hours", "What is the weather like in a few hours?"]
|
5 |
+
]
|
6 |
|
7 |
+
gr.Interface.load("huggingface/deepset/roberta-base-squad2",
|
8 |
+
inputs=[gr.inputs.Textbox(lines=10, label="Context", placeholder="Type a sentence or paragraph here."),
|
9 |
+
gr.inputs.Textbox(lines=2, label="Question", placeholder="Ask a question based on the context.")],
|
10 |
+
outputs=[gr.outputs.Textbox(label="Answer"),
|
11 |
+
gr.outputs.Label(label="Probability")],
|
12 |
+
examples=examples).launch()
|
|
|
|
|
|