Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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={
|
| 7 |
-
|
| 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",
|