Benedikt Droste Claude Opus 4.5 commited on
Commit ·
ff04b9d
1
Parent(s): 7149ea7
Simplify styling to match reference app
Browse files- Remove unused elem_classes from columns and summary output
- Simplify CSS by removing unused classes
- Pass theme/css to launch() for Gradio 6.0 compatibility
- Rely on Gradio's default .prose class for Markdown styling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -470,42 +470,11 @@ CSS = """
|
|
| 470 |
color: var(--body-text-color);
|
| 471 |
}
|
| 472 |
|
| 473 |
-
.main-header p {
|
| 474 |
-
color: var(--body-text-color-subdued);
|
| 475 |
-
font-size: 0.95rem;
|
| 476 |
-
margin: 0;
|
| 477 |
-
}
|
| 478 |
-
|
| 479 |
/* Section headers */
|
| 480 |
.section-title {
|
| 481 |
margin-bottom: 1rem !important;
|
| 482 |
border-bottom: 1px solid var(--border-color-primary);
|
| 483 |
padding-bottom: 0.5rem;
|
| 484 |
-
padding-left: 4px !important;
|
| 485 |
-
}
|
| 486 |
-
|
| 487 |
-
.section-title h3 {
|
| 488 |
-
color: var(--body-text-color) !important;
|
| 489 |
-
font-size: 0.875rem !important;
|
| 490 |
-
font-weight: 600 !important;
|
| 491 |
-
margin: 0 !important;
|
| 492 |
-
}
|
| 493 |
-
|
| 494 |
-
/* Output panels */
|
| 495 |
-
.output-panel {
|
| 496 |
-
background: var(--block-background-fill) !important;
|
| 497 |
-
border-radius: 0.75rem !important;
|
| 498 |
-
border: 1px solid var(--border-color-primary) !important;
|
| 499 |
-
padding: 1.5rem !important;
|
| 500 |
-
min-height: 400px;
|
| 501 |
-
}
|
| 502 |
-
|
| 503 |
-
/* Summary output */
|
| 504 |
-
.summary-text {
|
| 505 |
-
font-size: 1.05rem !important;
|
| 506 |
-
line-height: 1.8 !important;
|
| 507 |
-
color: var(--body-text-color) !important;
|
| 508 |
-
background: transparent !important;
|
| 509 |
}
|
| 510 |
|
| 511 |
/* Thinking/Reasoning section - Light mode */
|
|
@@ -532,47 +501,15 @@ CSS = """
|
|
| 532 |
}
|
| 533 |
|
| 534 |
/* Summary text - Dark mode */
|
| 535 |
-
.dark .summary-text,
|
| 536 |
.dark .prose {
|
| 537 |
color: #f1f5f9 !important;
|
| 538 |
}
|
| 539 |
|
| 540 |
-
/* Summary divider */
|
| 541 |
-
.summary-divider {
|
| 542 |
-
height: 1px;
|
| 543 |
-
background: var(--border-color-primary);
|
| 544 |
-
margin: 1.25rem 0;
|
| 545 |
-
}
|
| 546 |
-
|
| 547 |
-
/* Summary section */
|
| 548 |
-
.summary-section {
|
| 549 |
-
padding-top: 0.5rem;
|
| 550 |
-
}
|
| 551 |
-
|
| 552 |
/* Sources panel */
|
| 553 |
.sources-panel {
|
| 554 |
font-size: 0.9rem !important;
|
| 555 |
max-height: 400px;
|
| 556 |
overflow-y: auto;
|
| 557 |
-
color: var(--body-text-color) !important;
|
| 558 |
-
}
|
| 559 |
-
|
| 560 |
-
.sources-panel p {
|
| 561 |
-
color: var(--body-text-color) !important;
|
| 562 |
-
margin-bottom: 0.5rem !important;
|
| 563 |
-
padding: 0.5rem 0 !important;
|
| 564 |
-
border-bottom: 1px solid var(--border-color-primary) !important;
|
| 565 |
-
line-height: 1.5 !important;
|
| 566 |
-
}
|
| 567 |
-
|
| 568 |
-
.sources-panel p:last-child {
|
| 569 |
-
border-bottom: none !important;
|
| 570 |
-
margin-bottom: 0 !important;
|
| 571 |
-
}
|
| 572 |
-
|
| 573 |
-
.sources-panel strong {
|
| 574 |
-
color: var(--body-text-color) !important;
|
| 575 |
-
font-weight: 600 !important;
|
| 576 |
}
|
| 577 |
|
| 578 |
/* Generate button */
|
|
@@ -589,51 +526,6 @@ CSS = """
|
|
| 589 |
font-size: 0.85rem;
|
| 590 |
opacity: 0.6;
|
| 591 |
}
|
| 592 |
-
|
| 593 |
-
.footer a {
|
| 594 |
-
color: var(--body-text-color);
|
| 595 |
-
text-decoration: none;
|
| 596 |
-
transition: color 0.15s ease;
|
| 597 |
-
}
|
| 598 |
-
|
| 599 |
-
.footer a:hover {
|
| 600 |
-
opacity: 0.8;
|
| 601 |
-
}
|
| 602 |
-
|
| 603 |
-
.footer-divider {
|
| 604 |
-
color: var(--border-color-primary);
|
| 605 |
-
margin: 0 0.5rem;
|
| 606 |
-
}
|
| 607 |
-
|
| 608 |
-
/* Hide default footer */
|
| 609 |
-
footer {
|
| 610 |
-
display: none !important;
|
| 611 |
-
}
|
| 612 |
-
|
| 613 |
-
/* Responsive adjustments */
|
| 614 |
-
@media (max-width: 768px) {
|
| 615 |
-
.gradio-container {
|
| 616 |
-
padding: 1rem !important;
|
| 617 |
-
}
|
| 618 |
-
|
| 619 |
-
.main-header h1 {
|
| 620 |
-
font-size: 1.5rem;
|
| 621 |
-
}
|
| 622 |
-
}
|
| 623 |
-
|
| 624 |
-
/* Smooth scrollbar for sources */
|
| 625 |
-
.sources-panel::-webkit-scrollbar {
|
| 626 |
-
width: 4px;
|
| 627 |
-
}
|
| 628 |
-
|
| 629 |
-
.sources-panel::-webkit-scrollbar-track {
|
| 630 |
-
background: var(--block-background-fill);
|
| 631 |
-
}
|
| 632 |
-
|
| 633 |
-
.sources-panel::-webkit-scrollbar-thumb {
|
| 634 |
-
background: var(--border-color-primary);
|
| 635 |
-
border-radius: 2px;
|
| 636 |
-
}
|
| 637 |
"""
|
| 638 |
|
| 639 |
|
|
@@ -643,7 +535,7 @@ footer {
|
|
| 643 |
|
| 644 |
def create_app() -> gr.Blocks:
|
| 645 |
"""Create the Gradio application."""
|
| 646 |
-
with gr.Blocks(title="sui-1-24b"
|
| 647 |
|
| 648 |
# Header
|
| 649 |
gr.HTML("""
|
|
@@ -654,8 +546,8 @@ def create_app() -> gr.Blocks:
|
|
| 654 |
""")
|
| 655 |
|
| 656 |
with gr.Row(equal_height=False):
|
| 657 |
-
# Left column: Inputs
|
| 658 |
-
with gr.Column(scale=2
|
| 659 |
gr.Markdown("### Document", elem_classes=["section-title"])
|
| 660 |
|
| 661 |
pdf_input = gr.File(
|
|
@@ -690,17 +582,15 @@ def create_app() -> gr.Blocks:
|
|
| 690 |
generate_btn = gr.Button(
|
| 691 |
"Generate Summary",
|
| 692 |
variant="primary",
|
| 693 |
-
size="lg",
|
| 694 |
elem_classes=["generate-btn"],
|
| 695 |
)
|
| 696 |
|
| 697 |
-
# Right column: Output
|
| 698 |
-
with gr.Column(scale=3
|
| 699 |
gr.Markdown("### Summary", elem_classes=["section-title"])
|
| 700 |
|
| 701 |
summary_output = gr.Markdown(
|
| 702 |
-
value="*Upload a PDF
|
| 703 |
-
elem_classes=["summary-text"],
|
| 704 |
)
|
| 705 |
|
| 706 |
with gr.Accordion(
|
|
@@ -735,4 +625,4 @@ def create_app() -> gr.Blocks:
|
|
| 735 |
|
| 736 |
if __name__ == "__main__":
|
| 737 |
app = create_app()
|
| 738 |
-
app.launch()
|
|
|
|
| 470 |
color: var(--body-text-color);
|
| 471 |
}
|
| 472 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 473 |
/* Section headers */
|
| 474 |
.section-title {
|
| 475 |
margin-bottom: 1rem !important;
|
| 476 |
border-bottom: 1px solid var(--border-color-primary);
|
| 477 |
padding-bottom: 0.5rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
}
|
| 479 |
|
| 480 |
/* Thinking/Reasoning section - Light mode */
|
|
|
|
| 501 |
}
|
| 502 |
|
| 503 |
/* Summary text - Dark mode */
|
|
|
|
| 504 |
.dark .prose {
|
| 505 |
color: #f1f5f9 !important;
|
| 506 |
}
|
| 507 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 508 |
/* Sources panel */
|
| 509 |
.sources-panel {
|
| 510 |
font-size: 0.9rem !important;
|
| 511 |
max-height: 400px;
|
| 512 |
overflow-y: auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 513 |
}
|
| 514 |
|
| 515 |
/* Generate button */
|
|
|
|
| 526 |
font-size: 0.85rem;
|
| 527 |
opacity: 0.6;
|
| 528 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
"""
|
| 530 |
|
| 531 |
|
|
|
|
| 535 |
|
| 536 |
def create_app() -> gr.Blocks:
|
| 537 |
"""Create the Gradio application."""
|
| 538 |
+
with gr.Blocks(title="sui-1-24b") as app:
|
| 539 |
|
| 540 |
# Header
|
| 541 |
gr.HTML("""
|
|
|
|
| 546 |
""")
|
| 547 |
|
| 548 |
with gr.Row(equal_height=False):
|
| 549 |
+
# Left column: Inputs
|
| 550 |
+
with gr.Column(scale=2):
|
| 551 |
gr.Markdown("### Document", elem_classes=["section-title"])
|
| 552 |
|
| 553 |
pdf_input = gr.File(
|
|
|
|
| 582 |
generate_btn = gr.Button(
|
| 583 |
"Generate Summary",
|
| 584 |
variant="primary",
|
|
|
|
| 585 |
elem_classes=["generate-btn"],
|
| 586 |
)
|
| 587 |
|
| 588 |
+
# Right column: Output
|
| 589 |
+
with gr.Column(scale=3):
|
| 590 |
gr.Markdown("### Summary", elem_classes=["section-title"])
|
| 591 |
|
| 592 |
summary_output = gr.Markdown(
|
| 593 |
+
value="*Upload a PDF to begin.*",
|
|
|
|
| 594 |
)
|
| 595 |
|
| 596 |
with gr.Accordion(
|
|
|
|
| 625 |
|
| 626 |
if __name__ == "__main__":
|
| 627 |
app = create_app()
|
| 628 |
+
app.launch(theme=THEME, css=CSS)
|