Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -431,125 +431,101 @@ div.gradio-group, div.gradio-row, div.gradio-column {
|
|
| 431 |
|
| 432 |
HEADER = """
|
| 433 |
<style>
|
| 434 |
-
@keyframes hb{0%,100%{transform:scale(1)}15%{transform:scale(1.
|
| 435 |
-
@keyframes
|
| 436 |
-
@keyframes pls{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.5;transform:scale(1.3)}}
|
| 437 |
</style>
|
| 438 |
-
<div style="background:linear-gradient(135deg,#
|
| 439 |
-
|
| 440 |
-
<div style="
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
<div style="
|
| 444 |
-
<svg width="32" height="32" viewBox="0 0 100 100">
|
| 445 |
-
<circle cx="50" cy="35" r="28" fill="#0057a8" opacity="0.9"/>
|
| 446 |
-
<ellipse cx="50" cy="14" rx="22" ry="10" fill="#0057a8"/>
|
| 447 |
-
<polygon points="30,14 33,4 36,14" fill="#e8a020"/>
|
| 448 |
-
<polygon points="36,12 39,2 42,12" fill="#e8a020"/>
|
| 449 |
-
<polygon points="42,11 45,1 48,11" fill="#e8a020"/>
|
| 450 |
-
<polygon points="48,11 51,1 54,11" fill="#e8a020"/>
|
| 451 |
-
<polygon points="54,12 57,2 60,12" fill="#e8a020"/>
|
| 452 |
-
<polygon points="60,14 63,4 66,14" fill="#e8a020"/>
|
| 453 |
-
<rect x="36" y="30" width="28" height="22" rx="4" fill="#0057a8"/>
|
| 454 |
-
<rect x="40" y="35" width="8" height="12" rx="2" fill="#e8a020"/>
|
| 455 |
-
<rect x="34" y="50" width="32" height="8" rx="4" fill="#0057a8"/>
|
| 456 |
-
</svg>
|
| 457 |
-
</div>
|
| 458 |
-
<div>
|
| 459 |
-
<div style="color:rgba(232,160,32,0.9);font-size:0.65em;font-weight:600;letter-spacing:3px;text-transform:uppercase;margin-bottom:2px;">San Jose State University</div>
|
| 460 |
-
<div style="color:white;font-size:0.92em;font-weight:700;">Biomedical Engineering</div>
|
| 461 |
-
<div style="color:rgba(255,255,255,0.35);font-size:0.62em;letter-spacing:1px;margin-top:1px;">Dr. Alessandro Bellofiore - CardioLab</div>
|
| 462 |
-
</div>
|
| 463 |
</div>
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
<div style="display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;">
|
| 477 |
-
<span style="background:rgba(193,18,31,0.2);border:1px solid rgba(193,18,31,0.4);color:rgba(255,255,255,0.8);padding:3px 10px;border-radius:20px;font-size:0.62em;font-weight:600;">RAG 16 PAPERS</span>
|
| 478 |
-
<span style="background:rgba(0,87,168,0.2);border:1px solid rgba(0,87,168,0.4);color:rgba(255,255,255,0.8);padding:3px 10px;border-radius:20px;font-size:0.62em;font-weight:600;">FINE-TUNED MODEL</span>
|
| 479 |
-
<span style="background:rgba(232,160,32,0.15);border:1px solid rgba(232,160,32,0.3);color:rgba(255,255,255,0.8);padding:3px 10px;border-radius:20px;font-size:0.62em;font-weight:600;">5 AI MODELS</span>
|
| 480 |
-
<span style="background:rgba(46,204,113,0.15);border:1px solid rgba(46,204,113,0.3);color:rgba(255,255,255,0.8);padding:3px 10px;border-radius:20px;font-size:0.62em;font-weight:600;">$0 COST</span>
|
| 481 |
</div>
|
|
|
|
| 482 |
</div>
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
<
|
| 487 |
-
<
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
<
|
| 494 |
-
|
| 495 |
-
<radialGradient id="hg3" cx="50%" cy="40%">
|
| 496 |
-
<stop offset="0%" stop-color="#e63946"/>
|
| 497 |
-
<stop offset="100%" stop-color="#7d0a11"/>
|
| 498 |
-
</radialGradient>
|
| 499 |
-
</defs>
|
| 500 |
-
<path d="M50 85 C50 85 5 55 5 30 C5 15 18 5 30 5 C38 5 45 9 50 15 C55 9 62 5 70 5 C82 5 95 15 95 30 C95 55 50 85 50 85Z" fill="url(#hg3)" opacity="0.95"/>
|
| 501 |
-
<polyline points="20,48 30,48 36,35 40,60 44,28 48,52 54,48 80,48" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" opacity="0.9"/>
|
| 502 |
-
</svg>
|
| 503 |
-
</div>
|
| 504 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 505 |
</div>
|
| 506 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
</div>
|
|
|
|
| 508 |
"""
|
| 509 |
|
| 510 |
SIDEBAR_HTML = """
|
| 511 |
-
<div style="background:linear-gradient(
|
| 512 |
-
<div style="display:flex;align-items:center;gap:
|
| 513 |
-
<div style="width:6px;height:6px;background:#c1121f;border-radius:50%;
|
| 514 |
-
<
|
| 515 |
</div>
|
| 516 |
-
<div style="color:
|
| 517 |
</div>
|
| 518 |
"""
|
| 519 |
|
| 520 |
STATUS_BANNER = """
|
| 521 |
-
<div style="background:
|
| 522 |
-
<div style="display:flex;align-items:center;gap:
|
| 523 |
-
<div style="width:
|
| 524 |
-
<span style="color:
|
| 525 |
-
<span style="color:rgba(255,255,255,0.6);font-size:0.75em;">417 chunks - 16 SJSU papers</span>
|
| 526 |
</div>
|
| 527 |
-
<div style="
|
| 528 |
-
<div style="display:flex;align-items:center;gap:
|
| 529 |
-
<div style="width:
|
| 530 |
-
<span style="color:
|
| 531 |
</div>
|
| 532 |
-
<div style="
|
| 533 |
-
<div style="display:flex;align-items:center;gap:
|
| 534 |
-
<div style="width:
|
| 535 |
-
<span style="color:
|
| 536 |
</div>
|
| 537 |
</div>
|
| 538 |
"""
|
| 539 |
|
| 540 |
FOOTER_HTML = """
|
| 541 |
-
<div style="text-align:center;padding:
|
| 542 |
-
<
|
| 543 |
-
|
| 544 |
-
<
|
| 545 |
-
<
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
<span style="color:rgba(255,255,255,0.1);">|</span>
|
| 549 |
-
<a href="https://github.com/pranatechsol/Cardio-Lab-Ai" style="color:rgba(0,87,168,0.7);font-size:0.72em;text-decoration:none;">GitHub</a>
|
| 550 |
-
<span style="color:rgba(255,255,255,0.1);">|</span>
|
| 551 |
-
<span style="color:rgba(46,204,113,0.6);font-size:0.72em;font-weight:600;">$0 Cost Forever</span>
|
| 552 |
-
</div>
|
| 553 |
</div>
|
| 554 |
"""
|
| 555 |
|
|
|
|
| 431 |
|
| 432 |
HEADER = """
|
| 433 |
<style>
|
| 434 |
+
@keyframes hb{0%,100%{transform:scale(1)}15%{transform:scale(1.15)}30%{transform:scale(1)}45%{transform:scale(1.08)}60%{transform:scale(1)}}
|
| 435 |
+
@keyframes ecg{from{stroke-dashoffset:500}to{stroke-dashoffset:0}}
|
|
|
|
| 436 |
</style>
|
| 437 |
+
<div style="background:linear-gradient(135deg,#0f172a 0%,#1e0a0a 100%);padding:14px 28px;display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #c1121f;">
|
| 438 |
+
|
| 439 |
+
<div style="display:flex;align-items:center;gap:10px;">
|
| 440 |
+
<div style="background:rgba(0,87,168,0.2);border:1px solid rgba(0,87,168,0.3);border-radius:10px;padding:6px 10px;">
|
| 441 |
+
<div style="color:rgba(232,160,32,0.9);font-size:0.6em;font-weight:600;letter-spacing:2px;text-transform:uppercase;">SJSU</div>
|
| 442 |
+
<div style="color:white;font-size:0.65em;font-weight:600;white-space:nowrap;">Biomedical Eng.</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
</div>
|
| 444 |
+
</div>
|
| 445 |
+
|
| 446 |
+
<div style="display:flex;align-items:center;gap:16px;">
|
| 447 |
+
<svg width="80" height="24" viewBox="0 0 100 24" style="opacity:0.7;">
|
| 448 |
+
<polyline points="0,12 15,12 20,4 24,20 28,2 32,18 36,12 100,12"
|
| 449 |
+
fill="none" stroke="#c1121f" stroke-width="2" stroke-linecap="round"
|
| 450 |
+
stroke-dasharray="500" style="animation:ecg 1.5s ease forwards;"/>
|
| 451 |
+
</svg>
|
| 452 |
+
|
| 453 |
+
<div style="text-align:center;">
|
| 454 |
+
<div style="font-size:1.8em;font-weight:900;letter-spacing:1px;line-height:1.1;">
|
| 455 |
+
<span style="color:white;">Cardio</span><span style="color:#c1121f;">Lab</span><span style="color:white;"> AI</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 456 |
</div>
|
| 457 |
+
<div style="color:rgba(255,255,255,0.4);font-size:0.6em;letter-spacing:2px;text-transform:uppercase;margin-top:2px;">SJSU Biomedical Engineering</div>
|
| 458 |
</div>
|
| 459 |
+
|
| 460 |
+
<div style="animation:hb 1.4s ease infinite;">
|
| 461 |
+
<svg width="36" height="34" viewBox="0 0 100 90">
|
| 462 |
+
<defs>
|
| 463 |
+
<radialGradient id="hg4" cx="50%" cy="35%">
|
| 464 |
+
<stop offset="0%" stop-color="#e63946"/>
|
| 465 |
+
<stop offset="100%" stop-color="#7d0a11"/>
|
| 466 |
+
</radialGradient>
|
| 467 |
+
</defs>
|
| 468 |
+
<path d="M50 85 C50 85 5 55 5 30 C5 15 18 5 30 5 C38 5 45 9 50 15 C55 9 62 5 70 5 C82 5 95 15 95 30 C95 55 50 85 50 85Z" fill="url(#hg4)"/>
|
| 469 |
+
<polyline points="22,45 30,45 34,34 38,56 42,28 46,50 52,45 78,45" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" opacity="0.9"/>
|
| 470 |
+
</svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
</div>
|
| 472 |
+
|
| 473 |
+
<svg width="80" height="24" viewBox="0 0 100 24" style="opacity:0.7;transform:scaleX(-1);">
|
| 474 |
+
<polyline points="0,12 15,12 20,4 24,20 28,2 32,18 36,12 100,12"
|
| 475 |
+
fill="none" stroke="#c1121f" stroke-width="2" stroke-linecap="round"
|
| 476 |
+
stroke-dasharray="500" style="animation:ecg 1.8s ease forwards;"/>
|
| 477 |
+
</svg>
|
| 478 |
</div>
|
| 479 |
+
|
| 480 |
+
<div style="display:flex;flex-direction:column;align-items:flex-end;gap:4px;">
|
| 481 |
+
<div style="display:flex;gap:6px;">
|
| 482 |
+
<span style="background:rgba(46,204,113,0.15);border:1px solid rgba(46,204,113,0.3);color:rgba(255,255,255,0.7);padding:2px 8px;border-radius:20px;font-size:0.6em;font-weight:600;">RAG ON</span>
|
| 483 |
+
<span style="background:rgba(193,18,31,0.15);border:1px solid rgba(193,18,31,0.3);color:rgba(255,255,255,0.7);padding:2px 8px;border-radius:20px;font-size:0.6em;font-weight:600;">5 MODELS</span>
|
| 484 |
+
</div>
|
| 485 |
+
<div style="color:rgba(255,255,255,0.25);font-size:0.58em;">MHV · CKD · FSI</div>
|
| 486 |
+
</div>
|
| 487 |
+
|
| 488 |
</div>
|
| 489 |
+
<div style="height:1px;background:linear-gradient(90deg,transparent,#0057a8,#c1121f,#e8a020,#c1121f,#0057a8,transparent);"></div>
|
| 490 |
"""
|
| 491 |
|
| 492 |
SIDEBAR_HTML = """
|
| 493 |
+
<div style="background:linear-gradient(135deg,#fff5f5,#fef2f2);border:1px solid #fecaca;border-radius:12px;padding:12px;margin-bottom:8px;">
|
| 494 |
+
<div style="display:flex;align-items:center;gap:8px;">
|
| 495 |
+
<div style="width:6px;height:6px;background:#c1121f;border-radius:50%;"></div>
|
| 496 |
+
<span style="color:#c1121f;font-weight:700;font-size:0.8em;letter-spacing:1px;">SJSU CARDIOLAB</span>
|
| 497 |
</div>
|
| 498 |
+
<div style="color:#94a3b8;font-size:0.7em;margin-top:2px;">Conversations</div>
|
| 499 |
</div>
|
| 500 |
"""
|
| 501 |
|
| 502 |
STATUS_BANNER = """
|
| 503 |
+
<div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;margin:6px 0;padding:8px 16px;display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;">
|
| 504 |
+
<div style="display:flex;align-items:center;gap:6px;">
|
| 505 |
+
<div style="width:7px;height:7px;background:#22c55e;border-radius:50%;"></div>
|
| 506 |
+
<span style="color:#15803d;font-size:0.78em;font-weight:600;">RAG Active — 417 chunks from 16 SJSU papers</span>
|
|
|
|
| 507 |
</div>
|
| 508 |
+
<div style="color:#d1fae5;">|</div>
|
| 509 |
+
<div style="display:flex;align-items:center;gap:6px;">
|
| 510 |
+
<div style="width:7px;height:7px;background:#f59e0b;border-radius:50%;"></div>
|
| 511 |
+
<span style="color:#92400e;font-size:0.78em;font-weight:600;">Fine-tuned Model Loaded</span>
|
| 512 |
</div>
|
| 513 |
+
<div style="color:#d1fae5;">|</div>
|
| 514 |
+
<div style="display:flex;align-items:center;gap:6px;">
|
| 515 |
+
<div style="width:7px;height:7px;background:#3b82f6;border-radius:50%;"></div>
|
| 516 |
+
<span style="color:#1e40af;font-size:0.78em;font-weight:600;">5 AI Models Ready</span>
|
| 517 |
</div>
|
| 518 |
</div>
|
| 519 |
"""
|
| 520 |
|
| 521 |
FOOTER_HTML = """
|
| 522 |
+
<div style="text-align:center;padding:12px;border-top:1px solid #e2e8f0;background:#f8fafc;margin-top:8px;">
|
| 523 |
+
<span style="color:#94a3b8;font-size:0.72em;">
|
| 524 |
+
CardioLab AI v39 | SJSU Biomedical Engineering |
|
| 525 |
+
Inspired by <a href="https://github.com/snap-stanford/Biomni" style="color:#c1121f;text-decoration:none;">Biomni Stanford</a> |
|
| 526 |
+
<a href="https://github.com/pranatechsol/Cardio-Lab-Ai" style="color:#0057a8;text-decoration:none;">GitHub</a> |
|
| 527 |
+
Apache 2.0 | $0 Cost
|
| 528 |
+
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
</div>
|
| 530 |
"""
|
| 531 |
|