johnpaulbin commited on
Commit
ec3ec5c
1 Parent(s): 22d4f29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -107,8 +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
-
111
- if output[0][0] > output[0][1]:
112
  return "Not toxic " + str(output[0][0])
113
  else:
114
  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.62:
 
111
  return "Not toxic " + str(output[0][0])
112
  else:
113
  return "Toxic! " + str(output[0][1])