Getting logits
Browse files
app.py
CHANGED
|
@@ -32,8 +32,8 @@ def moderate_image(img):
|
|
| 32 |
|
| 33 |
def classify_toxic(text):
|
| 34 |
batch = tokenizer.encode(text, return_tensors="pt")
|
| 35 |
-
output = model(batch).logits
|
| 36 |
-
print(output)
|
| 37 |
return output
|
| 38 |
|
| 39 |
|
|
|
|
| 32 |
|
| 33 |
def classify_toxic(text):
|
| 34 |
batch = tokenizer.encode(text, return_tensors="pt")
|
| 35 |
+
output = model(batch).logits.detach().softmax(dim=-1)
|
| 36 |
+
print(f"Output: {output}")
|
| 37 |
return output
|
| 38 |
|
| 39 |
|