w
commited on
Commit
·
064a290
1
Parent(s):
3dc0b4c
fix: polish UI styling and layout
Browse filesImprove readability and consistency across buttons, tabs, and radios.
app.py
CHANGED
|
@@ -193,7 +193,10 @@ body {
|
|
| 193 |
.gradio-container {
|
| 194 |
font-family: 'Inter', sans-serif !important;
|
| 195 |
background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%) !important;
|
| 196 |
-
max-width:
|
|
|
|
|
|
|
|
|
|
| 197 |
--button-primary-text-color: #ffffff;
|
| 198 |
--button-primary-text-color-hover: #ffffff;
|
| 199 |
--button-primary-text-color-active: #ffffff;
|
|
@@ -271,12 +274,19 @@ fieldset label span {
|
|
| 271 |
}
|
| 272 |
|
| 273 |
fieldset label.selected span {
|
| 274 |
-
color:
|
| 275 |
}
|
| 276 |
|
| 277 |
fieldset label.selected {
|
| 278 |
-
background:
|
| 279 |
-
border-color:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
}
|
| 281 |
|
| 282 |
/* Inputs & Textareas */
|
|
@@ -361,14 +371,21 @@ ul.options, .gr-dropdown-options {
|
|
| 361 |
}
|
| 362 |
|
| 363 |
.gr-button-secondary {
|
| 364 |
-
background: #
|
| 365 |
-
border: 1px solid #
|
| 366 |
-
color: #
|
| 367 |
-
box-shadow: 0 4px 10px rgba(15, 23, 42, 0.
|
| 368 |
}
|
| 369 |
.gr-button-secondary:hover {
|
| 370 |
-
background: #
|
| 371 |
-
border-color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
}
|
| 373 |
|
| 374 |
/* Tabs */
|
|
@@ -383,6 +400,12 @@ ul.options, .gr-dropdown-options {
|
|
| 383 |
border-radius: 0 !important;
|
| 384 |
padding: 4px 10px !important;
|
| 385 |
border-bottom: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
}
|
| 387 |
|
| 388 |
/* Radio buttons */
|
|
@@ -390,17 +413,25 @@ ul.options, .gr-dropdown-options {
|
|
| 390 |
color: var(--text) !important;
|
| 391 |
}
|
| 392 |
|
| 393 |
-
/* Radio
|
| 394 |
.gr-check-radio input[type="radio"] {
|
|
|
|
|
|
|
|
|
|
| 395 |
width: 16px !important;
|
| 396 |
height: 16px !important;
|
| 397 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
}
|
| 399 |
|
| 400 |
fieldset label.selected input[type="radio"] {
|
| 401 |
-
|
| 402 |
-
background
|
| 403 |
-
border: 1px solid #111827 !important;
|
| 404 |
}
|
| 405 |
|
| 406 |
/* Footer */
|
|
@@ -424,7 +455,7 @@ extra_css = """
|
|
| 424 |
"""
|
| 425 |
|
| 426 |
with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.themes.Soft()) as demo:
|
| 427 |
-
gr.HTML('<h1 class="main-title"
|
| 428 |
gr.HTML('<p class="subtitle">✨ Next-Gen Mathematical Data Synthesis Powered by LLM ✨</p>')
|
| 429 |
gr.HTML(extra_css)
|
| 430 |
|
|
@@ -451,8 +482,8 @@ with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.the
|
|
| 451 |
qa_btn = gr.Button("Generate", variant="primary")
|
| 452 |
|
| 453 |
with gr.Column(scale=1):
|
| 454 |
-
qa_problem = gr.Textbox(label="Generated Problem", lines=5
|
| 455 |
-
qa_solution = gr.Textbox(label="Generated Solution", lines=12
|
| 456 |
qa_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 457 |
|
| 458 |
qa_example_btn.click(
|
|
@@ -487,7 +518,7 @@ with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.the
|
|
| 487 |
conv_btn = gr.Button("Generate", variant="primary")
|
| 488 |
|
| 489 |
with gr.Column(scale=1):
|
| 490 |
-
conv_output = gr.Textbox(label="Generated Conversation", lines=20
|
| 491 |
conv_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 492 |
|
| 493 |
conv_example_btn.click(
|
|
@@ -522,7 +553,7 @@ with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.the
|
|
| 522 |
rewrite_btn = gr.Button("Generate", variant="primary")
|
| 523 |
|
| 524 |
with gr.Column(scale=1):
|
| 525 |
-
rewrite_output = gr.Textbox(label="Rewritten Content", lines=20
|
| 526 |
rewrite_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 527 |
|
| 528 |
rewrite_example_btn.click(
|
|
@@ -551,7 +582,7 @@ with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.the
|
|
| 551 |
know_btn = gr.Button("Generate", variant="primary")
|
| 552 |
|
| 553 |
with gr.Column(scale=1):
|
| 554 |
-
know_output = gr.Textbox(label="Extracted Knowledge Points", lines=20
|
| 555 |
know_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 556 |
|
| 557 |
know_example_btn.click(
|
|
@@ -586,7 +617,7 @@ with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.the
|
|
| 586 |
textbook_btn = gr.Button("Generate", variant="primary")
|
| 587 |
|
| 588 |
with gr.Column(scale=1):
|
| 589 |
-
textbook_output = gr.Textbox(label="Generated Exercise Material", lines=20
|
| 590 |
textbook_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 591 |
|
| 592 |
textbook_example_btn.click(
|
|
|
|
| 193 |
.gradio-container {
|
| 194 |
font-family: 'Inter', sans-serif !important;
|
| 195 |
background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%) !important;
|
| 196 |
+
max-width: 1440px !important;
|
| 197 |
+
width: 100% !important;
|
| 198 |
+
margin-left: auto !important;
|
| 199 |
+
margin-right: auto !important;
|
| 200 |
--button-primary-text-color: #ffffff;
|
| 201 |
--button-primary-text-color-hover: #ffffff;
|
| 202 |
--button-primary-text-color-active: #ffffff;
|
|
|
|
| 274 |
}
|
| 275 |
|
| 276 |
fieldset label.selected span {
|
| 277 |
+
color: var(--text) !important;
|
| 278 |
}
|
| 279 |
|
| 280 |
fieldset label.selected {
|
| 281 |
+
background: transparent !important;
|
| 282 |
+
border-color: transparent !important;
|
| 283 |
+
box-shadow: none !important;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
fieldset label {
|
| 287 |
+
border: none !important;
|
| 288 |
+
background: transparent !important;
|
| 289 |
+
box-shadow: none !important;
|
| 290 |
}
|
| 291 |
|
| 292 |
/* Inputs & Textareas */
|
|
|
|
| 371 |
}
|
| 372 |
|
| 373 |
.gr-button-secondary {
|
| 374 |
+
background: #475569 !important;
|
| 375 |
+
border: 1px solid #334155 !important;
|
| 376 |
+
color: #ffffff !important;
|
| 377 |
+
box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15) !important;
|
| 378 |
}
|
| 379 |
.gr-button-secondary:hover {
|
| 380 |
+
background: #334155 !important;
|
| 381 |
+
border-color: #1f2937 !important;
|
| 382 |
+
}
|
| 383 |
+
.gr-button-secondary,
|
| 384 |
+
.gr-button-secondary span,
|
| 385 |
+
.gr-button-secondary p,
|
| 386 |
+
.gr-button-secondary .label {
|
| 387 |
+
color: #ffffff !important;
|
| 388 |
+
-webkit-text-fill-color: #ffffff !important;
|
| 389 |
}
|
| 390 |
|
| 391 |
/* Tabs */
|
|
|
|
| 400 |
border-radius: 0 !important;
|
| 401 |
padding: 4px 10px !important;
|
| 402 |
border-bottom: none !important;
|
| 403 |
+
box-shadow: none !important;
|
| 404 |
+
}
|
| 405 |
+
.tabs button.selected::after {
|
| 406 |
+
display: none !important;
|
| 407 |
+
content: none !important;
|
| 408 |
+
border-bottom: none !important;
|
| 409 |
}
|
| 410 |
|
| 411 |
/* Radio buttons */
|
|
|
|
| 413 |
color: var(--text) !important;
|
| 414 |
}
|
| 415 |
|
| 416 |
+
/* Radio: custom filled dot */
|
| 417 |
.gr-check-radio input[type="radio"] {
|
| 418 |
+
appearance: none !important;
|
| 419 |
+
-webkit-appearance: none !important;
|
| 420 |
+
-moz-appearance: none !important;
|
| 421 |
width: 16px !important;
|
| 422 |
height: 16px !important;
|
| 423 |
+
border-radius: 999px !important;
|
| 424 |
+
border: 2px solid #cbd5e1 !important;
|
| 425 |
+
background: transparent !important;
|
| 426 |
+
display: inline-block !important;
|
| 427 |
+
position: relative !important;
|
| 428 |
+
box-sizing: border-box !important;
|
| 429 |
+
vertical-align: middle !important;
|
| 430 |
}
|
| 431 |
|
| 432 |
fieldset label.selected input[type="radio"] {
|
| 433 |
+
border-color: var(--accent) !important;
|
| 434 |
+
background: radial-gradient(circle at center, #4f46e5 0 5px, transparent 5px) !important;
|
|
|
|
| 435 |
}
|
| 436 |
|
| 437 |
/* Footer */
|
|
|
|
| 455 |
"""
|
| 456 |
|
| 457 |
with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css, theme=gr.themes.Soft()) as demo:
|
| 458 |
+
gr.HTML('<h1 class="main-title">UltraData-Math L3 Generator</h1>')
|
| 459 |
gr.HTML('<p class="subtitle">✨ Next-Gen Mathematical Data Synthesis Powered by LLM ✨</p>')
|
| 460 |
gr.HTML(extra_css)
|
| 461 |
|
|
|
|
| 482 |
qa_btn = gr.Button("Generate", variant="primary")
|
| 483 |
|
| 484 |
with gr.Column(scale=1):
|
| 485 |
+
qa_problem = gr.Textbox(label="Generated Problem", lines=5)
|
| 486 |
+
qa_solution = gr.Textbox(label="Generated Solution", lines=12)
|
| 487 |
qa_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 488 |
|
| 489 |
qa_example_btn.click(
|
|
|
|
| 518 |
conv_btn = gr.Button("Generate", variant="primary")
|
| 519 |
|
| 520 |
with gr.Column(scale=1):
|
| 521 |
+
conv_output = gr.Textbox(label="Generated Conversation", lines=20)
|
| 522 |
conv_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 523 |
|
| 524 |
conv_example_btn.click(
|
|
|
|
| 553 |
rewrite_btn = gr.Button("Generate", variant="primary")
|
| 554 |
|
| 555 |
with gr.Column(scale=1):
|
| 556 |
+
rewrite_output = gr.Textbox(label="Rewritten Content", lines=20)
|
| 557 |
rewrite_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 558 |
|
| 559 |
rewrite_example_btn.click(
|
|
|
|
| 582 |
know_btn = gr.Button("Generate", variant="primary")
|
| 583 |
|
| 584 |
with gr.Column(scale=1):
|
| 585 |
+
know_output = gr.Textbox(label="Extracted Knowledge Points", lines=20)
|
| 586 |
know_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 587 |
|
| 588 |
know_example_btn.click(
|
|
|
|
| 617 |
textbook_btn = gr.Button("Generate", variant="primary")
|
| 618 |
|
| 619 |
with gr.Column(scale=1):
|
| 620 |
+
textbook_output = gr.Textbox(label="Generated Exercise Material", lines=20)
|
| 621 |
textbook_raw = gr.Textbox(label="Raw Response", lines=4, visible=False)
|
| 622 |
|
| 623 |
textbook_example_btn.click(
|