Saicharan21 commited on
Commit
1cb580d
·
verified ·
1 Parent(s): 938301f

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +73 -97
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.18)}30%{transform:scale(1)}45%{transform:scale(1.12)}60%{transform:scale(1)}}
435
- @keyframes ecgDraw{from{stroke-dashoffset:800}to{stroke-dashoffset:0}}
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,#0a0f1e 0%,#0d0508 50%,#0a0f1e 100%);border-bottom:1px solid rgba(193,18,31,0.3);overflow:hidden;padding:0;">
439
- <div style="position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(193,18,31,0.04) 1px,transparent 1px),linear-gradient(90deg,rgba(193,18,31,0.04) 1px,transparent 1px);background-size:40px 40px;pointer-events:none;"></div>
440
- <div style="position:absolute;top:-50%;left:-10%;width:400px;height:400px;background:radial-gradient(circle,rgba(193,18,31,0.08) 0%,transparent 70%);pointer-events:none;"></div>
441
- <div style="max-width:1400px;margin:0 auto;padding:18px 28px;display:flex;align-items:center;justify-content:space-between;">
442
- <div style="display:flex;align-items:center;gap:16px;">
443
- <div style="width:52px;height:52px;background:linear-gradient(135deg,rgba(0,87,168,0.3),rgba(0,87,168,0.1));border:1px solid rgba(0,87,168,0.4);border-radius:14px;display:flex;align-items:center;justify-content:center;box-shadow:0 0 20px rgba(0,87,168,0.25);">
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
- <div style="text-align:center;flex:1;padding:0 30px;">
465
- <div style="display:flex;align-items:center;justify-content:center;gap:14px;margin-bottom:6px;">
466
- <svg width="110" height="30" viewBox="0 0 140 30" style="opacity:0.8;">
467
- <polyline points="0,15 25,15 32,15 38,3 42,27 46,1 50,25 56,15 140,15" fill="none" stroke="#c1121f" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="800" style="animation:ecgDraw 2s ease forwards;"/>
468
- </svg>
469
- <div style="font-size:2.4em;font-weight:900;letter-spacing:1px;line-height:1;">
470
- <span style="color:white;">Cardio</span><span style="color:#c1121f;">Lab</span><span style="color:white;"> AI</span>
471
- </div>
472
- <svg width="110" height="30" viewBox="0 0 140 30" style="opacity:0.8;transform:scaleX(-1);">
473
- <polyline points="0,15 25,15 32,15 38,3 42,27 46,1 50,25 56,15 140,15" fill="none" stroke="#c1121f" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="800" style="animation:ecgDraw 2.3s ease forwards;"/>
474
- </svg>
475
- </div>
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
- <div style="display:flex;align-items:center;gap:18px;">
484
- <div style="text-align:right;">
485
- <div style="color:rgba(255,255,255,0.35);font-size:0.62em;letter-spacing:2px;text-transform:uppercase;margin-bottom:6px;">Research Pillars</div>
486
- <div style="display:flex;flex-direction:column;gap:4px;align-items:flex-end;">
487
- <span style="background:rgba(193,18,31,0.15);border:1px solid rgba(193,18,31,0.2);color:rgba(255,255,255,0.7);padding:2px 10px;border-radius:6px;font-size:0.65em;">MHV - MCL PIV TGT</span>
488
- <span style="background:rgba(0,87,168,0.15);border:1px solid rgba(0,87,168,0.2);color:rgba(255,255,255,0.7);padding:2px 10px;border-radius:6px;font-size:0.65em;">CKD - uPAD Jaffe</span>
489
- <span style="background:rgba(232,160,32,0.1);border:1px solid rgba(232,160,32,0.2);color:rgba(255,255,255,0.7);padding:2px 10px;border-radius:6px;font-size:0.65em;">FSI - COMSOL</span>
490
- </div>
491
- </div>
492
- <div style="animation:hb 1.5s ease infinite;">
493
- <svg width="52" height="48" viewBox="0 0 100 90">
494
- <defs>
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
- <div style="height:2px;background:linear-gradient(90deg,transparent,#0057a8,#c1121f,#e8a020,#c1121f,#0057a8,transparent);"></div>
 
 
 
 
 
 
 
 
507
  </div>
 
508
  """
509
 
510
  SIDEBAR_HTML = """
511
- <div style="background:linear-gradient(180deg,rgba(193,18,31,0.15) 0%,rgba(0,87,168,0.1) 100%);border:1px solid rgba(193,18,31,0.25);border-radius:16px;padding:14px;margin-bottom:10px;backdrop-filter:blur(20px);">
512
- <div style="display:flex;align-items:center;gap:10px;margin-bottom:4px;">
513
- <div style="width:6px;height:6px;background:#c1121f;border-radius:50%;box-shadow:0 0 6px #c1121f;animation:pls 2s infinite;"></div>
514
- <div style="color:rgba(232,160,32,0.9);font-weight:700;font-size:0.82em;letter-spacing:2px;text-transform:uppercase;">SJSU CardioLab</div>
515
  </div>
516
- <div style="color:rgba(255,255,255,0.35);font-size:0.68em;letter-spacing:1px;">Conversations</div>
517
  </div>
518
  """
519
 
520
  STATUS_BANNER = """
521
- <div style="background:linear-gradient(135deg,rgba(26,115,64,0.9),rgba(21,87,49,0.9));backdrop-filter:blur(20px);border:1px solid rgba(46,204,113,0.3);border-radius:12px;margin:8px 0;padding:10px 20px;display:flex;align-items:center;justify-content:center;gap:20px;flex-wrap:wrap;box-shadow:0 4px 20px rgba(46,204,113,0.15);">
522
- <div style="display:flex;align-items:center;gap:8px;">
523
- <div style="width:8px;height:8px;background:#2ecc71;border-radius:50%;box-shadow:0 0 8px #2ecc71;animation:pls 2s infinite;"></div>
524
- <span style="color:white;font-size:0.8em;font-weight:600;">RAG ACTIVE</span>
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="width:1px;height:20px;background:rgba(255,255,255,0.2);"></div>
528
- <div style="display:flex;align-items:center;gap:8px;">
529
- <div style="width:8px;height:8px;background:#e8a020;border-radius:50%;box-shadow:0 0 8px #e8a020;animation:pls 2s 0.5s infinite;"></div>
530
- <span style="color:white;font-size:0.8em;font-weight:600;">FINE-TUNED MODEL LOADED</span>
531
  </div>
532
- <div style="width:1px;height:20px;background:rgba(255,255,255,0.2);"></div>
533
- <div style="display:flex;align-items:center;gap:8px;">
534
- <div style="width:8px;height:8px;background:#0057a8;border-radius:50%;box-shadow:0 0 8px #0057a8;animation:pls 2s 1s infinite;"></div>
535
- <span style="color:white;font-size:0.8em;font-weight:600;">5 AI MODELS READY</span>
536
  </div>
537
  </div>
538
  """
539
 
540
  FOOTER_HTML = """
541
- <div style="text-align:center;padding:16px;margin-top:12px;border-top:1px solid rgba(255,255,255,0.06);background:rgba(255,255,255,0.02);border-radius:0 0 16px 16px;">
542
- <div style="display:flex;align-items:center;justify-content:center;gap:20px;flex-wrap:wrap;">
543
- <span style="color:rgba(255,255,255,0.3);font-size:0.72em;">CardioLab AI v39</span>
544
- <span style="color:rgba(255,255,255,0.1);">|</span>
545
- <span style="color:rgba(255,255,255,0.3);font-size:0.72em;">SJSU Biomedical Engineering</span>
546
- <span style="color:rgba(255,255,255,0.1);">|</span>
547
- <a href="https://github.com/snap-stanford/Biomni" style="color:rgba(193,18,31,0.7);font-size:0.72em;text-decoration:none;">Inspired by Biomni Stanford</a>
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