Spaces:
Running
on
Zero
Running
on
Zero
DivEye - PR (fix themes) (#16)
Browse files- fix logging msg & theme (7748128d07c5039223ce5d87be798057c56a90e1)
app.py
CHANGED
|
@@ -122,11 +122,11 @@ def detect_ai_text(text):
|
|
| 122 |
human_prob = 1 - ai_prob
|
| 123 |
|
| 124 |
if ai_prob > 0.7:
|
| 125 |
-
message = f"🤖 **
|
| 126 |
elif ai_prob > 0.5:
|
| 127 |
-
message = f"⚠️ **
|
| 128 |
else:
|
| 129 |
-
message = f"✅ **
|
| 130 |
|
| 131 |
bar_data = pd.DataFrame({
|
| 132 |
"Source": ["AI Generated", "Human Written"],
|
|
@@ -161,7 +161,7 @@ if torch.cuda.is_available():
|
|
| 161 |
|
| 162 |
|
| 163 |
# Gradio app setup
|
| 164 |
-
with gr.Blocks(title="DivEye") as demo:
|
| 165 |
gr.HTML("""
|
| 166 |
<div style="display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; background: #f0f4f8; border-radius: 12px; margin-bottom: 1rem;">
|
| 167 |
<div style="text-align: left; max-width: 70%;">
|
|
|
|
| 122 |
human_prob = 1 - ai_prob
|
| 123 |
|
| 124 |
if ai_prob > 0.7:
|
| 125 |
+
message = f"🤖 **Likely AI-generated** (Confidence: {ai_prob:.2%})"
|
| 126 |
elif ai_prob > 0.5:
|
| 127 |
+
message = f"⚠️ **Possibly AI-generated** (Confidence: {ai_prob:.2%})"
|
| 128 |
else:
|
| 129 |
+
message = f"✅ **Likely Human-written** (Confidence: {human_prob:.2%})"
|
| 130 |
|
| 131 |
bar_data = pd.DataFrame({
|
| 132 |
"Source": ["AI Generated", "Human Written"],
|
|
|
|
| 161 |
|
| 162 |
|
| 163 |
# Gradio app setup
|
| 164 |
+
with gr.Blocks(title="DivEye", theme=gr.themes.Soft()) as demo:
|
| 165 |
gr.HTML("""
|
| 166 |
<div style="display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; background: #f0f4f8; border-radius: 12px; margin-bottom: 1rem;">
|
| 167 |
<div style="text-align: left; max-width: 70%;">
|