drishya1 commited on
Commit
e385a61
·
verified ·
1 Parent(s): ab8e25c

second attempt

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 = "Toxic" if prediction in ["positive", "pos", "toxic", "yes"] else "Not Toxic"
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