Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,26 +40,33 @@ body {
|
|
| 40 |
.gradio-container {
|
| 41 |
font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
|
| 42 |
"Segoe UI", sans-serif;
|
| 43 |
-
max-width:
|
| 44 |
margin: 0 auto !important;
|
| 45 |
-
padding:
|
| 46 |
color: #f9fafb;
|
| 47 |
}
|
| 48 |
|
| 49 |
-
/*
|
| 50 |
.gradio-container .block {
|
| 51 |
background: transparent !important;
|
| 52 |
border: none !important;
|
| 53 |
box-shadow: none !important;
|
| 54 |
}
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
/* Main cards */
|
| 57 |
.glass-card {
|
| 58 |
background: rgba(15, 23, 42, 0.96); /* near indigo-950 */
|
| 59 |
border-radius: 24px;
|
| 60 |
border: 1px solid rgba(148, 163, 184, 0.30); /* slate-400 */
|
| 61 |
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
|
| 62 |
-
padding:
|
| 63 |
}
|
| 64 |
|
| 65 |
/* Header bar: CMD-BERT left, About CMD-BERT right */
|
|
@@ -198,19 +205,21 @@ textarea {
|
|
| 198 |
def header_html():
|
| 199 |
return gr.HTML(
|
| 200 |
"""
|
| 201 |
-
<
|
| 202 |
-
<
|
| 203 |
-
<div class="cmd-
|
| 204 |
-
|
| 205 |
-
<div
|
| 206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
</div>
|
| 208 |
-
</
|
| 209 |
-
|
| 210 |
-
<span>About CMD‑BERT</span>
|
| 211 |
-
<div class="cmd-header-pill"></div>
|
| 212 |
-
</div>
|
| 213 |
-
</header>
|
| 214 |
"""
|
| 215 |
)
|
| 216 |
|
|
@@ -226,7 +235,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 226 |
header_html()
|
| 227 |
gr.HTML(
|
| 228 |
"""
|
| 229 |
-
<section style="margin
|
| 230 |
<div class="hero-title">
|
| 231 |
Check Cebuano text for a misleading writing style.
|
| 232 |
</div>
|
|
@@ -239,6 +248,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 239 |
"""
|
| 240 |
)
|
| 241 |
|
|
|
|
| 242 |
with gr.Row(elem_classes=["two-col"], equal_height=True):
|
| 243 |
# Left: input card
|
| 244 |
with gr.Column(scale=3):
|
|
@@ -290,6 +300,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 290 |
"Output: Label and confidence score for the submitted text."
|
| 291 |
"</span>"
|
| 292 |
)
|
|
|
|
| 293 |
|
| 294 |
def analyze_ui(text):
|
| 295 |
probs = classify(text)
|
|
@@ -328,6 +339,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 328 |
# -------- How it works tab --------
|
| 329 |
with gr.Tab("How it works"):
|
| 330 |
header_html()
|
|
|
|
| 331 |
with gr.Group(elem_classes=["glass-card"]):
|
| 332 |
gr.Markdown(
|
| 333 |
"## How CMD‑BERT works\n"
|
|
@@ -359,10 +371,12 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 359 |
"- Users are reminded that this is a screening tool only.\n"
|
| 360 |
"- Final judgment should always involve human critical thinking."
|
| 361 |
)
|
|
|
|
| 362 |
|
| 363 |
# -------- About tab --------
|
| 364 |
with gr.Tab("About"):
|
| 365 |
header_html()
|
|
|
|
| 366 |
with gr.Group(elem_classes=["glass-card"]):
|
| 367 |
gr.Markdown(
|
| 368 |
"## About CMD‑BERT\n"
|
|
@@ -386,10 +400,12 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 386 |
"**Adviser:** Engr. Jueco, M.Eng. \n"
|
| 387 |
"January 2026"
|
| 388 |
)
|
|
|
|
| 389 |
|
| 390 |
# -------- Feedback tab --------
|
| 391 |
with gr.Tab("Feedback"):
|
| 392 |
header_html()
|
|
|
|
| 393 |
with gr.Group(elem_classes=["glass-card"]):
|
| 394 |
gr.Markdown(
|
| 395 |
"## Feedback and model improvement\n"
|
|
@@ -442,6 +458,7 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 442 |
inputs=[fb_type, fb_text, fb_email, fb_checkbox],
|
| 443 |
outputs=fb_status,
|
| 444 |
)
|
|
|
|
| 445 |
|
| 446 |
|
| 447 |
if __name__ == "__main__":
|
|
|
|
| 40 |
.gradio-container {
|
| 41 |
font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
|
| 42 |
"Segoe UI", sans-serif;
|
| 43 |
+
max-width: 1200px !important;
|
| 44 |
margin: 0 auto !important;
|
| 45 |
+
padding: 32px 32px 40px 32px !important;
|
| 46 |
color: #f9fafb;
|
| 47 |
}
|
| 48 |
|
| 49 |
+
/* make default blocks transparent so our glass style shows */
|
| 50 |
.gradio-container .block {
|
| 51 |
background: transparent !important;
|
| 52 |
border: none !important;
|
| 53 |
box-shadow: none !important;
|
| 54 |
}
|
| 55 |
|
| 56 |
+
/* optional: constrain generic rows a bit */
|
| 57 |
+
.gradio-container .row {
|
| 58 |
+
max-width: 1120px;
|
| 59 |
+
margin-left: auto;
|
| 60 |
+
margin-right: auto;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
/* Main cards */
|
| 64 |
.glass-card {
|
| 65 |
background: rgba(15, 23, 42, 0.96); /* near indigo-950 */
|
| 66 |
border-radius: 24px;
|
| 67 |
border: 1px solid rgba(148, 163, 184, 0.30); /* slate-400 */
|
| 68 |
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
|
| 69 |
+
padding: 18px 20px;
|
| 70 |
}
|
| 71 |
|
| 72 |
/* Header bar: CMD-BERT left, About CMD-BERT right */
|
|
|
|
| 205 |
def header_html():
|
| 206 |
return gr.HTML(
|
| 207 |
"""
|
| 208 |
+
<div style="max-width:1120px;margin:0 auto;">
|
| 209 |
+
<header class="cmd-header">
|
| 210 |
+
<div class="cmd-header-left">
|
| 211 |
+
<div class="cmd-logo">C</div>
|
| 212 |
+
<div>
|
| 213 |
+
<div class="cmd-title">CMD‑BERT</div>
|
| 214 |
+
<div class="cmd-subtitle">Cebuano Misinformation Detector</div>
|
| 215 |
+
</div>
|
| 216 |
+
</div>
|
| 217 |
+
<div class="cmd-header-right">
|
| 218 |
+
<span>About CMD‑BERT</span>
|
| 219 |
+
<div class="cmd-header-pill"></div>
|
| 220 |
</div>
|
| 221 |
+
</header>
|
| 222 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
"""
|
| 224 |
)
|
| 225 |
|
|
|
|
| 235 |
header_html()
|
| 236 |
gr.HTML(
|
| 237 |
"""
|
| 238 |
+
<section style="margin:0 auto 22px auto; max-width:1120px;">
|
| 239 |
<div class="hero-title">
|
| 240 |
Check Cebuano text for a misleading writing style.
|
| 241 |
</div>
|
|
|
|
| 248 |
"""
|
| 249 |
)
|
| 250 |
|
| 251 |
+
gr.HTML("<div style='max-width:1120px;margin:0 auto;'>")
|
| 252 |
with gr.Row(elem_classes=["two-col"], equal_height=True):
|
| 253 |
# Left: input card
|
| 254 |
with gr.Column(scale=3):
|
|
|
|
| 300 |
"Output: Label and confidence score for the submitted text."
|
| 301 |
"</span>"
|
| 302 |
)
|
| 303 |
+
gr.HTML("</div>")
|
| 304 |
|
| 305 |
def analyze_ui(text):
|
| 306 |
probs = classify(text)
|
|
|
|
| 339 |
# -------- How it works tab --------
|
| 340 |
with gr.Tab("How it works"):
|
| 341 |
header_html()
|
| 342 |
+
gr.HTML("<div style='max-width:1120px;margin:0 auto;'>")
|
| 343 |
with gr.Group(elem_classes=["glass-card"]):
|
| 344 |
gr.Markdown(
|
| 345 |
"## How CMD‑BERT works\n"
|
|
|
|
| 371 |
"- Users are reminded that this is a screening tool only.\n"
|
| 372 |
"- Final judgment should always involve human critical thinking."
|
| 373 |
)
|
| 374 |
+
gr.HTML("</div>")
|
| 375 |
|
| 376 |
# -------- About tab --------
|
| 377 |
with gr.Tab("About"):
|
| 378 |
header_html()
|
| 379 |
+
gr.HTML("<div style='max-width:1120px;margin:0 auto;'>")
|
| 380 |
with gr.Group(elem_classes=["glass-card"]):
|
| 381 |
gr.Markdown(
|
| 382 |
"## About CMD‑BERT\n"
|
|
|
|
| 400 |
"**Adviser:** Engr. Jueco, M.Eng. \n"
|
| 401 |
"January 2026"
|
| 402 |
)
|
| 403 |
+
gr.HTML("</div>")
|
| 404 |
|
| 405 |
# -------- Feedback tab --------
|
| 406 |
with gr.Tab("Feedback"):
|
| 407 |
header_html()
|
| 408 |
+
gr.HTML("<div style='max-width:1120px;margin:0 auto;'>")
|
| 409 |
with gr.Group(elem_classes=["glass-card"]):
|
| 410 |
gr.Markdown(
|
| 411 |
"## Feedback and model improvement\n"
|
|
|
|
| 458 |
inputs=[fb_type, fb_text, fb_email, fb_checkbox],
|
| 459 |
outputs=fb_status,
|
| 460 |
)
|
| 461 |
+
gr.HTML("</div>")
|
| 462 |
|
| 463 |
|
| 464 |
if __name__ == "__main__":
|