amitu009 commited on
Commit
e415789
·
1 Parent(s): 91a3a66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -2,10 +2,11 @@ import gradio as gr
2
 
3
  from transformers import pipeline
4
 
5
- sentiment = pipeline("sentiment-analysis")
6
 
7
- def get_sentiment(input_text):
8
- return sentiment(input_text)
 
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",