Lzy01241010 commited on
Commit
07173d5
·
1 Parent(s): 07a8738

Settings widgets: revert container=False, use elem_id with id-targeted CSS to flatten outer block while keeping labels

Browse files
Files changed (1) hide show
  1. app.py +46 -3
app.py CHANGED
@@ -640,6 +640,49 @@ gradio-app > div {
640
  box-shadow: none !important;
641
  padding: 0 !important;
642
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
  [class*="gradio-container"] input[type="range"] {
644
  -webkit-appearance: none;
645
  appearance: none;
@@ -1811,7 +1854,7 @@ with gr.Blocks(
1811
  label="Memory Strategy",
1812
  choices=list(MEMORY_STRATEGIES),
1813
  value="condenser",
1814
- container=False,
1815
  )
1816
  gr.HTML(
1817
  '<div class="memory-help">'
@@ -1827,7 +1870,7 @@ with gr.Blocks(
1827
  maximum=100,
1828
  value=6,
1829
  step=1,
1830
- container=False,
1831
  )
1832
  temperature = gr.Slider(
1833
  label="Temperature",
@@ -1835,7 +1878,7 @@ with gr.Blocks(
1835
  maximum=1.5,
1836
  value=1.0,
1837
  step=0.1,
1838
- container=False,
1839
  )
1840
 
1841
  gr.HTML(
 
640
  box-shadow: none !important;
641
  padding: 0 !important;
642
  }
643
+
644
+ /* === Per-component flatteners (id-based; max specificity vs Gradio defaults) === */
645
+ /* The Memory Strategy dropdown and the two sliders ship with an outer block
646
+ wrapper that paints a small rectangle. Flatten the wrapper AND any nested
647
+ div Gradio inserts (form/container/wrap/etc), keeping label + interactive
648
+ element visible. */
649
+ #quest-memory-strategy,
650
+ #quest-memory-strategy > div,
651
+ #quest-memory-strategy .form,
652
+ #quest-memory-strategy .gr-form,
653
+ #quest-memory-strategy .container,
654
+ #quest-memory-strategy .wrap-inner,
655
+ #quest-memory-strategy .head,
656
+ #quest-max-turns,
657
+ #quest-max-turns > div,
658
+ #quest-max-turns .form,
659
+ #quest-max-turns .gr-form,
660
+ #quest-max-turns .container,
661
+ #quest-max-turns .wrap-inner,
662
+ #quest-max-turns .head,
663
+ #quest-temperature,
664
+ #quest-temperature > div,
665
+ #quest-temperature .form,
666
+ #quest-temperature .gr-form,
667
+ #quest-temperature .container,
668
+ #quest-temperature .wrap-inner,
669
+ #quest-temperature .head {
670
+ background: transparent !important;
671
+ border: 0 !important;
672
+ outline: 0 !important;
673
+ box-shadow: none !important;
674
+ padding: 0 !important;
675
+ border-radius: 0 !important;
676
+ }
677
+ /* But keep the actual interactive control visible (the dropdown's select
678
+ container needs to keep its own border so users can see the box). */
679
+ #quest-memory-strategy [data-testid="dropdown"],
680
+ #quest-memory-strategy .gradio-dropdown {
681
+ background: var(--q-paper) !important;
682
+ border: 1px solid var(--q-line-strong) !important;
683
+ border-radius: var(--q-radius-md) !important;
684
+ min-height: 46px !important;
685
+ }
686
  [class*="gradio-container"] input[type="range"] {
687
  -webkit-appearance: none;
688
  appearance: none;
 
1854
  label="Memory Strategy",
1855
  choices=list(MEMORY_STRATEGIES),
1856
  value="condenser",
1857
+ elem_id="quest-memory-strategy",
1858
  )
1859
  gr.HTML(
1860
  '<div class="memory-help">'
 
1870
  maximum=100,
1871
  value=6,
1872
  step=1,
1873
+ elem_id="quest-max-turns",
1874
  )
1875
  temperature = gr.Slider(
1876
  label="Temperature",
 
1878
  maximum=1.5,
1879
  value=1.0,
1880
  step=0.1,
1881
+ elem_id="quest-temperature",
1882
  )
1883
 
1884
  gr.HTML(