mihalykiss commited on
Commit
34b93b5
·
1 Parent(s): dad3685

second model ensemble

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -39,8 +39,11 @@ def classify_text(text):
39
  logits_1 = model_1(**inputs).logits
40
  logits_2 = model_2(**inputs).logits
41
 
42
- avg_logits = (logits_1 + logits_2) / 2
43
- probabilities = torch.softmax(avg_logits, dim=1)[0]
 
 
 
44
 
45
  ai_probs = probabilities.clone()
46
  ai_probs[24] = 0
@@ -63,6 +66,9 @@ def classify_text(text):
63
  return result_message
64
 
65
 
 
 
 
66
  title = "AI Text Detector"
67
 
68
  description = """
 
39
  logits_1 = model_1(**inputs).logits
40
  logits_2 = model_2(**inputs).logits
41
 
42
+ softmax_1 = torch.softmax(logits_1, dim=1)
43
+ softmax_2 = torch.softmax(logits_2, dim=1)
44
+
45
+ averaged_probabilities = (softmax_1 + softmax_2) / 2
46
+ probabilities = averaged_probabilities[0]
47
 
48
  ai_probs = probabilities.clone()
49
  ai_probs[24] = 0
 
66
  return result_message
67
 
68
 
69
+
70
+
71
+
72
  title = "AI Text Detector"
73
 
74
  description = """