Spaces:
Running
Running
mihalykiss
commited on
Commit
·
34b93b5
1
Parent(s):
dad3685
second model ensemble
Browse files
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 |
-
|
43 |
-
|
|
|
|
|
|
|
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 = """
|