Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,11 @@ import gradio as gr
|
|
| 2 |
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
sentiment = pipeline("
|
| 6 |
|
| 7 |
-
def
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
iface = gr.Interface(fn = get_sentiment,
|
| 11 |
inputs = "text",
|
|
|
|
| 2 |
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
+
sentiment = pipeline("question-answering")
|
| 6 |
|
| 7 |
+
def main(question, context):
|
| 8 |
+
answer = pipe(question=question, context="i am genuis")
|
| 9 |
+
return answer["answer"]
|
| 10 |
|
| 11 |
iface = gr.Interface(fn = get_sentiment,
|
| 12 |
inputs = "text",
|