Spaces:
Sleeping
Sleeping
Commit
·
328a8f1
1
Parent(s):
5b36832
UI - theme
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def classify_text(text):
|
|
| 32 |
outputs = model(**inputs)
|
| 33 |
probabilities = torch.softmax(outputs.logits, dim=1)[0]
|
| 34 |
predicted_class = torch.argmax(probabilities).item()
|
| 35 |
-
confidence = probabilities[predicted_class].item() * 100
|
| 36 |
|
| 37 |
if predicted_class == 24:
|
| 38 |
prediction_label = f"✅ - The text is **{confidence:.2f}%** likely **Human written**."
|
|
@@ -56,8 +56,7 @@ Detect AI-generated texts with precision using the new **ModernBERT** model, fin
|
|
| 56 |
- **🤖 Identify AI Models**: Reveals which LLM generated the text if detected as AI.
|
| 57 |
- **✅ Human Verification**: Marks confidently human-written text with a green checkmark.
|
| 58 |
|
| 59 |
-
**
|
| 60 |
-
|
| 61 |
|
| 62 |
"""
|
| 63 |
|
|
@@ -73,13 +72,17 @@ iface = gr.Interface(
|
|
| 73 |
title=title,
|
| 74 |
description=description,
|
| 75 |
allow_flagging="never",
|
| 76 |
-
live=
|
| 77 |
css="""
|
| 78 |
#text_input_box {
|
| 79 |
border-radius: 10px;
|
| 80 |
border: 2px solid #4CAF50;
|
| 81 |
font-size: 18px;
|
| 82 |
-
padding:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
#result_output_box {
|
| 85 |
border-radius: 10px;
|
|
@@ -87,19 +90,26 @@ iface = gr.Interface(
|
|
| 87 |
font-size: 18px;
|
| 88 |
padding: 15px;
|
| 89 |
background-color: #2E2E3F;
|
| 90 |
-
margin
|
|
|
|
|
|
|
| 91 |
}
|
| 92 |
body {
|
| 93 |
background: #1E1E2F;
|
| 94 |
color: #E1E1E6;
|
| 95 |
font-family: 'Aptos', sans-serif;
|
| 96 |
padding: 20px;
|
|
|
|
| 97 |
}
|
| 98 |
.gradio-container {
|
| 99 |
border: 2px solid #4CAF50;
|
| 100 |
border-radius: 15px;
|
| 101 |
-
padding:
|
| 102 |
box-shadow: 0px 0px 20px rgba(0,255,0,0.6);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
}
|
| 104 |
h1, h2 {
|
| 105 |
text-align: center;
|
|
|
|
| 32 |
outputs = model(**inputs)
|
| 33 |
probabilities = torch.softmax(outputs.logits, dim=1)[0]
|
| 34 |
predicted_class = torch.argmax(probabilities).item()
|
| 35 |
+
confidence = probabilities[predicted_class].item() * 100
|
| 36 |
|
| 37 |
if predicted_class == 24:
|
| 38 |
prediction_label = f"✅ - The text is **{confidence:.2f}%** likely **Human written**."
|
|
|
|
| 56 |
- **🤖 Identify AI Models**: Reveals which LLM generated the text if detected as AI.
|
| 57 |
- **✅ Human Verification**: Marks confidently human-written text with a green checkmark.
|
| 58 |
|
| 59 |
+
**Note:** The longer the text, the better the detection accuracy.
|
|
|
|
| 60 |
|
| 61 |
"""
|
| 62 |
|
|
|
|
| 72 |
title=title,
|
| 73 |
description=description,
|
| 74 |
allow_flagging="never",
|
| 75 |
+
live=True,
|
| 76 |
css="""
|
| 77 |
#text_input_box {
|
| 78 |
border-radius: 10px;
|
| 79 |
border: 2px solid #4CAF50;
|
| 80 |
font-size: 18px;
|
| 81 |
+
padding: 15px;
|
| 82 |
+
text-align: center;
|
| 83 |
+
margin: 0 auto;
|
| 84 |
+
display: block;
|
| 85 |
+
width: 80%;
|
| 86 |
}
|
| 87 |
#result_output_box {
|
| 88 |
border-radius: 10px;
|
|
|
|
| 90 |
font-size: 18px;
|
| 91 |
padding: 15px;
|
| 92 |
background-color: #2E2E3F;
|
| 93 |
+
margin: 20px auto;
|
| 94 |
+
width: 80%;
|
| 95 |
+
text-align: center;
|
| 96 |
}
|
| 97 |
body {
|
| 98 |
background: #1E1E2F;
|
| 99 |
color: #E1E1E6;
|
| 100 |
font-family: 'Aptos', sans-serif;
|
| 101 |
padding: 20px;
|
| 102 |
+
text-align: center;
|
| 103 |
}
|
| 104 |
.gradio-container {
|
| 105 |
border: 2px solid #4CAF50;
|
| 106 |
border-radius: 15px;
|
| 107 |
+
padding: 30px;
|
| 108 |
box-shadow: 0px 0px 20px rgba(0,255,0,0.6);
|
| 109 |
+
margin-top: 40px;
|
| 110 |
+
max-width: 600px;
|
| 111 |
+
margin-left: auto;
|
| 112 |
+
margin-right: auto;
|
| 113 |
}
|
| 114 |
h1, h2 {
|
| 115 |
text-align: center;
|