Spaces:
Runtime error
Runtime error
johnpaulbin
commited on
Commit
•
1dcae56
1
Parent(s):
ec3ec5c
Update app.py
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ def inf(inpt):
|
|
107 |
embedding = sentencemodel.encode(TEXT, convert_to_tensor=True)
|
108 |
INPUT = torch.cat((probs, embedding))
|
109 |
output = F.softmax(model(INPUT.view(1, -1)), dim=1)
|
110 |
-
if not output[0][1] > 0.
|
111 |
return "Not toxic " + str(output[0][0])
|
112 |
else:
|
113 |
return "Toxic! " + str(output[0][1])
|
|
|
107 |
embedding = sentencemodel.encode(TEXT, convert_to_tensor=True)
|
108 |
INPUT = torch.cat((probs, embedding))
|
109 |
output = F.softmax(model(INPUT.view(1, -1)), dim=1)
|
110 |
+
if not output[0][1] > 0.68:
|
111 |
return "Not toxic " + str(output[0][0])
|
112 |
else:
|
113 |
return "Toxic! " + str(output[0][1])
|