delarosajav95 commited on
Commit
5696449
·
verified ·
1 Parent(s): dd01188

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
  pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT-v2")
5
  #function that Gradio will use to classify
6
  def classify_text(inputs):
7
- result = pipe(inputs, return_all_scores=True)
8
  output = []
9
  label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
10
  for i, predictions in enumerate(result):
@@ -30,4 +30,4 @@ iface = gr.Interface(
30
  )
31
 
32
  # Launch the interface
33
- iface.launch(share=True)
 
4
  pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT-v2")
5
  #function that Gradio will use to classify
6
  def classify_text(inputs):
7
+ result = pipe(inputs, top_k=None)
8
  output = []
9
  label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
10
  for i, predictions in enumerate(result):
 
30
  )
31
 
32
  # Launch the interface
33
+ iface.launch()