Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -79,14 +79,7 @@ def create_treemap(treemap_data, count_by, title=None):
|
|
79 |
|
80 |
# --- FINAL FIX: Use CSS to target and fix the specific visual issues ---
|
81 |
custom_css = """
|
82 |
-
/*
|
83 |
-
.gradio-group:has(#param-slider-wrapper) {
|
84 |
-
border: none !important;
|
85 |
-
background: none !important;
|
86 |
-
box-shadow: none !important;
|
87 |
-
padding: 12px !important;
|
88 |
-
}
|
89 |
-
/* Target the min/max number labels within the RangeSlider component and hide them */
|
90 |
#param-slider-wrapper div[data-testid="range-slider"] > span {
|
91 |
display: none !important;
|
92 |
}
|
@@ -94,19 +87,18 @@ custom_css = """
|
|
94 |
#param-slider-wrapper .head {
|
95 |
display: none !important;
|
96 |
}
|
97 |
-
|
98 |
-
/* --- NEW RULE AS COMMANDED --- */
|
99 |
-
/* Target component-11 specifically to set its background to none and padding to 5px */
|
100 |
#component-11 {
|
101 |
background: none !important;
|
|
|
|
|
102 |
padding: 5px !important;
|
103 |
}
|
104 |
-
|
105 |
-
|
106 |
-
#param-range-display-md {
|
107 |
background: none !important;
|
108 |
border: none !important;
|
109 |
-
padding: 4px 0 0 0 !important; /*
|
110 |
}
|
111 |
"""
|
112 |
|
@@ -128,7 +120,7 @@ with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css
|
|
128 |
pipeline_filter_dropdown = gr.Dropdown(label="Select Pipeline Tag", choices=PIPELINE_TAGS, value=None, visible=False)
|
129 |
|
130 |
# This group's styling will be modified by the custom CSS
|
131 |
-
with gr.Group():
|
132 |
gr.Markdown("<div style='font-weight: 500;'>Model Parameters</div>")
|
133 |
param_range_slider = RangeSlider(
|
134 |
minimum=0,
|
@@ -139,8 +131,7 @@ with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css
|
|
139 |
show_label=False,
|
140 |
elem_id="param-slider-wrapper"
|
141 |
)
|
142 |
-
|
143 |
-
param_range_display = gr.Markdown(f"Range: `{PARAM_CHOICES[0]}` to `{PARAM_CHOICES[-1]}`", elem_id="param-range-display-md")
|
144 |
|
145 |
# This section remains un-grouped
|
146 |
top_k_dropdown = gr.Dropdown(label="Number of Top Organizations", choices=TOP_K_CHOICES, value=25)
|
|
|
79 |
|
80 |
# --- FINAL FIX: Use CSS to target and fix the specific visual issues ---
|
81 |
custom_css = """
|
82 |
+
/* Hide the min/max number labels within the RangeSlider component */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
#param-slider-wrapper div[data-testid="range-slider"] > span {
|
84 |
display: none !important;
|
85 |
}
|
|
|
87 |
#param-slider-wrapper .head {
|
88 |
display: none !important;
|
89 |
}
|
90 |
+
/* Style the container for the slider group (component-11) as requested */
|
|
|
|
|
91 |
#component-11 {
|
92 |
background: none !important;
|
93 |
+
border: none !important;
|
94 |
+
box-shadow: none !important;
|
95 |
padding: 5px !important;
|
96 |
}
|
97 |
+
/* Target the text block directly following the slider and remove its background */
|
98 |
+
#param-slider-wrapper + div {
|
|
|
99 |
background: none !important;
|
100 |
border: none !important;
|
101 |
+
padding: 4px 0 0 0 !important; /* Add a little space above the text */
|
102 |
}
|
103 |
"""
|
104 |
|
|
|
120 |
pipeline_filter_dropdown = gr.Dropdown(label="Select Pipeline Tag", choices=PIPELINE_TAGS, value=None, visible=False)
|
121 |
|
122 |
# This group's styling will be modified by the custom CSS
|
123 |
+
with gr.Group(elem_id="component-11"):
|
124 |
gr.Markdown("<div style='font-weight: 500;'>Model Parameters</div>")
|
125 |
param_range_slider = RangeSlider(
|
126 |
minimum=0,
|
|
|
131 |
show_label=False,
|
132 |
elem_id="param-slider-wrapper"
|
133 |
)
|
134 |
+
param_range_display = gr.Markdown(f"Range: `{PARAM_CHOICES[0]}` to `{PARAM_CHOICES[-1]}`")
|
|
|
135 |
|
136 |
# This section remains un-grouped
|
137 |
top_k_dropdown = gr.Dropdown(label="Number of Top Organizations", choices=TOP_K_CHOICES, value=25)
|