Fixed core issue, I think
Browse files
app.py
CHANGED
|
@@ -37,8 +37,7 @@ def classify_toxic(text):
|
|
| 37 |
probabilities = torch.nn.functional.softmax(output, dim=-1)
|
| 38 |
preds = probabilities.tolist()
|
| 39 |
print(f"Preds: {preds}")
|
| 40 |
-
return "Safe"
|
| 41 |
-
# return "Toxic" if preds[0] <= 0.55 else "Safe"
|
| 42 |
|
| 43 |
|
| 44 |
# -----------------------
|
|
|
|
| 37 |
probabilities = torch.nn.functional.softmax(output, dim=-1)
|
| 38 |
preds = probabilities.tolist()
|
| 39 |
print(f"Preds: {preds}")
|
| 40 |
+
return "Toxic" if preds[0][0] <= 0.55 else "Safe"
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
# -----------------------
|