Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -235,74 +235,6 @@ label, .gr-input-label { color: #94a3b8 !important; }
|
|
| 235 |
padding: 12px; border-top: 1px solid #1e293b;
|
| 236 |
}
|
| 237 |
|
| 238 |
-
/* Landing Page */
|
| 239 |
-
.landing-page {
|
| 240 |
-
display: flex;
|
| 241 |
-
flex-direction: column;
|
| 242 |
-
align-items: center;
|
| 243 |
-
justify-content: center;
|
| 244 |
-
min-height: 80vh;
|
| 245 |
-
text-align: center;
|
| 246 |
-
background: radial-gradient(circle at center, rgba(14, 165, 233, 0.08) 0%, transparent 60%);
|
| 247 |
-
border-radius: 24px;
|
| 248 |
-
padding: 40px;
|
| 249 |
-
}
|
| 250 |
-
.hero-title {
|
| 251 |
-
font-family: 'Figtree', sans-serif;
|
| 252 |
-
font-size: 3.8rem;
|
| 253 |
-
font-weight: 800;
|
| 254 |
-
color: #f8fafc;
|
| 255 |
-
margin-bottom: 16px;
|
| 256 |
-
letter-spacing: -0.03em;
|
| 257 |
-
background: linear-gradient(135deg, #e0f2fe 0%, #38bdf8 100%);
|
| 258 |
-
-webkit-background-clip: text;
|
| 259 |
-
-webkit-text-fill-color: transparent;
|
| 260 |
-
}
|
| 261 |
-
.hero-subtitle {
|
| 262 |
-
font-size: 1.25rem;
|
| 263 |
-
color: #94a3b8;
|
| 264 |
-
max-width: 650px;
|
| 265 |
-
margin: 0 auto 32px auto;
|
| 266 |
-
line-height: 1.6;
|
| 267 |
-
}
|
| 268 |
-
.btn-launch {
|
| 269 |
-
background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
|
| 270 |
-
border: none !important; color: #fff !important;
|
| 271 |
-
font-size: 1.15rem !important; font-weight: 600 !important;
|
| 272 |
-
padding: 16px 42px !important; border-radius: 12px !important;
|
| 273 |
-
cursor: pointer !important;
|
| 274 |
-
transition: all 0.2s ease-out !important;
|
| 275 |
-
box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3) !important;
|
| 276 |
-
}
|
| 277 |
-
.btn-launch:hover {
|
| 278 |
-
transform: translateY(-2px) !important;
|
| 279 |
-
box-shadow: 0 12px 32px rgba(14, 165, 233, 0.4) !important;
|
| 280 |
-
}
|
| 281 |
-
.features-grid {
|
| 282 |
-
display: flex;
|
| 283 |
-
gap: 24px;
|
| 284 |
-
margin-top: 56px;
|
| 285 |
-
justify-content: center;
|
| 286 |
-
flex-wrap: wrap;
|
| 287 |
-
}
|
| 288 |
-
.feature-card {
|
| 289 |
-
background: rgba(30, 41, 59, 0.6);
|
| 290 |
-
border: 1px solid rgba(51, 65, 85, 0.5);
|
| 291 |
-
border-radius: 16px;
|
| 292 |
-
padding: 24px;
|
| 293 |
-
width: 280px;
|
| 294 |
-
text-align: left;
|
| 295 |
-
backdrop-filter: blur(12px);
|
| 296 |
-
transition: transform 0.2s ease, border-color 0.2s ease;
|
| 297 |
-
}
|
| 298 |
-
.feature-card:hover {
|
| 299 |
-
transform: translateY(-4px);
|
| 300 |
-
border-color: rgba(14, 165, 233, 0.4);
|
| 301 |
-
}
|
| 302 |
-
.feature-icon { font-size: 2rem; margin-bottom: 14px; }
|
| 303 |
-
.feature-title { color: #f1f5f9; font-weight: 600; margin-bottom: 8px; font-size: 1.1rem; }
|
| 304 |
-
.feature-desc { color: #64748b; font-size: 0.88rem; line-height: 1.5; }
|
| 305 |
-
|
| 306 |
/* Reduced motion */
|
| 307 |
@media (prefers-reduced-motion: reduce) {
|
| 308 |
*, *::before, *::after {
|
|
@@ -630,86 +562,45 @@ with gr.Blocks(
|
|
| 630 |
title="OncoAgent β Oncology Triage Demo",
|
| 631 |
theme=gr.themes.Base(),
|
| 632 |
) as demo:
|
| 633 |
-
#
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
<div class="feature-card">
|
| 648 |
-
<div class="feature-icon">π</div>
|
| 649 |
-
<div class="feature-title">Corrective RAG</div>
|
| 650 |
-
<div class="feature-desc">Grounded in 170+ NCCN & ESMO guidelines with distance-gating to prevent hallucinations.</div>
|
| 651 |
-
</div>
|
| 652 |
-
<div class="feature-card">
|
| 653 |
-
<div class="feature-icon">π§ </div>
|
| 654 |
-
<div class="feature-title">Multi-Agent Reasoning</div>
|
| 655 |
-
<div class="feature-desc">Tiered architecture (Qwen3.5-9B Router + Qwen3.6-27B Specialist) for complex clinical analysis.</div>
|
| 656 |
-
</div>
|
| 657 |
-
<div class="feature-card">
|
| 658 |
-
<div class="feature-icon">π‘οΈ</div>
|
| 659 |
-
<div class="feature-title">Clinical Safety</div>
|
| 660 |
-
<div class="feature-desc">Reflexion loops validate outputs against strict medical criteria before clinician review.</div>
|
| 661 |
-
</div>
|
| 662 |
-
</div>
|
| 663 |
-
""")
|
| 664 |
-
|
| 665 |
-
# ββ Main App ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 666 |
-
with gr.Column(visible=False) as app_page:
|
| 667 |
-
# Header
|
| 668 |
-
gr.HTML(HEADER_HTML)
|
| 669 |
-
gr.HTML(INFO_HTML)
|
| 670 |
-
|
| 671 |
-
# Chat
|
| 672 |
-
chatbot = gr.Chatbot(
|
| 673 |
-
type="messages",
|
| 674 |
-
label="Clinical Triage Chat",
|
| 675 |
-
height=520,
|
| 676 |
-
show_label=False,
|
| 677 |
-
show_copy_button=True,
|
| 678 |
-
render_markdown=True,
|
| 679 |
-
elem_classes=["card"],
|
| 680 |
-
)
|
| 681 |
-
|
| 682 |
-
# Controls
|
| 683 |
-
with gr.Row():
|
| 684 |
-
with gr.Column(scale=3):
|
| 685 |
-
txt = gr.Textbox(
|
| 686 |
-
placeholder="Enter a clinical case or click 'βΆ View Demo'...",
|
| 687 |
-
show_label=False,
|
| 688 |
-
lines=2,
|
| 689 |
-
max_lines=5,
|
| 690 |
-
)
|
| 691 |
-
with gr.Column(scale=1, min_width=180):
|
| 692 |
-
demo_btn = gr.Button(
|
| 693 |
-
"βΆ View Demo",
|
| 694 |
-
elem_classes=["btn-demo"],
|
| 695 |
-
size="lg",
|
| 696 |
-
)
|
| 697 |
-
|
| 698 |
-
with gr.Row():
|
| 699 |
-
send_btn = gr.Button("Send", elem_classes=["btn-primary"], size="sm")
|
| 700 |
-
clear_btn = gr.Button("π Clear", variant="secondary", size="sm")
|
| 701 |
-
|
| 702 |
-
# Footer
|
| 703 |
-
gr.HTML(FOOTER_HTML)
|
| 704 |
|
| 705 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 706 |
|
| 707 |
-
#
|
| 708 |
-
launch_btn.click(
|
| 709 |
-
fn=lambda: [gr.update(visible=False), gr.update(visible=True)],
|
| 710 |
-
inputs=None,
|
| 711 |
-
outputs=[landing_page, app_page],
|
| 712 |
-
)
|
| 713 |
|
| 714 |
demo_btn.click(
|
| 715 |
fn=run_demo,
|
|
|
|
| 235 |
padding: 12px; border-top: 1px solid #1e293b;
|
| 236 |
}
|
| 237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
/* Reduced motion */
|
| 239 |
@media (prefers-reduced-motion: reduce) {
|
| 240 |
*, *::before, *::after {
|
|
|
|
| 562 |
title="OncoAgent β Oncology Triage Demo",
|
| 563 |
theme=gr.themes.Base(),
|
| 564 |
) as demo:
|
| 565 |
+
# Header
|
| 566 |
+
gr.HTML(HEADER_HTML)
|
| 567 |
+
gr.HTML(INFO_HTML)
|
| 568 |
+
|
| 569 |
+
# Chat
|
| 570 |
+
chatbot = gr.Chatbot(
|
| 571 |
+
type="messages",
|
| 572 |
+
label="Clinical Triage Chat",
|
| 573 |
+
height=520,
|
| 574 |
+
show_label=False,
|
| 575 |
+
show_copy_button=True,
|
| 576 |
+
render_markdown=True,
|
| 577 |
+
elem_classes=["card"],
|
| 578 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 579 |
|
| 580 |
+
# Controls
|
| 581 |
+
with gr.Row():
|
| 582 |
+
with gr.Column(scale=3):
|
| 583 |
+
txt = gr.Textbox(
|
| 584 |
+
placeholder="Enter a clinical case or click 'βΆ View Demo'...",
|
| 585 |
+
show_label=False,
|
| 586 |
+
lines=2,
|
| 587 |
+
max_lines=5,
|
| 588 |
+
)
|
| 589 |
+
with gr.Column(scale=1, min_width=180):
|
| 590 |
+
demo_btn = gr.Button(
|
| 591 |
+
"βΆ View Demo",
|
| 592 |
+
elem_classes=["btn-demo"],
|
| 593 |
+
size="lg",
|
| 594 |
+
)
|
| 595 |
+
|
| 596 |
+
with gr.Row():
|
| 597 |
+
send_btn = gr.Button("Send", elem_classes=["btn-primary"], size="sm")
|
| 598 |
+
clear_btn = gr.Button("π Clear", variant="secondary", size="sm")
|
| 599 |
+
|
| 600 |
+
# Footer
|
| 601 |
+
gr.HTML(FOOTER_HTML)
|
| 602 |
|
| 603 |
+
# ββ Event Handlers ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
|
| 605 |
demo_btn.click(
|
| 606 |
fn=run_demo,
|