Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -375,13 +375,20 @@ def adr_predict(x):
|
|
| 375 |
|
| 376 |
# ββ UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 377 |
custom_css = """
|
| 378 |
-
/* ββ Global background ββ */
|
| 379 |
body,
|
| 380 |
.gradio-container,
|
| 381 |
.main,
|
| 382 |
-
.contain
|
| 383 |
-
|
|
|
|
| 384 |
font-family: 'Inter', system-ui, sans-serif !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
}
|
| 386 |
|
| 387 |
/* ββ Uniform white card ββ */
|
|
@@ -390,72 +397,110 @@ body,
|
|
| 390 |
border: 1px solid #e2e6ea !important;
|
| 391 |
border-radius: 12px !important;
|
| 392 |
padding: 20px !important;
|
| 393 |
-
box-shadow: 0 1px 4px rgba(0,0,0,0.
|
| 394 |
-
color: #
|
| 395 |
margin-bottom: 12px !important;
|
| 396 |
}
|
| 397 |
|
| 398 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
.header-card {
|
| 400 |
text-align: center !important;
|
| 401 |
margin-bottom: 18px !important;
|
| 402 |
}
|
| 403 |
|
| 404 |
-
/* ββ Card section label ββ */
|
| 405 |
.card-label {
|
| 406 |
font-size: 0.72em !important;
|
| 407 |
font-weight: 700 !important;
|
| 408 |
letter-spacing: 0.1em !important;
|
| 409 |
text-transform: uppercase !important;
|
| 410 |
-
color: #
|
| 411 |
margin: 0 0 10px 0 !important;
|
| 412 |
padding: 0 !important;
|
|
|
|
| 413 |
}
|
| 414 |
|
| 415 |
-
/* Strip
|
| 416 |
.card > .form,
|
|
|
|
|
|
|
| 417 |
.card [data-testid="label"],
|
| 418 |
.card .label-container,
|
| 419 |
.card .label-wrap,
|
| 420 |
-
.card .prose
|
|
|
|
| 421 |
background: transparent !important;
|
| 422 |
border: none !important;
|
| 423 |
box-shadow: none !important;
|
| 424 |
padding: 0 !important;
|
| 425 |
-
color: #111 !important;
|
| 426 |
}
|
| 427 |
|
| 428 |
-
/* Label bar
|
| 429 |
-
.card .label-wrap
|
| 430 |
-
.card .label-wrap
|
| 431 |
-
.card
|
| 432 |
-
|
|
|
|
| 433 |
}
|
| 434 |
|
| 435 |
-
/* Textbox */
|
| 436 |
.card textarea,
|
| 437 |
-
.card input[type="text"]
|
|
|
|
| 438 |
background: #fafafa !important;
|
| 439 |
-
color: #
|
| 440 |
border: 1px solid #dde1e7 !important;
|
| 441 |
border-radius: 8px !important;
|
| 442 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
|
| 444 |
-
/* Examples table */
|
|
|
|
| 445 |
.card .examples table,
|
| 446 |
.card .examples td,
|
| 447 |
-
.card .examples th
|
|
|
|
| 448 |
background: #ffffff !important;
|
| 449 |
-
color: #
|
| 450 |
border-color: #e2e6ea !important;
|
| 451 |
}
|
| 452 |
|
| 453 |
-
/* Run button
|
| 454 |
.run-btn {
|
| 455 |
width: 100% !important;
|
| 456 |
margin-top: 10px !important;
|
| 457 |
}
|
| 458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 459 |
footer { visibility: hidden; }
|
| 460 |
"""
|
| 461 |
|
|
@@ -535,4 +580,4 @@ with gr.Blocks(title="ADR Detector") as demo:
|
|
| 535 |
outputs=[label, severity_out, shap_out, htext_out],
|
| 536 |
)
|
| 537 |
|
| 538 |
-
demo.launch(theme=gr.themes.
|
|
|
|
| 375 |
|
| 376 |
# ββ UI βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 377 |
custom_css = """
|
| 378 |
+
/* ββ Global: light grey page background, dark text everywhere ββ */
|
| 379 |
body,
|
| 380 |
.gradio-container,
|
| 381 |
.main,
|
| 382 |
+
.contain,
|
| 383 |
+
.gap {
|
| 384 |
+
background-color: #f4f6f9 !important;
|
| 385 |
font-family: 'Inter', system-ui, sans-serif !important;
|
| 386 |
+
color: #111111 !important;
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
/* Force ALL text dark by default */
|
| 390 |
+
*, *::before, *::after {
|
| 391 |
+
color: inherit;
|
| 392 |
}
|
| 393 |
|
| 394 |
/* ββ Uniform white card ββ */
|
|
|
|
| 397 |
border: 1px solid #e2e6ea !important;
|
| 398 |
border-radius: 12px !important;
|
| 399 |
padding: 20px !important;
|
| 400 |
+
box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
|
| 401 |
+
color: #111111 !important;
|
| 402 |
margin-bottom: 12px !important;
|
| 403 |
}
|
| 404 |
|
| 405 |
+
/* Every text node inside a card */
|
| 406 |
+
.card *,
|
| 407 |
+
.card p,
|
| 408 |
+
.card span,
|
| 409 |
+
.card div,
|
| 410 |
+
.card label,
|
| 411 |
+
.card h1, .card h2, .card h3,
|
| 412 |
+
.card td, .card th,
|
| 413 |
+
.card button:not(.primary) {
|
| 414 |
+
color: #111111 !important;
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
/* Header card */
|
| 418 |
.header-card {
|
| 419 |
text-align: center !important;
|
| 420 |
margin-bottom: 18px !important;
|
| 421 |
}
|
| 422 |
|
| 423 |
+
/* ββ Card section label (uppercase caption) ββ */
|
| 424 |
.card-label {
|
| 425 |
font-size: 0.72em !important;
|
| 426 |
font-weight: 700 !important;
|
| 427 |
letter-spacing: 0.1em !important;
|
| 428 |
text-transform: uppercase !important;
|
| 429 |
+
color: #777777 !important;
|
| 430 |
margin: 0 0 10px 0 !important;
|
| 431 |
padding: 0 !important;
|
| 432 |
+
display: block !important;
|
| 433 |
}
|
| 434 |
|
| 435 |
+
/* Strip double borders / backgrounds from inner Gradio wrappers */
|
| 436 |
.card > .form,
|
| 437 |
+
.card > .block,
|
| 438 |
+
.card .wrap,
|
| 439 |
.card [data-testid="label"],
|
| 440 |
.card .label-container,
|
| 441 |
.card .label-wrap,
|
| 442 |
+
.card .prose,
|
| 443 |
+
.card .md {
|
| 444 |
background: transparent !important;
|
| 445 |
border: none !important;
|
| 446 |
box-shadow: none !important;
|
| 447 |
padding: 0 !important;
|
|
|
|
| 448 |
}
|
| 449 |
|
| 450 |
+
/* ββ Gradio Label (probability bar) ββ */
|
| 451 |
+
.card .label-wrap,
|
| 452 |
+
.card .label-wrap *,
|
| 453 |
+
.card [data-testid="label"] * {
|
| 454 |
+
background: transparent !important;
|
| 455 |
+
color: #111111 !important;
|
| 456 |
}
|
| 457 |
|
| 458 |
+
/* ββ Textbox ββ */
|
| 459 |
.card textarea,
|
| 460 |
+
.card input[type="text"],
|
| 461 |
+
.card input {
|
| 462 |
background: #fafafa !important;
|
| 463 |
+
color: #111111 !important;
|
| 464 |
border: 1px solid #dde1e7 !important;
|
| 465 |
border-radius: 8px !important;
|
| 466 |
}
|
| 467 |
+
.card textarea::placeholder,
|
| 468 |
+
.card input::placeholder {
|
| 469 |
+
color: #999999 !important;
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
/* ββ Textbox label text ββ */
|
| 473 |
+
.card .svelte-1f354aw,
|
| 474 |
+
.card label > span {
|
| 475 |
+
color: #333333 !important;
|
| 476 |
+
font-weight: 600 !important;
|
| 477 |
+
}
|
| 478 |
|
| 479 |
+
/* ββ Examples table ββ */
|
| 480 |
+
.card .examples,
|
| 481 |
.card .examples table,
|
| 482 |
.card .examples td,
|
| 483 |
+
.card .examples th,
|
| 484 |
+
.card .examples button {
|
| 485 |
background: #ffffff !important;
|
| 486 |
+
color: #111111 !important;
|
| 487 |
border-color: #e2e6ea !important;
|
| 488 |
}
|
| 489 |
|
| 490 |
+
/* ββ Run button ββ */
|
| 491 |
.run-btn {
|
| 492 |
width: 100% !important;
|
| 493 |
margin-top: 10px !important;
|
| 494 |
}
|
| 495 |
|
| 496 |
+
/* ββ Processing spinner area ββ */
|
| 497 |
+
.card .generating,
|
| 498 |
+
.card .eta-bar,
|
| 499 |
+
.card .progress-bar {
|
| 500 |
+
background: #f0f0f0 !important;
|
| 501 |
+
color: #555555 !important;
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
footer { visibility: hidden; }
|
| 505 |
"""
|
| 506 |
|
|
|
|
| 580 |
outputs=[label, severity_out, shap_out, htext_out],
|
| 581 |
)
|
| 582 |
|
| 583 |
+
demo.launch(theme=gr.themes.Default(), css=custom_css)
|