mihalykiss commited on
Commit
72241b4
·
1 Parent(s): f97e9a9

fixing binary prediction

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -32,10 +32,10 @@ def classify_text(text):
32
  with torch.no_grad():
33
  probabilities = torch.softmax(model(**inputs).logits, dim=1)[0]
34
 
35
- human_prob = probabilities[24].item() * 100
36
  ai_probs = probabilities.clone()
37
  ai_probs[24] = 0
38
  ai_total_prob = ai_probs.sum().item() * 100
 
39
 
40
  ai_argmax_index = torch.argmax(ai_probs).item()
41
  ai_argmax_model = label_mapping[ai_argmax_index]
 
32
  with torch.no_grad():
33
  probabilities = torch.softmax(model(**inputs).logits, dim=1)[0]
34
 
 
35
  ai_probs = probabilities.clone()
36
  ai_probs[24] = 0
37
  ai_total_prob = ai_probs.sum().item() * 100
38
+ human_prob = 100 - ai_total_prob
39
 
40
  ai_argmax_index = torch.argmax(ai_probs).item()
41
  ai_argmax_model = label_mapping[ai_argmax_index]