rasyosef commited on
Commit
9bdd421
1 Parent(s): 62d0380

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- roberta_sentiment = pipeline(
5
- "text-classifier", model="rasyosef/roberta-base-finetuned-sst2"
6
  )
7
 
8
 
9
  def predict_sentiment(text):
10
- return roberta_sentiment(text)
11
 
12
 
13
  with gr.Blocks() as demo:
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ classifier = pipeline(
5
+ "text-classification", model="rasyosef/roberta-base-finetuned-sst2"
6
  )
7
 
8
 
9
  def predict_sentiment(text):
10
+ return classifier(text)[0]
11
 
12
 
13
  with gr.Blocks() as demo: