Spaces:
Sleeping
Sleeping
second attempt
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ def predict_toxicity(text, model, tokenizer, device, model_name):
|
|
107 |
print(f"Raw model output: {prediction}")
|
108 |
|
109 |
# Adjust the condition to check for both "positive" and potential variations
|
110 |
-
prediction
|
111 |
else:
|
112 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128, padding="max_length").to(device)
|
113 |
|
|
|
107 |
print(f"Raw model output: {prediction}")
|
108 |
|
109 |
# Adjust the condition to check for both "positive" and potential variations
|
110 |
+
prediction == "Toxic" if prediction == "positive" else "Not Toxic"
|
111 |
else:
|
112 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128, padding="max_length").to(device)
|
113 |
|