Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
title = 'Question Answering APP'
|
| 4 |
+
context = "My name is Sakil Ansari. I love tea and drink it regularly"
|
| 5 |
+
question = "What do I love?"
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
question_answerer = pipeline("question-answering")
|
| 9 |
+
#result = question_answerer(question = question, context=context)
|
| 10 |
+
#return result['answer']
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
interface = gr.Interface.from_pipeline(question_answerer,
|
| 16 |
+
title = title,
|
| 17 |
+
theme = "grass",
|
| 18 |
+
examples = [[context, question]]).launch()
|