nickprock commited on
Commit
5781233
·
1 Parent(s): fbcefc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,13 +3,13 @@ from setfit import SetFitModel
3
 
4
  model = SetFitModel.from_pretrained("nickprock/setfit-italian-hate-speech")
5
 
6
- dictionary={'0':'not-hateful',
7
- '1':'hateful',}
8
 
9
 
10
  def greet(text, dictionary=dictionary):
11
  preds = model(text)
12
- return response
13
 
14
  demo = gr.Interface(fn=greet,
15
  inputs="text",
 
3
 
4
  model = SetFitModel.from_pretrained("nickprock/setfit-italian-hate-speech")
5
 
6
+ dictionary={0:'not-hateful',
7
+ 1:'hateful',}
8
 
9
 
10
  def greet(text, dictionary=dictionary):
11
  preds = model(text)
12
+ return dictionary[response[0]][label]
13
 
14
  demo = gr.Interface(fn=greet,
15
  inputs="text",