Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -161,28 +161,28 @@ def _result_card(best, best_txt, ranked_lbl, ranked_idx, probs, options, model_r
|
|
| 161 |
pct = probs[i] * 100
|
| 162 |
col = colors[r % len(colors)]
|
| 163 |
rows += f"""
|
| 164 |
-
<div style="display:flex;align-items:center;gap:
|
| 165 |
background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);
|
| 166 |
border-radius:10px;">
|
| 167 |
-
<span style="font-family:'JetBrains Mono',monospace;font-size:
|
| 168 |
-
font-weight:700;width:
|
| 169 |
-
<span style="width:
|
| 170 |
border:1px solid {col}88;display:flex;align-items:center;justify-content:center;
|
| 171 |
-
font-weight:900;color:{col};font-size:
|
| 172 |
-
<div style="flex:1;background:#0d1424;border-radius:6px;height:
|
| 173 |
overflow:hidden;border:1px solid rgba(255,255,255,0.08);">
|
| 174 |
<div style="width:{pct:.1f}%;background:linear-gradient(90deg,{col}dd,{col}66);
|
| 175 |
height:100%;border-radius:6px;display:flex;align-items:center;
|
| 176 |
-
padding-left:
|
| 177 |
-
<span style="color:#ffffff;font-size:
|
| 178 |
font-family:'JetBrains Mono',monospace;white-space:nowrap;
|
| 179 |
text-shadow:0 1px 2px rgba(0,0,0,0.8);">{pct:.1f}%</span>
|
| 180 |
</div>
|
| 181 |
</div>
|
| 182 |
-
<span style="color:#
|
| 183 |
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
|
| 184 |
-
font-family:'Inter',sans-serif;font-weight:
|
| 185 |
-
{options[i]
|
| 186 |
</span>
|
| 187 |
</div>"""
|
| 188 |
|
|
@@ -200,10 +200,10 @@ def _result_card(best, best_txt, ranked_lbl, ranked_idx, probs, options, model_r
|
|
| 200 |
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;">
|
| 201 |
<div style="font-size:11px;font-family:'JetBrains Mono',monospace;color:#94a3b8;
|
| 202 |
font-weight:700;letter-spacing:2px;text-transform:uppercase;">
|
| 203 |
-
MODEL PREDICTION
|
| 204 |
</div>
|
| 205 |
<span style="background:rgba(0,245,212,0.15);border:1px solid rgba(0,245,212,0.4);
|
| 206 |
-
color:#00f5d4;border-radius:6px;padding:4px 12px;font-size:
|
| 207 |
font-family:JetBrains Mono,monospace;letter-spacing:1px;">🤗 {model_repo}</span>
|
| 208 |
</div>
|
| 209 |
<!-- Answer -->
|
|
@@ -214,12 +214,12 @@ def _result_card(best, best_txt, ranked_lbl, ranked_idx, probs, options, model_r
|
|
| 214 |
-webkit-background-clip:text;-webkit-text-fill-color:transparent;
|
| 215 |
margin-bottom:14px;letter-spacing:-0.5px;">Option {best}</div>
|
| 216 |
<div style="background:rgba(0,245,212,0.06);border:1px solid rgba(0,245,212,0.2);
|
| 217 |
-
border-radius:10px;padding:
|
| 218 |
-
<div style="font-size:
|
| 219 |
font-weight:700;margin-bottom:4px;letter-spacing:1px;">// SELECTED ANSWER TEXT</div>
|
| 220 |
-
<div style="color:#f8fafc;font-size:
|
| 221 |
</div>
|
| 222 |
-
<div style="margin-top:12px;font-size:
|
| 223 |
{inference_source}
|
| 224 |
</div>
|
| 225 |
</div>
|
|
@@ -260,7 +260,7 @@ EXAMPLES = [
|
|
| 260 |
"Batch normalization reducing gradient flow"],
|
| 261 |
]
|
| 262 |
|
| 263 |
-
# ── CSS Theme System ─────────────────────
|
| 264 |
CSS = """
|
| 265 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700;800&display=swap');
|
| 266 |
|
|
@@ -287,18 +287,20 @@ html, body {
|
|
| 287 |
margin: 0 !important;
|
| 288 |
padding: 0 !important;
|
| 289 |
width: 100% !important;
|
|
|
|
| 290 |
background: #070a12 !important;
|
| 291 |
color: #f8fafc !important;
|
| 292 |
font-family: 'Inter', sans-serif !important;
|
| 293 |
}
|
| 294 |
|
| 295 |
-
.gradio-container {
|
| 296 |
max-width: 100% !important;
|
| 297 |
width: 100% !important;
|
| 298 |
margin: 0 !important;
|
| 299 |
padding: 0 !important;
|
| 300 |
min-height: 100vh !important;
|
| 301 |
background: #070a12 !important;
|
|
|
|
| 302 |
}
|
| 303 |
|
| 304 |
.gradio-container::before {
|
|
@@ -313,7 +315,7 @@ html, body {
|
|
| 313 |
z-index: 0;
|
| 314 |
}
|
| 315 |
|
| 316 |
-
.main, .contain {
|
| 317 |
max-width: 100% !important;
|
| 318 |
width: 100% !important;
|
| 319 |
padding: 0 !important;
|
|
@@ -324,10 +326,11 @@ html, body {
|
|
| 324 |
.tab-nav {
|
| 325 |
background: #070a12 !important;
|
| 326 |
border-bottom: 1px solid rgba(0, 245, 212, 0.2) !important;
|
| 327 |
-
padding: 0
|
| 328 |
position: sticky !important;
|
| 329 |
top: 0 !important;
|
| 330 |
z-index: 100 !important;
|
|
|
|
| 331 |
}
|
| 332 |
.tab-nav button {
|
| 333 |
color: #94a3b8 !important;
|
|
@@ -352,6 +355,12 @@ html, body {
|
|
| 352 |
background: transparent !important;
|
| 353 |
}
|
| 354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
.block, .form, .gr-group, .gr-box,
|
| 356 |
[data-testid="block"], [data-testid="group"],
|
| 357 |
[class*="block"], [class*="group"], [class*="panel"],
|
|
@@ -486,24 +495,27 @@ details[open] summary {
|
|
| 486 |
}
|
| 487 |
details[open] summary span { color: #00f5d4 !important; }
|
| 488 |
|
| 489 |
-
|
|
|
|
| 490 |
background: #0d1424 !important;
|
| 491 |
-
border: 1px solid rgba(0, 245, 212, 0.
|
| 492 |
-
border-radius:
|
| 493 |
overflow: hidden !important;
|
| 494 |
-
margin-top:
|
|
|
|
|
|
|
| 495 |
}
|
| 496 |
.examples .label, [data-testid="examples"] > span {
|
| 497 |
color: #00f5d4 !important;
|
| 498 |
font-family: 'JetBrains Mono', monospace !important;
|
| 499 |
-
font-size:
|
| 500 |
-
font-weight:
|
| 501 |
-
letter-spacing:
|
| 502 |
text-transform: uppercase !important;
|
| 503 |
-
padding:
|
| 504 |
display: block !important;
|
| 505 |
-
background: rgba(0, 245, 212, 0.
|
| 506 |
-
border-bottom: 1px solid rgba(0, 245, 212, 0.
|
| 507 |
}
|
| 508 |
table {
|
| 509 |
width: 100% !important;
|
|
@@ -511,6 +523,7 @@ table {
|
|
| 511 |
font-family: 'Inter', sans-serif !important;
|
| 512 |
font-size: 13px !important;
|
| 513 |
background: #0d1424 !important;
|
|
|
|
| 514 |
}
|
| 515 |
thead tr {
|
| 516 |
background: #111a2e !important;
|
|
@@ -519,18 +532,21 @@ thead th {
|
|
| 519 |
color: #00f5d4 !important;
|
| 520 |
font-family: 'JetBrains Mono', monospace !important;
|
| 521 |
font-size: 11px !important;
|
| 522 |
-
font-weight:
|
| 523 |
-
letter-spacing:
|
| 524 |
text-transform: uppercase !important;
|
| 525 |
-
padding:
|
| 526 |
-
border-bottom: 1px solid rgba(0, 245, 212, 0.
|
| 527 |
text-align: left !important;
|
|
|
|
| 528 |
}
|
| 529 |
tbody td {
|
| 530 |
color: #e2e8f0 !important;
|
| 531 |
-
padding:
|
| 532 |
border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
|
| 533 |
background: transparent !important;
|
|
|
|
|
|
|
| 534 |
}
|
| 535 |
tbody tr:hover td {
|
| 536 |
background: rgba(0, 245, 212, 0.08) !important;
|
|
@@ -590,21 +606,21 @@ TOPBAR = f"""
|
|
| 590 |
<div style="width:4px;background:linear-gradient(180deg,#00f5d4 0%,#818cf8 100%);flex-shrink:0;"></div>
|
| 591 |
|
| 592 |
<div style="flex:1;display:flex;align-items:center;justify-content:space-between;
|
| 593 |
-
padding:18px
|
| 594 |
|
| 595 |
<div style="display:flex;align-items:center;gap:14px;">
|
| 596 |
-
<div style="width:
|
| 597 |
border-radius:10px;display:flex;align-items:center;justify-content:center;
|
| 598 |
-
font-size:
|
| 599 |
<div>
|
| 600 |
-
<div style="font-size:
|
| 601 |
background:linear-gradient(90deg,#00f5d4,#c7d2fe);
|
| 602 |
-webkit-background-clip:text;-webkit-text-fill-color:transparent;
|
| 603 |
letter-spacing:-0.5px;">
|
| 604 |
-
Multi-Model DeBERTa · MCQ Solver
|
| 605 |
</div>
|
| 606 |
-
<div style="font-size:
|
| 607 |
-
margin-top:2px;">
|
| 608 |
</div>
|
| 609 |
</div>
|
| 610 |
|
|
@@ -635,55 +651,6 @@ TOPBAR = f"""
|
|
| 635 |
</div>
|
| 636 |
"""
|
| 637 |
|
| 638 |
-
MODEL_STATS = """
|
| 639 |
-
<div style="font-family:'JetBrains Mono',monospace;">
|
| 640 |
-
|
| 641 |
-
<div style="background:#0d1424;border:1px solid rgba(0,245,212,0.2);
|
| 642 |
-
border-radius:14px;padding:18px;margin-bottom:14px;">
|
| 643 |
-
<div style="font-size:11px;color:#00f5d4;font-weight:800;letter-spacing:2px;
|
| 644 |
-
text-transform:uppercase;margin-bottom:12px;">MODEL METADATA</div>
|
| 645 |
-
<div style="display:flex;flex-direction:column;gap:8px;font-size:12px;">
|
| 646 |
-
<div style="display:flex;justify-content:space-between;padding-bottom:6px;
|
| 647 |
-
border-bottom:1px solid rgba(255,255,255,0.06);">
|
| 648 |
-
<span style="color:#94a3b8;">Large Model</span>
|
| 649 |
-
<span style="color:#00f5d4;font-weight:700;">mcq-deberta-v3-large</span>
|
| 650 |
-
</div>
|
| 651 |
-
<div style="display:flex;justify-content:space-between;padding-bottom:6px;
|
| 652 |
-
border-bottom:1px solid rgba(255,255,255,0.06);">
|
| 653 |
-
<span style="color:#94a3b8;">Base Model</span>
|
| 654 |
-
<span style="color:#818cf8;font-weight:700;">mcq-deberta-v3-best-v2</span>
|
| 655 |
-
</div>
|
| 656 |
-
<div style="display:flex;justify-content:space-between;padding-bottom:6px;
|
| 657 |
-
border-bottom:1px solid rgba(255,255,255,0.06);">
|
| 658 |
-
<span style="color:#94a3b8;">Task Head</span>
|
| 659 |
-
<span style="color:#f8fafc;font-weight:600;">SequenceClassification</span>
|
| 660 |
-
</div>
|
| 661 |
-
<div style="display:flex;justify-content:space-between;padding-top:4px;">
|
| 662 |
-
<span style="color:#94a3b8;">Validation MAP@3</span>
|
| 663 |
-
<span style="color:#00f5d4;font-weight:800;">1.0000 ✓</span>
|
| 664 |
-
</div>
|
| 665 |
-
</div>
|
| 666 |
-
</div>
|
| 667 |
-
|
| 668 |
-
<div style="display:flex;flex-direction:column;gap:8px;">
|
| 669 |
-
<a href="https://huggingface.co/spaces/Shitanshu06/smart-mcq-solver" target="_blank"
|
| 670 |
-
style="display:flex;align-items:center;justify-content:space-between;
|
| 671 |
-
background:#131c31;border:1px solid rgba(0,245,212,0.3);
|
| 672 |
-
border-radius:10px;padding:10px 14px;text-decoration:none;">
|
| 673 |
-
<span style="font-size:12px;color:#00f5d4;font-weight:800;">🚀 Live HF Space</span>
|
| 674 |
-
<span style="color:#00f5d4;font-size:14px;">↗</span>
|
| 675 |
-
</a>
|
| 676 |
-
<a href="https://huggingface.co/Shitanshu06" target="_blank"
|
| 677 |
-
style="display:flex;align-items:center;justify-content:space-between;
|
| 678 |
-
background:#131c31;border:1px solid rgba(255,255,255,0.08);
|
| 679 |
-
border-radius:10px;padding:10px 14px;text-decoration:none;">
|
| 680 |
-
<span style="font-size:12px;color:#f8fafc;font-weight:700;">🤗 Shitanshu06 HuggingFace</span>
|
| 681 |
-
<span style="color:#00f5d4;font-size:14px;">↗</span>
|
| 682 |
-
</a>
|
| 683 |
-
</div>
|
| 684 |
-
</div>
|
| 685 |
-
"""
|
| 686 |
-
|
| 687 |
with gr.Blocks(
|
| 688 |
title="Smart MCQ Solver — DeBERTa-v3-large",
|
| 689 |
theme=gr.themes.Base(),
|
|
@@ -695,12 +662,12 @@ with gr.Blocks(
|
|
| 695 |
with gr.Tabs():
|
| 696 |
|
| 697 |
with gr.TabItem("🔍 PREDICT & SOLVE"):
|
| 698 |
-
with gr.Row(equal_height=False):
|
| 699 |
|
| 700 |
-
|
| 701 |
-
|
| 702 |
|
| 703 |
-
|
|
|
|
| 704 |
|
| 705 |
with gr.Group():
|
| 706 |
gr.Markdown("#### 🤖 MODEL SELECTION")
|
|
@@ -734,27 +701,21 @@ with gr.Blocks(
|
|
| 734 |
pred_btn = gr.Button("🔍 PREDICT ANSWER", variant="primary", size="lg", elem_id="pred_btn")
|
| 735 |
clear_btn = gr.Button("✕ CLEAR FIELDS", size="lg", elem_id="clear_btn")
|
| 736 |
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
label="⚡ QUICK LOAD EXAMPLE CASES — CLICK ANY ROW TO AUTO-FILL",
|
| 741 |
-
cache_examples=False,
|
| 742 |
-
)
|
| 743 |
-
|
| 744 |
-
with gr.Column(scale=4):
|
| 745 |
-
gr.Markdown("#### 📊 PREDICTION OUTPUT")
|
| 746 |
|
| 747 |
result_html = gr.HTML(
|
| 748 |
value="""
|
| 749 |
-
<div style="height:
|
| 750 |
border:1px dashed rgba(0,245,212,0.3);border-radius:16px;
|
| 751 |
background:#0d1424;font-family:'JetBrains Mono',monospace;">
|
| 752 |
<div style="text-align:center;color:#94a3b8;">
|
| 753 |
-
<div style="font-size:
|
| 754 |
-
<div style="font-size:
|
| 755 |
AWAITING_MODEL_INFERENCE
|
| 756 |
</div>
|
| 757 |
-
<div style="font-size:12px;margin-top:
|
| 758 |
Enter question & options then click Predict Answer
|
| 759 |
</div>
|
| 760 |
</div>
|
|
@@ -775,6 +736,16 @@ with gr.Blocks(
|
|
| 775 |
elem_id="prob_out",
|
| 776 |
)
|
| 777 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 778 |
with gr.TabItem("🧪 TEST SUITE"):
|
| 779 |
gr.HTML("""
|
| 780 |
<div style="font-family:'JetBrains Mono',monospace;padding:16px 20px;">
|
|
@@ -822,7 +793,7 @@ with gr.Blocks(
|
|
| 822 |
with gr.TabItem("ℹ️ ABOUT MODEL & PROJECT"):
|
| 823 |
gr.HTML("""
|
| 824 |
<div style="font-family:'Inter',sans-serif;padding:24px 32px;
|
| 825 |
-
display:grid;grid-template-columns:1fr 1fr 1fr;gap:24px;max-width:
|
| 826 |
|
| 827 |
<div style="background:#0d1424;border:1px solid rgba(0,245,212,0.2);
|
| 828 |
border-radius:16px;padding:24px;">
|
|
@@ -877,15 +848,15 @@ with gr.Blocks(
|
|
| 877 |
clear_btn.click(
|
| 878 |
fn=lambda: (
|
| 879 |
"", "", "", "", "", "",
|
| 880 |
-
"""<div style="height:
|
| 881 |
border:1px dashed rgba(0,245,212,0.3);border-radius:16px;
|
| 882 |
background:#0d1424;font-family:'JetBrains Mono',monospace;">
|
| 883 |
<div style="text-align:center;color:#94a3b8;">
|
| 884 |
-
<div style="font-size:
|
| 885 |
-
<div style="font-size:
|
| 886 |
AWAITING_MODEL_INFERENCE
|
| 887 |
</div>
|
| 888 |
-
<div style="font-size:12px;margin-top:
|
| 889 |
Enter question & options then click Predict Answer
|
| 890 |
</div>
|
| 891 |
</div>
|
|
|
|
| 161 |
pct = probs[i] * 100
|
| 162 |
col = colors[r % len(colors)]
|
| 163 |
rows += f"""
|
| 164 |
+
<div style="display:flex;align-items:center;gap:14px;margin:10px 0;padding:12px 18px;
|
| 165 |
background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);
|
| 166 |
border-radius:10px;">
|
| 167 |
+
<span style="font-family:'JetBrains Mono',monospace;font-size:12px;color:#64748b;
|
| 168 |
+
font-weight:700;width:24px;">{medals[r]}</span>
|
| 169 |
+
<span style="width:28px;height:28px;border-radius:8px;background:{col}22;
|
| 170 |
border:1px solid {col}88;display:flex;align-items:center;justify-content:center;
|
| 171 |
+
font-weight:900;color:{col};font-size:13px;font-family:'JetBrains Mono',monospace;">{OPTION_LABELS[i]}</span>
|
| 172 |
+
<div style="flex:1;background:#0d1424;border-radius:6px;height:28px;
|
| 173 |
overflow:hidden;border:1px solid rgba(255,255,255,0.08);">
|
| 174 |
<div style="width:{pct:.1f}%;background:linear-gradient(90deg,{col}dd,{col}66);
|
| 175 |
height:100%;border-radius:6px;display:flex;align-items:center;
|
| 176 |
+
padding-left:12px;min-width:2px;transition:width 0.8s ease;">
|
| 177 |
+
<span style="color:#ffffff;font-size:12px;font-weight:800;
|
| 178 |
font-family:'JetBrains Mono',monospace;white-space:nowrap;
|
| 179 |
text-shadow:0 1px 2px rgba(0,0,0,0.8);">{pct:.1f}%</span>
|
| 180 |
</div>
|
| 181 |
</div>
|
| 182 |
+
<span style="color:#cbd5e1;font-size:13px;width:200px;text-align:right;
|
| 183 |
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
|
| 184 |
+
font-family:'Inter',sans-serif;font-weight:600;">
|
| 185 |
+
{options[i]}
|
| 186 |
</span>
|
| 187 |
</div>"""
|
| 188 |
|
|
|
|
| 200 |
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;">
|
| 201 |
<div style="font-size:11px;font-family:'JetBrains Mono',monospace;color:#94a3b8;
|
| 202 |
font-weight:700;letter-spacing:2px;text-transform:uppercase;">
|
| 203 |
+
MODEL PREDICTION RESULT
|
| 204 |
</div>
|
| 205 |
<span style="background:rgba(0,245,212,0.15);border:1px solid rgba(0,245,212,0.4);
|
| 206 |
+
color:#00f5d4;border-radius:6px;padding:4px 12px;font-size:11px;font-weight:800;
|
| 207 |
font-family:JetBrains Mono,monospace;letter-spacing:1px;">🤗 {model_repo}</span>
|
| 208 |
</div>
|
| 209 |
<!-- Answer -->
|
|
|
|
| 214 |
-webkit-background-clip:text;-webkit-text-fill-color:transparent;
|
| 215 |
margin-bottom:14px;letter-spacing:-0.5px;">Option {best}</div>
|
| 216 |
<div style="background:rgba(0,245,212,0.06);border:1px solid rgba(0,245,212,0.2);
|
| 217 |
+
border-radius:10px;padding:14px 18px;">
|
| 218 |
+
<div style="font-size:11px;color:#00f5d4;font-family:'JetBrains Mono',monospace;
|
| 219 |
font-weight:700;margin-bottom:4px;letter-spacing:1px;">// SELECTED ANSWER TEXT</div>
|
| 220 |
+
<div style="color:#f8fafc;font-size:16px;line-height:1.5;font-weight:600;">"{best_txt}"</div>
|
| 221 |
</div>
|
| 222 |
+
<div style="margin-top:12px;font-size:11px;color:#818cf8;font-family:'JetBrains Mono',monospace;">
|
| 223 |
{inference_source}
|
| 224 |
</div>
|
| 225 |
</div>
|
|
|
|
| 260 |
"Batch normalization reducing gradient flow"],
|
| 261 |
]
|
| 262 |
|
| 263 |
+
# ── CSS Theme System (Full-Width Responsive UI) ──────────────────────────────
|
| 264 |
CSS = """
|
| 265 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700;800&display=swap');
|
| 266 |
|
|
|
|
| 287 |
margin: 0 !important;
|
| 288 |
padding: 0 !important;
|
| 289 |
width: 100% !important;
|
| 290 |
+
max-width: 100% !important;
|
| 291 |
background: #070a12 !important;
|
| 292 |
color: #f8fafc !important;
|
| 293 |
font-family: 'Inter', sans-serif !important;
|
| 294 |
}
|
| 295 |
|
| 296 |
+
.gradio-container, .gradio-container-5-16-0, [class*="gradio-container"] {
|
| 297 |
max-width: 100% !important;
|
| 298 |
width: 100% !important;
|
| 299 |
margin: 0 !important;
|
| 300 |
padding: 0 !important;
|
| 301 |
min-height: 100vh !important;
|
| 302 |
background: #070a12 !important;
|
| 303 |
+
box-sizing: border-color !important;
|
| 304 |
}
|
| 305 |
|
| 306 |
.gradio-container::before {
|
|
|
|
| 315 |
z-index: 0;
|
| 316 |
}
|
| 317 |
|
| 318 |
+
.main, .contain, #root, div[class*="gradio-container"] > div {
|
| 319 |
max-width: 100% !important;
|
| 320 |
width: 100% !important;
|
| 321 |
padding: 0 !important;
|
|
|
|
| 326 |
.tab-nav {
|
| 327 |
background: #070a12 !important;
|
| 328 |
border-bottom: 1px solid rgba(0, 245, 212, 0.2) !important;
|
| 329 |
+
padding: 0 30px !important;
|
| 330 |
position: sticky !important;
|
| 331 |
top: 0 !important;
|
| 332 |
z-index: 100 !important;
|
| 333 |
+
width: 100% !important;
|
| 334 |
}
|
| 335 |
.tab-nav button {
|
| 336 |
color: #94a3b8 !important;
|
|
|
|
| 355 |
background: transparent !important;
|
| 356 |
}
|
| 357 |
|
| 358 |
+
.tabitem {
|
| 359 |
+
padding: 20px 30px !important;
|
| 360 |
+
width: 100% !important;
|
| 361 |
+
max-width: 100% !important;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
.block, .form, .gr-group, .gr-box,
|
| 365 |
[data-testid="block"], [data-testid="group"],
|
| 366 |
[class*="block"], [class*="group"], [class*="panel"],
|
|
|
|
| 495 |
}
|
| 496 |
details[open] summary span { color: #00f5d4 !important; }
|
| 497 |
|
| 498 |
+
/* ── Full-Width Readable Table Formatting ───────────────────────────────────── */
|
| 499 |
+
.examples, [data-testid="examples"], .table-container {
|
| 500 |
background: #0d1424 !important;
|
| 501 |
+
border: 1px solid rgba(0, 245, 212, 0.25) !important;
|
| 502 |
+
border-radius: 16px !important;
|
| 503 |
overflow: hidden !important;
|
| 504 |
+
margin-top: 24px !important;
|
| 505 |
+
width: 100% !important;
|
| 506 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
|
| 507 |
}
|
| 508 |
.examples .label, [data-testid="examples"] > span {
|
| 509 |
color: #00f5d4 !important;
|
| 510 |
font-family: 'JetBrains Mono', monospace !important;
|
| 511 |
+
font-size: 12px !important;
|
| 512 |
+
font-weight: 800 !important;
|
| 513 |
+
letter-spacing: 2px !important;
|
| 514 |
text-transform: uppercase !important;
|
| 515 |
+
padding: 16px 24px !important;
|
| 516 |
display: block !important;
|
| 517 |
+
background: rgba(0, 245, 212, 0.08) !important;
|
| 518 |
+
border-bottom: 1px solid rgba(0, 245, 212, 0.2) !important;
|
| 519 |
}
|
| 520 |
table {
|
| 521 |
width: 100% !important;
|
|
|
|
| 523 |
font-family: 'Inter', sans-serif !important;
|
| 524 |
font-size: 13px !important;
|
| 525 |
background: #0d1424 !important;
|
| 526 |
+
table-layout: auto !important;
|
| 527 |
}
|
| 528 |
thead tr {
|
| 529 |
background: #111a2e !important;
|
|
|
|
| 532 |
color: #00f5d4 !important;
|
| 533 |
font-family: 'JetBrains Mono', monospace !important;
|
| 534 |
font-size: 11px !important;
|
| 535 |
+
font-weight: 800 !important;
|
| 536 |
+
letter-spacing: 1.5px !important;
|
| 537 |
text-transform: uppercase !important;
|
| 538 |
+
padding: 14px 18px !important;
|
| 539 |
+
border-bottom: 1px solid rgba(0, 245, 212, 0.25) !important;
|
| 540 |
text-align: left !important;
|
| 541 |
+
white-space: nowrap !important;
|
| 542 |
}
|
| 543 |
tbody td {
|
| 544 |
color: #e2e8f0 !important;
|
| 545 |
+
padding: 14px 18px !important;
|
| 546 |
border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
|
| 547 |
background: transparent !important;
|
| 548 |
+
line-height: 1.5 !important;
|
| 549 |
+
vertical-align: middle !important;
|
| 550 |
}
|
| 551 |
tbody tr:hover td {
|
| 552 |
background: rgba(0, 245, 212, 0.08) !important;
|
|
|
|
| 606 |
<div style="width:4px;background:linear-gradient(180deg,#00f5d4 0%,#818cf8 100%);flex-shrink:0;"></div>
|
| 607 |
|
| 608 |
<div style="flex:1;display:flex;align-items:center;justify-content:space-between;
|
| 609 |
+
padding:18px 30px;gap:24px;flex-wrap:wrap;">
|
| 610 |
|
| 611 |
<div style="display:flex;align-items:center;gap:14px;">
|
| 612 |
+
<div style="width:42px;height:42px;background:linear-gradient(135deg,#00f5d4,#818cf8);
|
| 613 |
border-radius:10px;display:flex;align-items:center;justify-content:center;
|
| 614 |
+
font-size:22px;box-shadow:0 0 20px rgba(0,245,212,0.4);">🧠</div>
|
| 615 |
<div>
|
| 616 |
+
<div style="font-size:20px;font-weight:900;font-family:'Inter',sans-serif;
|
| 617 |
background:linear-gradient(90deg,#00f5d4,#c7d2fe);
|
| 618 |
-webkit-background-clip:text;-webkit-text-fill-color:transparent;
|
| 619 |
letter-spacing:-0.5px;">
|
| 620 |
+
Multi-Model DeBERTa · Smart MCQ Solver
|
| 621 |
</div>
|
| 622 |
+
<div style="font-size:11px;color:#94a3b8;letter-spacing:2px;text-transform:uppercase;
|
| 623 |
+
margin-top:2px;">Fine-Tuned PyTorch Models (mcq-deberta-v3-large & mcq-deberta-v3-best-v2)</div>
|
| 624 |
</div>
|
| 625 |
</div>
|
| 626 |
|
|
|
|
| 651 |
</div>
|
| 652 |
"""
|
| 653 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 654 |
with gr.Blocks(
|
| 655 |
title="Smart MCQ Solver — DeBERTa-v3-large",
|
| 656 |
theme=gr.themes.Base(),
|
|
|
|
| 662 |
with gr.Tabs():
|
| 663 |
|
| 664 |
with gr.TabItem("🔍 PREDICT & SOLVE"):
|
|
|
|
| 665 |
|
| 666 |
+
# ── Main 2-Column Dashboard Split ─────────────────────────────────
|
| 667 |
+
with gr.Row(equal_height=False):
|
| 668 |
|
| 669 |
+
# ── Left Column: Inputs & Model Selector ──────────────────────
|
| 670 |
+
with gr.Column(scale=6):
|
| 671 |
|
| 672 |
with gr.Group():
|
| 673 |
gr.Markdown("#### 🤖 MODEL SELECTION")
|
|
|
|
| 701 |
pred_btn = gr.Button("🔍 PREDICT ANSWER", variant="primary", size="lg", elem_id="pred_btn")
|
| 702 |
clear_btn = gr.Button("✕ CLEAR FIELDS", size="lg", elem_id="clear_btn")
|
| 703 |
|
| 704 |
+
# ── Right Column: Outputs & Live Visualization ────────────────
|
| 705 |
+
with gr.Column(scale=6):
|
| 706 |
+
gr.Markdown("#### 📊 PREDICTION OUTPUT & ANALYTICS")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 707 |
|
| 708 |
result_html = gr.HTML(
|
| 709 |
value="""
|
| 710 |
+
<div style="height:280px;display:flex;align-items:center;justify-content:center;
|
| 711 |
border:1px dashed rgba(0,245,212,0.3);border-radius:16px;
|
| 712 |
background:#0d1424;font-family:'JetBrains Mono',monospace;">
|
| 713 |
<div style="text-align:center;color:#94a3b8;">
|
| 714 |
+
<div style="font-size:42px;margin-bottom:12px;">🎯</div>
|
| 715 |
+
<div style="font-size:13px;font-weight:800;letter-spacing:2px;text-transform:uppercase;color:#00f5d4;">
|
| 716 |
AWAITING_MODEL_INFERENCE
|
| 717 |
</div>
|
| 718 |
+
<div style="font-size:12px;margin-top:8px;color:#94a3b8;">
|
| 719 |
Enter question & options then click Predict Answer
|
| 720 |
</div>
|
| 721 |
</div>
|
|
|
|
| 736 |
elem_id="prob_out",
|
| 737 |
)
|
| 738 |
|
| 739 |
+
# ── Full-Width Bottom Row: Long Examples Table ─────────────────────
|
| 740 |
+
with gr.Row():
|
| 741 |
+
with gr.Column(scale=12):
|
| 742 |
+
gr.Examples(
|
| 743 |
+
examples=EXAMPLES,
|
| 744 |
+
inputs=[prompt_in, opt_a, opt_b, opt_c, opt_d, opt_e],
|
| 745 |
+
label="⚡ QUICK LOAD EXAMPLE CASES — CLICK ANY ROW BELOW TO AUTO-FILL",
|
| 746 |
+
cache_examples=False,
|
| 747 |
+
)
|
| 748 |
+
|
| 749 |
with gr.TabItem("🧪 TEST SUITE"):
|
| 750 |
gr.HTML("""
|
| 751 |
<div style="font-family:'JetBrains Mono',monospace;padding:16px 20px;">
|
|
|
|
| 793 |
with gr.TabItem("ℹ️ ABOUT MODEL & PROJECT"):
|
| 794 |
gr.HTML("""
|
| 795 |
<div style="font-family:'Inter',sans-serif;padding:24px 32px;
|
| 796 |
+
display:grid;grid-template-columns:1fr 1fr 1fr;gap:24px;max-width:100%;">
|
| 797 |
|
| 798 |
<div style="background:#0d1424;border:1px solid rgba(0,245,212,0.2);
|
| 799 |
border-radius:16px;padding:24px;">
|
|
|
|
| 848 |
clear_btn.click(
|
| 849 |
fn=lambda: (
|
| 850 |
"", "", "", "", "", "",
|
| 851 |
+
"""<div style="height:280px;display:flex;align-items:center;justify-content:center;
|
| 852 |
border:1px dashed rgba(0,245,212,0.3);border-radius:16px;
|
| 853 |
background:#0d1424;font-family:'JetBrains Mono',monospace;">
|
| 854 |
<div style="text-align:center;color:#94a3b8;">
|
| 855 |
+
<div style="font-size:42px;margin-bottom:12px;">🎯</div>
|
| 856 |
+
<div style="font-size:13px;font-weight:800;letter-spacing:2px;text-transform:uppercase;color:#00f5d4;">
|
| 857 |
AWAITING_MODEL_INFERENCE
|
| 858 |
</div>
|
| 859 |
+
<div style="font-size:12px;margin-top:8px;color:#94a3b8;">
|
| 860 |
Enter question & options then click Predict Answer
|
| 861 |
</div>
|
| 862 |
</div>
|