Spaces:
Runtime error
Runtime error
Commit
·
03c65d9
1
Parent(s):
3f87bd6
QA pipeline
Browse files
app.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
return "Hello " + name + "!"
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
submit_btn = gr.Button("Submit")
|
| 10 |
-
submit_btn.click(fn=greet, inputs=name)
|
| 11 |
-
#output = gr.Textbox(label="Output Box")
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
qa_model = pipeline("question-answering",'a-ware/bart-squadv2')
|
|
|
|
| 5 |
|
| 6 |
+
def fetch_answer(name):
|
| 7 |
+
return qa_model(question = question, context = context)['answer']
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
demo = gr.Interface(
|
| 10 |
+
fn=fetch_answer,
|
| 11 |
+
inputs=gr.Textbox(lines=2, placeholder="Name Here..."),
|
| 12 |
+
outputs="text",
|
| 13 |
+
)
|
| 14 |
+
demo.launch()
|