Spaces:
Running
Running
Space home: redirect / to HTML /demo; Gradio at /gradio; fix Gradio hero.
Browse files- Root loads the demo page; demo nav and banner link to /gradio/.
- Rebuild hero as Column + Markdown so title and pills render under Gradio 5 themes.
- CSS: force light-on-dark text inside .sde-hero-wrap for prose overrides.
Made-with: Cursor
- server/demo_page.html +2 -2
- server/gradio_ui.py +49 -17
- server/main.py +2 -2
server/demo_page.html
CHANGED
|
@@ -578,7 +578,7 @@
|
|
| 578 |
</div>
|
| 579 |
</div>
|
| 580 |
<div class="space-actions">
|
| 581 |
-
<a class="btn-primary" href="/">Gradio UI</a>
|
| 582 |
<button type="button" class="btn-ghost" id="btnOpenTab" title="Opens this demo in a full browser tab">Open full page</button>
|
| 583 |
<a class="btn-ghost" href="https://huggingface.co/spaces/md896/sql-debug-env" target="_blank" rel="noopener">Space on Hub ↗</a>
|
| 584 |
</div>
|
|
@@ -592,7 +592,7 @@
|
|
| 592 |
<a href="#playground">Playground</a>
|
| 593 |
<a href="#evidence">Evidence</a>
|
| 594 |
<a href="#repro">Reproduce</a>
|
| 595 |
-
<a href="/">Gradio</a>
|
| 596 |
</div>
|
| 597 |
</nav>
|
| 598 |
|
|
|
|
| 578 |
</div>
|
| 579 |
</div>
|
| 580 |
<div class="space-actions">
|
| 581 |
+
<a class="btn-primary" href="/gradio/">Gradio UI</a>
|
| 582 |
<button type="button" class="btn-ghost" id="btnOpenTab" title="Opens this demo in a full browser tab">Open full page</button>
|
| 583 |
<a class="btn-ghost" href="https://huggingface.co/spaces/md896/sql-debug-env" target="_blank" rel="noopener">Space on Hub ↗</a>
|
| 584 |
</div>
|
|
|
|
| 592 |
<a href="#playground">Playground</a>
|
| 593 |
<a href="#evidence">Evidence</a>
|
| 594 |
<a href="#repro">Reproduce</a>
|
| 595 |
+
<a href="/gradio/">Gradio</a>
|
| 596 |
</div>
|
| 597 |
</nav>
|
| 598 |
|
server/gradio_ui.py
CHANGED
|
@@ -80,8 +80,37 @@ GRADIO_CSS = """
|
|
| 80 |
border: 1px solid rgba(148, 163, 184, 0.24);
|
| 81 |
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
|
| 82 |
}
|
| 83 |
-
|
| 84 |
-
.sde-hero-wrap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
.sde-pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
|
| 86 |
.sde-pill {
|
| 87 |
display: inline-block;
|
|
@@ -368,21 +397,24 @@ def build_blocks(static_dir: Path) -> Any:
|
|
| 368 |
theme=theme,
|
| 369 |
css=GRADIO_CSS,
|
| 370 |
) as demo:
|
| 371 |
-
gr.
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
</
|
| 384 |
-
|
| 385 |
-
|
|
|
|
|
|
|
|
|
|
| 386 |
|
| 387 |
gr.Markdown(
|
| 388 |
"### First context: training proof first\n"
|
|
|
|
| 80 |
border: 1px solid rgba(148, 163, 184, 0.24);
|
| 81 |
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
|
| 82 |
}
|
| 83 |
+
/* Gradio 5 theme/prose can override colors; keep hero readable. */
|
| 84 |
+
.sde-hero-wrap h1,
|
| 85 |
+
.sde-hero-wrap .sde-hero-title,
|
| 86 |
+
.sde-hero-wrap .prose,
|
| 87 |
+
.sde-hero-wrap .prose p,
|
| 88 |
+
.sde-hero-wrap .prose h1,
|
| 89 |
+
.sde-hero-wrap .markdown,
|
| 90 |
+
.sde-hero-wrap .markdown p {
|
| 91 |
+
color: #f8fafc !important;
|
| 92 |
+
}
|
| 93 |
+
.sde-hero-wrap h1,
|
| 94 |
+
.sde-hero-wrap .sde-hero-title {
|
| 95 |
+
margin: 0 0 0.35rem 0;
|
| 96 |
+
font-size: 1.85rem;
|
| 97 |
+
font-weight: 800;
|
| 98 |
+
letter-spacing: -0.03em;
|
| 99 |
+
line-height: 1.2;
|
| 100 |
+
}
|
| 101 |
+
.sde-hero-wrap p,
|
| 102 |
+
.sde-hero-wrap .prose p {
|
| 103 |
+
margin: 0;
|
| 104 |
+
color: #e2e8f0 !important;
|
| 105 |
+
font-size: 0.95rem;
|
| 106 |
+
line-height: 1.5;
|
| 107 |
+
}
|
| 108 |
+
.sde-hero-subnav { margin-bottom: 0.75rem; opacity: 0.95; }
|
| 109 |
+
.sde-hero-wrap .sde-hero-subnav a,
|
| 110 |
+
.sde-hero-wrap .sde-hero-subnav .prose a {
|
| 111 |
+
color: #a5f3fc !important;
|
| 112 |
+
font-weight: 600;
|
| 113 |
+
}
|
| 114 |
.sde-pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
|
| 115 |
.sde-pill {
|
| 116 |
display: inline-block;
|
|
|
|
| 397 |
theme=theme,
|
| 398 |
css=GRADIO_CSS,
|
| 399 |
) as demo:
|
| 400 |
+
with gr.Column(elem_classes=["sde-hero-wrap"]):
|
| 401 |
+
gr.Markdown(
|
| 402 |
+
"[HTML demo (main Space page)](/demo) · [OpenEnv API](/docs)",
|
| 403 |
+
elem_classes=["sde-hero-subnav"],
|
| 404 |
+
)
|
| 405 |
+
gr.Markdown(
|
| 406 |
+
"# SQL Debug Environment\n\n"
|
| 407 |
+
"OpenEnv-compliant SQL repair · live SQLite rewards · TRL / GRPO training on this same Space. "
|
| 408 |
+
"One page: benchmarks, artifacts, architecture, and a live playground."
|
| 409 |
+
)
|
| 410 |
+
gr.Markdown(
|
| 411 |
+
'<div class="sde-pill-row">'
|
| 412 |
+
'<span class="sde-pill">OpenEnv</span>'
|
| 413 |
+
'<span class="sde-pill">FastAPI</span>'
|
| 414 |
+
'<span class="sde-pill">Gradio</span>'
|
| 415 |
+
'<span class="sde-pill">TRL · GRPO</span>'
|
| 416 |
+
"</div>"
|
| 417 |
+
)
|
| 418 |
|
| 419 |
gr.Markdown(
|
| 420 |
"### First context: training proof first\n"
|
server/main.py
CHANGED
|
@@ -57,8 +57,8 @@ if _static_dir.is_dir():
|
|
| 57 |
|
| 58 |
@app.get("/")
|
| 59 |
async def space_home():
|
| 60 |
-
"""Hugging Face Space opens here —
|
| 61 |
-
return RedirectResponse(url="/
|
| 62 |
|
| 63 |
|
| 64 |
@app.get("/api/info")
|
|
|
|
| 57 |
|
| 58 |
@app.get("/")
|
| 59 |
async def space_home():
|
| 60 |
+
"""Hugging Face Space opens here — HTML demo first; Gradio lives at /gradio/."""
|
| 61 |
+
return RedirectResponse(url="/demo", status_code=302)
|
| 62 |
|
| 63 |
|
| 64 |
@app.get("/api/info")
|