Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,26 +30,32 @@ def circular_html(ai_percent):
|
|
| 30 |
"#f44336" if ai_percent < 90 else
|
| 31 |
"#e91e63"
|
| 32 |
)
|
|
|
|
|
|
|
| 33 |
return f"""
|
| 34 |
-
<div style="display: flex;
|
|
|
|
|
|
|
|
|
|
| 35 |
<div style="
|
| 36 |
-
width:
|
| 37 |
-
height:
|
| 38 |
border-radius: 50%;
|
| 39 |
-
background: conic-gradient({color} {ai_percent}%, #
|
| 40 |
display: flex;
|
| 41 |
align-items: center;
|
| 42 |
justify-content: center;
|
| 43 |
-
font-size:
|
| 44 |
font-weight: bold;
|
| 45 |
-
color:
|
| 46 |
-
|
|
|
|
| 47 |
">
|
| 48 |
{ai_percent}%
|
| 49 |
</div>
|
| 50 |
</div>
|
| 51 |
"""
|
| 52 |
-
|
| 53 |
# ===== Chunking for Large Input Support =====
|
| 54 |
def chunk_text(text, max_tokens=300):
|
| 55 |
paragraphs = text.split("\n\n")
|
|
|
|
| 30 |
"#f44336" if ai_percent < 90 else
|
| 31 |
"#e91e63"
|
| 32 |
)
|
| 33 |
+
text_color = "#fff" if ai_percent > 50 else "#222"
|
| 34 |
+
|
| 35 |
return f"""
|
| 36 |
+
<div style="display: flex; flex-direction: column; align-items: center; margin-top: 15px;">
|
| 37 |
+
<div style="font-size: 20px; font-weight: 500; margin-bottom: 12px; color: {text_color};">
|
| 38 |
+
AI Likelihood
|
| 39 |
+
</div>
|
| 40 |
<div style="
|
| 41 |
+
width: 180px;
|
| 42 |
+
height: 180px;
|
| 43 |
border-radius: 50%;
|
| 44 |
+
background: conic-gradient({color} {ai_percent}%, #33333333 {ai_percent}%);
|
| 45 |
display: flex;
|
| 46 |
align-items: center;
|
| 47 |
justify-content: center;
|
| 48 |
+
font-size: 32px;
|
| 49 |
font-weight: bold;
|
| 50 |
+
color: {text_color};
|
| 51 |
+
border: 6px solid rgba(255,255,255,0.1);
|
| 52 |
+
box-shadow: 0 0 15px rgba(0,0,0,0.2);
|
| 53 |
">
|
| 54 |
{ai_percent}%
|
| 55 |
</div>
|
| 56 |
</div>
|
| 57 |
"""
|
| 58 |
+
|
| 59 |
# ===== Chunking for Large Input Support =====
|
| 60 |
def chunk_text(text, max_tokens=300):
|
| 61 |
paragraphs = text.split("\n\n")
|