Spaces:
Running on Zero
Running on Zero
Restyle UI: sober, minimal Cloudflare look
Browse files
app.py
CHANGED
|
@@ -289,10 +289,10 @@ def render_answers(response: dict, elapsed: float) -> str:
|
|
| 289 |
for k, v in usage.items()
|
| 290 |
)
|
| 291 |
trunc = ('<span class="cf-flag">input truncated</span>' if response.get("truncated") else
|
| 292 |
-
'<span class="cf-ok">
|
| 293 |
return (
|
| 294 |
f'<div class="cf-results"><div class="cf-results-head"><span>Structured answers</span>'
|
| 295 |
-
f'<span class="cf-time">{trunc}<span>
|
| 296 |
f'<div class="cf-grid">{"".join(cards)}</div><div class="cf-stats">{stats}</div></div>'
|
| 297 |
)
|
| 298 |
|
|
@@ -361,101 +361,78 @@ def extract(state: str, fields_json: str, image=None, reference_date: str = "",
|
|
| 361 |
# ---------------------------------------------------------------------------
|
| 362 |
CF_LOGO = """
|
| 363 |
<svg class="cf-logo" viewBox="0 0 120 56" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
| 364 |
-
<
|
| 365 |
-
<path fill="url(#cfg)" d="M93 50H20.5a14 14 0 0 1-2.7-27.7A22 22 0 0 1 59 13.6 17 17 0 0 1 88.6 24 13 13 0 0 1 106 37a13 13 0 0 1-13 13z"/>
|
| 366 |
-
<path fill="#fff" fill-opacity=".9" d="M38 36h46a2 2 0 0 1 0 4H38a2 2 0 0 1 0-4zm8-8h30a2 2 0 0 1 0 4H46a2 2 0 0 1 0-4z"/>
|
| 367 |
</svg>
|
| 368 |
"""
|
| 369 |
|
| 370 |
HEADER = f"""
|
| 371 |
<div class="cf-hero">
|
| 372 |
-
<div class="cf-
|
| 373 |
-
<
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
<div class="cf-links">
|
| 381 |
-
<a href="https://huggingface.co/Cloudflare/clairic" target="_blank">Model card ↗</a>
|
| 382 |
-
<a href="https://huggingface.co/Cloudflare/clairic-flash" target="_blank">Clairic Flash ↗</a>
|
| 383 |
-
<span class="cf-pill">Apache-2.0</span><span class="cf-pill">Multimodal</span><span class="cf-pill">Structured output</span>
|
| 384 |
-
</div>
|
| 385 |
-
</div>
|
| 386 |
</div>
|
| 387 |
</div>
|
| 388 |
"""
|
| 389 |
|
| 390 |
CSS = """
|
| 391 |
-
:root { --cf-orange:#F38020; --cf-
|
| 392 |
-
.gradio-container { max-width:
|
| 393 |
-
|
| 394 |
-
.cf-hero {
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
.cf-hero
|
| 399 |
-
|
| 400 |
-
.cf-
|
| 401 |
-
.cf-
|
| 402 |
-
.cf-
|
| 403 |
-
.cf-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
.cf-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
.cf-
|
| 412 |
-
.cf-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
.cf-panel { border-radius:16px !important; border:1px solid var(--cf-line) !important; }
|
| 416 |
-
.cf-section { font-size:12px; letter-spacing:.14em; font-weight:800; color:var(--cf-orange); margin:2px 0 4px; }
|
| 417 |
-
#cf-run { background: linear-gradient(90deg, var(--cf-amber), var(--cf-orange)) !important; color:#1a0e03 !important;
|
| 418 |
-
font-weight:800 !important; font-size:16px !important; border:none !important; box-shadow: 0 8px 24px rgba(243,128,32,.35); }
|
| 419 |
-
#cf-run:hover { filter: brightness(1.06); transform: translateY(-1px); }
|
| 420 |
-
.cf-presets button { border-radius:999px !important; }
|
| 421 |
-
|
| 422 |
-
.cf-empty { text-align:center; padding:56px 20px; border:1.5px dashed var(--cf-line); border-radius:16px; color: var(--body-text-color-subdued); }
|
| 423 |
-
.cf-empty-icon { font-family: ui-monospace, monospace; font-size:42px; font-weight:800; color: var(--cf-orange); }
|
| 424 |
-
.cf-results-head { display:flex; justify-content:space-between; align-items:center; font-weight:800; margin-bottom:10px; font-size:15px; }
|
| 425 |
-
.cf-time { display:flex; gap:10px; align-items:center; font-weight:600; font-size:13px; color: var(--body-text-color-subdued); }
|
| 426 |
.cf-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap:12px; }
|
| 427 |
-
.cf-card { border-radius:
|
| 428 |
-
border:1px solid var(--border-color-primary); border-top:3px solid var(--cf-orange);
|
| 429 |
-
box-shadow: 0 1px 2px rgba(0,0,0,.05); animation: cfIn .35s ease both; }
|
| 430 |
-
@keyframes cfIn { from { opacity:0; transform: translateY(6px);} to { opacity:1; transform:none; } }
|
| 431 |
.cf-card-head { display:flex; justify-content:space-between; align-items:center; gap:6px; margin-bottom:8px; }
|
| 432 |
-
.cf-card-head code { font-size:13px; font-weight:
|
| 433 |
.cf-card-body { min-height:30px; margin-bottom:10px; }
|
| 434 |
-
.cf-val { font-size:
|
| 435 |
-
.cf-null { font-family: ui-monospace, monospace; color:
|
| 436 |
-
.cf-bool { font-family: ui-monospace, monospace; font-weight:
|
| 437 |
-
.cf-true {
|
| 438 |
.cf-chips { display:flex; flex-wrap:wrap; gap:6px; }
|
| 439 |
-
.cf-chip { font-size:13px;
|
| 440 |
-
.cf-obj div { font-size:13px; } .cf-sub { font-size:12px; color:
|
| 441 |
-
.cf-spark { width:100%; height:54px; margin-top:6px; } .cf-spark polyline { fill:none; stroke:
|
| 442 |
-
.cf-spark .cf-band { fill:
|
| 443 |
-
.cf-spark circle { fill:
|
| 444 |
-
.cf-meter { display:grid; grid-template-columns: 70px 1fr 50px; align-items:center; gap:8px; font-size:11px; color:
|
| 445 |
-
.cf-meter em { font-style:normal; text-align:right; font-weight:
|
| 446 |
-
.cf-bar { height:
|
| 447 |
-
.cf-bar i { display:block; height:100%;
|
| 448 |
-
.cf-meter-null .cf-bar i { background:
|
| 449 |
-
.cf-type { font-size:
|
| 450 |
-
.cf-range { display:flex; justify-content:space-between; font-size:12px; margin-top:8px; color:
|
| 451 |
-
.cf-range span:nth-child(2) { color:
|
| 452 |
-
.cf-flag { margin-left:
|
| 453 |
-
.cf-ok { color:
|
| 454 |
-
.cf-stats { display:flex; flex-wrap:wrap; gap:
|
| 455 |
-
.cf-stat {
|
| 456 |
-
.cf-
|
| 457 |
-
.cf-footer {
|
| 458 |
-
.cf-footer a { color: var(--cf-orange) !important; }
|
| 459 |
"""
|
| 460 |
|
| 461 |
theme = gr.themes.Base(
|
|
@@ -463,27 +440,42 @@ theme = gr.themes.Base(
|
|
| 463 |
c50="#fff6ed", c100="#ffead4", c200="#fed1a8", c300="#fdb070", c400="#fbad41",
|
| 464 |
c500="#f38020", c600="#e06a10", c700="#b9520f", c800="#934114", c900="#773714", c950="#401a08",
|
| 465 |
),
|
| 466 |
-
secondary_hue="
|
| 467 |
-
neutral_hue="
|
| 468 |
-
radius_size="
|
| 469 |
font=[gr.themes.GoogleFont("Inter"), "system-ui", "sans-serif"],
|
| 470 |
-
font_mono=[
|
| 471 |
).set(
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
|
|
|
|
|
|
|
|
|
| 477 |
input_border_color_focus="#F38020",
|
| 478 |
slider_color="#F38020",
|
| 479 |
checkbox_background_color_selected="#F38020",
|
|
|
|
| 480 |
)
|
| 481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 482 |
PRESETS = {
|
| 483 |
-
"
|
| 484 |
-
"
|
| 485 |
-
"
|
| 486 |
-
"
|
| 487 |
}
|
| 488 |
|
| 489 |
with gr.Blocks(title="Clairic · Cloudflare") as demo:
|
|
@@ -491,22 +483,22 @@ with gr.Blocks(title="Clairic · Cloudflare") as demo:
|
|
| 491 |
with gr.Row(equal_height=False):
|
| 492 |
with gr.Column(scale=5):
|
| 493 |
with gr.Group(elem_classes="cf-panel"):
|
| 494 |
-
gr.HTML('<div class="cf-section" style="padding:10px 12px 0">
|
| 495 |
state = gr.Textbox(label="State (text or JSON)", lines=5, value=INVOICE_STATE,
|
| 496 |
placeholder="Paste an email, invoice, log line, table, JSON…")
|
| 497 |
image = gr.Image(label="Image (optional)", type="pil", height=240,
|
| 498 |
sources=["upload", "clipboard"])
|
| 499 |
with gr.Group(elem_classes="cf-panel"):
|
| 500 |
-
gr.HTML('<div class="cf-section" style="padding:10px 12px 0">
|
| 501 |
fields = gr.Code(label="Fields (JSON)", language="json", value=_fmt(INVOICE_FIELDS), lines=12)
|
| 502 |
with gr.Row(elem_classes="cf-presets"):
|
| 503 |
preset_buttons = [gr.Button(name, size="sm", variant="secondary") for name in PRESETS]
|
| 504 |
with gr.Accordion("Advanced options", open=False):
|
| 505 |
reference_date = gr.Textbox(label="Reference date (ISO, optional)", placeholder="2026-11-18")
|
| 506 |
include_quantiles = gr.Checkbox(label="Include quantiles for estimates / forecasts", value=False)
|
| 507 |
-
run = gr.Button("Extract
|
| 508 |
with gr.Column(scale=6):
|
| 509 |
-
gr.HTML('<div class="cf-section">
|
| 510 |
out_html = gr.HTML(EMPTY_HTML)
|
| 511 |
with gr.Accordion("Raw JSON response", open=False):
|
| 512 |
out_json = gr.JSON(label="Response")
|
|
@@ -548,4 +540,4 @@ with gr.Blocks(title="Clairic · Cloudflare") as demo:
|
|
| 548 |
'<a href="https://huggingface.co/datasets/naver-clova-ix/cord-v2" target="_blank">CORD-v2</a> (CC-BY-4.0)</div>')
|
| 549 |
|
| 550 |
if __name__ == "__main__":
|
| 551 |
-
demo.launch(theme=theme, css=CSS, mcp_server=True)
|
|
|
|
| 289 |
for k, v in usage.items()
|
| 290 |
)
|
| 291 |
trunc = ('<span class="cf-flag">input truncated</span>' if response.get("truncated") else
|
| 292 |
+
'<span class="cf-ok">complete input</span>')
|
| 293 |
return (
|
| 294 |
f'<div class="cf-results"><div class="cf-results-head"><span>Structured answers</span>'
|
| 295 |
+
f'<span class="cf-time">{trunc}<span>{elapsed:.1f}s</span></span></div>'
|
| 296 |
f'<div class="cf-grid">{"".join(cards)}</div><div class="cf-stats">{stats}</div></div>'
|
| 297 |
)
|
| 298 |
|
|
|
|
| 361 |
# ---------------------------------------------------------------------------
|
| 362 |
CF_LOGO = """
|
| 363 |
<svg class="cf-logo" viewBox="0 0 120 56" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
| 364 |
+
<path fill="#F38020" d="M93 50H20.5a14 14 0 0 1-2.7-27.7A22 22 0 0 1 59 13.6 17 17 0 0 1 88.6 24 13 13 0 0 1 106 37a13 13 0 0 1-13 13z"/>
|
|
|
|
|
|
|
| 365 |
</svg>
|
| 366 |
"""
|
| 367 |
|
| 368 |
HEADER = f"""
|
| 369 |
<div class="cf-hero">
|
| 370 |
+
<div class="cf-brand">{CF_LOGO}<span>Cloudflare</span></div>
|
| 371 |
+
<h1>Clairic <span>27B</span></h1>
|
| 372 |
+
<p>Turn unstructured text and images into typed, scored structured answers. Declare a schema of fields —
|
| 373 |
+
text, numbers, dates, enums, lists, estimates, forecasts — and get back values with confidence and null probabilities.</p>
|
| 374 |
+
<div class="cf-links">
|
| 375 |
+
<a href="https://huggingface.co/Cloudflare/clairic" target="_blank">Model card</a>
|
| 376 |
+
<a href="https://huggingface.co/Cloudflare/clairic-flash" target="_blank">Clairic Flash</a>
|
| 377 |
+
<span class="cf-meta">Apache-2.0 · Multimodal · Structured output</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
</div>
|
| 379 |
</div>
|
| 380 |
"""
|
| 381 |
|
| 382 |
CSS = """
|
| 383 |
+
:root { --cf-orange:#F38020; --cf-orange-dark:#E06A10; --cf-text:#222; --cf-muted:#595959; --cf-line:#E5E5E5; }
|
| 384 |
+
.gradio-container { max-width: 1200px !important; margin: 0 auto !important;
|
| 385 |
+
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
|
| 386 |
+
.cf-hero { padding:28px 4px 24px; margin-bottom:16px; border-bottom:1px solid var(--cf-line); }
|
| 387 |
+
.cf-brand { display:flex; align-items:center; gap:8px; margin-bottom:18px; font-size:15px; font-weight:600; color:var(--cf-text); }
|
| 388 |
+
.cf-logo { width:34px; flex:none; }
|
| 389 |
+
.cf-hero h1 { font-size:32px; line-height:1.2; margin:0 0 8px; font-weight:600; color:var(--cf-text); letter-spacing:-.01em; }
|
| 390 |
+
.cf-hero h1 span { font-size:18px; font-weight:400; color:var(--cf-muted); margin-left:4px; }
|
| 391 |
+
.cf-hero p { color:var(--cf-muted); max-width:760px; margin:0 0 14px; font-size:15px; line-height:1.6; }
|
| 392 |
+
.cf-links { display:flex; gap:20px; flex-wrap:wrap; align-items:center; font-size:14px; }
|
| 393 |
+
.cf-links a { color:var(--cf-orange) !important; text-decoration:none; font-weight:500; }
|
| 394 |
+
.cf-links a:hover { text-decoration:underline; }
|
| 395 |
+
.cf-meta { color:var(--cf-muted); font-size:13px; }
|
| 396 |
+
|
| 397 |
+
.cf-panel { border:1px solid var(--cf-line) !important; }
|
| 398 |
+
.cf-section { font-size:13px; font-weight:600; color:var(--cf-text); margin:2px 0 4px; }
|
| 399 |
+
#cf-run { background:var(--cf-orange) !important; color:#fff !important; font-weight:600 !important;
|
| 400 |
+
border:none !important; box-shadow:none !important; }
|
| 401 |
+
#cf-run:hover { background:var(--cf-orange-dark) !important; }
|
| 402 |
+
|
| 403 |
+
.cf-empty { text-align:center; padding:48px 20px; border:1px solid var(--cf-line); border-radius:6px; color:var(--cf-muted); }
|
| 404 |
+
.cf-empty-icon { font-family: ui-monospace, monospace; font-size:24px; color:#999; margin-bottom:6px; }
|
| 405 |
+
.cf-results-head { display:flex; justify-content:space-between; align-items:center; font-weight:600; margin-bottom:12px; font-size:15px; }
|
| 406 |
+
.cf-time { display:flex; gap:12px; align-items:center; font-weight:400; font-size:13px; color:var(--cf-muted); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 407 |
.cf-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap:12px; }
|
| 408 |
+
.cf-card { border-radius:6px; padding:14px; background:var(--block-background-fill); border:1px solid var(--border-color-primary); }
|
|
|
|
|
|
|
|
|
|
| 409 |
.cf-card-head { display:flex; justify-content:space-between; align-items:center; gap:6px; margin-bottom:8px; }
|
| 410 |
+
.cf-card-head code { font-size:13px; font-weight:600; color:var(--body-text-color); background:none; padding:0; }
|
| 411 |
.cf-card-body { min-height:30px; margin-bottom:10px; }
|
| 412 |
+
.cf-val { font-size:18px; font-weight:500; word-break:break-word; }
|
| 413 |
+
.cf-null { font-family: ui-monospace, monospace; color:var(--body-text-color-subdued); font-style:italic; }
|
| 414 |
+
.cf-bool { font-family: ui-monospace, monospace; font-weight:500; }
|
| 415 |
+
.cf-true { color:#1a7f37; } .cf-false { color:#b42318; }
|
| 416 |
.cf-chips { display:flex; flex-wrap:wrap; gap:6px; }
|
| 417 |
+
.cf-chip { font-size:13px; padding:3px 8px; border-radius:4px; border:1px solid var(--border-color-primary); }
|
| 418 |
+
.cf-obj div { font-size:13px; } .cf-sub { font-size:12px; color:var(--body-text-color-subdued); margin-top:6px; }
|
| 419 |
+
.cf-spark { width:100%; height:54px; margin-top:6px; } .cf-spark polyline { fill:none; stroke:var(--cf-orange); stroke-width:1.5; stroke-linejoin:round; }
|
| 420 |
+
.cf-spark .cf-band { fill:rgba(243,128,32,.10); stroke:none; }
|
| 421 |
+
.cf-spark circle { fill:var(--cf-orange); stroke:none; r:2.5; }
|
| 422 |
+
.cf-meter { display:grid; grid-template-columns: 70px 1fr 50px; align-items:center; gap:8px; font-size:11px; color:var(--body-text-color-subdued); margin-top:4px; }
|
| 423 |
+
.cf-meter em { font-style:normal; text-align:right; font-weight:500; color:var(--body-text-color); }
|
| 424 |
+
.cf-bar { height:4px; border-radius:2px; background:var(--border-color-primary); overflow:hidden; }
|
| 425 |
+
.cf-bar i { display:block; height:100%; background:var(--cf-orange); }
|
| 426 |
+
.cf-meter-null .cf-bar i { background:#8c8c8c; }
|
| 427 |
+
.cf-type { font-size:11px; color:var(--body-text-color-subdued); margin-left:6px; }
|
| 428 |
+
.cf-range { display:flex; justify-content:space-between; font-size:12px; margin-top:8px; color:var(--body-text-color-subdued); }
|
| 429 |
+
.cf-range span:nth-child(2) { color:var(--body-text-color); font-weight:500; }
|
| 430 |
+
.cf-flag { margin-left:6px; font-size:11px; font-weight:500; color:#b42318; }
|
| 431 |
+
.cf-ok { color:var(--body-text-color-subdued); }
|
| 432 |
+
.cf-stats { display:flex; flex-wrap:wrap; gap:24px; margin-top:16px; padding-top:12px; border-top:1px solid var(--border-color-primary); }
|
| 433 |
+
.cf-stat b { display:block; font-size:15px; font-weight:500; } .cf-stat span { font-size:11px; color:var(--body-text-color-subdued); text-transform:capitalize; }
|
| 434 |
+
.cf-footer { text-align:center; font-size:12px; color:var(--body-text-color-subdued); margin-top:16px; padding-top:16px; border-top:1px solid var(--cf-line); }
|
| 435 |
+
.cf-footer a { color:var(--cf-orange) !important; text-decoration:none; }
|
|
|
|
| 436 |
"""
|
| 437 |
|
| 438 |
theme = gr.themes.Base(
|
|
|
|
| 440 |
c50="#fff6ed", c100="#ffead4", c200="#fed1a8", c300="#fdb070", c400="#fbad41",
|
| 441 |
c500="#f38020", c600="#e06a10", c700="#b9520f", c800="#934114", c900="#773714", c950="#401a08",
|
| 442 |
),
|
| 443 |
+
secondary_hue="neutral",
|
| 444 |
+
neutral_hue="neutral",
|
| 445 |
+
radius_size="sm",
|
| 446 |
font=[gr.themes.GoogleFont("Inter"), "system-ui", "sans-serif"],
|
| 447 |
+
font_mono=["ui-monospace", "SFMono-Regular", "Menlo", "monospace"],
|
| 448 |
).set(
|
| 449 |
+
body_background_fill="#ffffff",
|
| 450 |
+
button_primary_background_fill="#F38020",
|
| 451 |
+
button_primary_background_fill_hover="#E06A10",
|
| 452 |
+
button_primary_text_color="#ffffff",
|
| 453 |
+
button_primary_border_color="#F38020",
|
| 454 |
+
block_shadow="none",
|
| 455 |
+
block_title_text_weight="500",
|
| 456 |
+
block_label_text_weight="500",
|
| 457 |
input_border_color_focus="#F38020",
|
| 458 |
slider_color="#F38020",
|
| 459 |
checkbox_background_color_selected="#F38020",
|
| 460 |
+
link_text_color="#F38020",
|
| 461 |
)
|
| 462 |
|
| 463 |
+
# Keep the light, neutral palette regardless of the visitor's OS dark-mode setting.
|
| 464 |
+
FORCE_LIGHT = """
|
| 465 |
+
() => {
|
| 466 |
+
const url = new URL(window.location);
|
| 467 |
+
if (url.searchParams.get('__theme') !== 'light') {
|
| 468 |
+
url.searchParams.set('__theme', 'light');
|
| 469 |
+
window.location.replace(url.href);
|
| 470 |
+
}
|
| 471 |
+
}
|
| 472 |
+
"""
|
| 473 |
+
|
| 474 |
PRESETS = {
|
| 475 |
+
"Invoice": (INVOICE_STATE, _fmt(INVOICE_FIELDS)),
|
| 476 |
+
"Forecast": (DEMAND_STATE, _fmt(DEMAND_FIELDS)),
|
| 477 |
+
"Support ticket": (TICKET_STATE, _fmt(TICKET_FIELDS)),
|
| 478 |
+
"Receipt image": (RECEIPT_STATE, _fmt(RECEIPT_FIELDS)),
|
| 479 |
}
|
| 480 |
|
| 481 |
with gr.Blocks(title="Clairic · Cloudflare") as demo:
|
|
|
|
| 483 |
with gr.Row(equal_height=False):
|
| 484 |
with gr.Column(scale=5):
|
| 485 |
with gr.Group(elem_classes="cf-panel"):
|
| 486 |
+
gr.HTML('<div class="cf-section" style="padding:10px 12px 0">Source</div>')
|
| 487 |
state = gr.Textbox(label="State (text or JSON)", lines=5, value=INVOICE_STATE,
|
| 488 |
placeholder="Paste an email, invoice, log line, table, JSON…")
|
| 489 |
image = gr.Image(label="Image (optional)", type="pil", height=240,
|
| 490 |
sources=["upload", "clipboard"])
|
| 491 |
with gr.Group(elem_classes="cf-panel"):
|
| 492 |
+
gr.HTML('<div class="cf-section" style="padding:10px 12px 0">Schema</div>')
|
| 493 |
fields = gr.Code(label="Fields (JSON)", language="json", value=_fmt(INVOICE_FIELDS), lines=12)
|
| 494 |
with gr.Row(elem_classes="cf-presets"):
|
| 495 |
preset_buttons = [gr.Button(name, size="sm", variant="secondary") for name in PRESETS]
|
| 496 |
with gr.Accordion("Advanced options", open=False):
|
| 497 |
reference_date = gr.Textbox(label="Reference date (ISO, optional)", placeholder="2026-11-18")
|
| 498 |
include_quantiles = gr.Checkbox(label="Include quantiles for estimates / forecasts", value=False)
|
| 499 |
+
run = gr.Button("Extract", variant="primary", elem_id="cf-run", size="lg")
|
| 500 |
with gr.Column(scale=6):
|
| 501 |
+
gr.HTML('<div class="cf-section">Answers</div>')
|
| 502 |
out_html = gr.HTML(EMPTY_HTML)
|
| 503 |
with gr.Accordion("Raw JSON response", open=False):
|
| 504 |
out_json = gr.JSON(label="Response")
|
|
|
|
| 540 |
'<a href="https://huggingface.co/datasets/naver-clova-ix/cord-v2" target="_blank">CORD-v2</a> (CC-BY-4.0)</div>')
|
| 541 |
|
| 542 |
if __name__ == "__main__":
|
| 543 |
+
demo.launch(theme=theme, css=CSS, js=FORCE_LIGHT, mcp_server=True)
|