Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -91,11 +91,12 @@ with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css
|
|
| 91 |
with gr.Row():
|
| 92 |
with gr.Column(scale=1):
|
| 93 |
|
| 94 |
-
# --- FINAL FIX:
|
| 95 |
with gr.Group():
|
| 96 |
count_by_dropdown = gr.Dropdown(label="Metric", choices=[("Downloads (last 30 days)", "downloads"), ("Downloads (All Time)", "downloadsAllTime"), ("Likes", "likes")], value="downloads")
|
| 97 |
filter_choice_radio = gr.Radio(label="Filter Type", choices=["None", "Tag Filter", "Pipeline Filter"], value="None")
|
| 98 |
|
|
|
|
| 99 |
tag_filter_dropdown = gr.Dropdown(label="Select Tag", choices=TAG_FILTER_CHOICES, value=None, visible=False)
|
| 100 |
pipeline_filter_dropdown = gr.Dropdown(label="Select Pipeline Tag", choices=PIPELINE_TAGS, value=None, visible=False)
|
| 101 |
|
|
@@ -108,7 +109,7 @@ with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css
|
|
| 108 |
step=1,
|
| 109 |
label=None,
|
| 110 |
show_label=False,
|
| 111 |
-
container=False,
|
| 112 |
elem_id="param-slider-wrapper"
|
| 113 |
)
|
| 114 |
param_range_display = gr.Markdown(f"Range: `{PARAM_CHOICES[0]}` to `{PARAM_CHOICES[-1]}`")
|
|
@@ -134,7 +135,6 @@ with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css
|
|
| 134 |
loading_complete_state.change(fn=_update_button_interactivity, inputs=loading_complete_state, outputs=generate_plot_button)
|
| 135 |
|
| 136 |
def _toggle_filters_visibility(choice):
|
| 137 |
-
# The conditional dropdowns should not be in a group, so they appear correctly
|
| 138 |
return gr.update(visible=choice == "Tag Filter"), gr.update(visible=choice == "Pipeline Filter")
|
| 139 |
filter_choice_radio.change(fn=_toggle_filters_visibility, inputs=filter_choice_radio, outputs=[tag_filter_dropdown, pipeline_filter_dropdown])
|
| 140 |
|
|
|
|
| 91 |
with gr.Row():
|
| 92 |
with gr.Column(scale=1):
|
| 93 |
|
| 94 |
+
# --- FINAL FIX: Each logical section is now in its own Group for consistent styling ---
|
| 95 |
with gr.Group():
|
| 96 |
count_by_dropdown = gr.Dropdown(label="Metric", choices=[("Downloads (last 30 days)", "downloads"), ("Downloads (All Time)", "downloadsAllTime"), ("Likes", "likes")], value="downloads")
|
| 97 |
filter_choice_radio = gr.Radio(label="Filter Type", choices=["None", "Tag Filter", "Pipeline Filter"], value="None")
|
| 98 |
|
| 99 |
+
# These conditional dropdowns appear without a group, which is correct
|
| 100 |
tag_filter_dropdown = gr.Dropdown(label="Select Tag", choices=TAG_FILTER_CHOICES, value=None, visible=False)
|
| 101 |
pipeline_filter_dropdown = gr.Dropdown(label="Select Pipeline Tag", choices=PIPELINE_TAGS, value=None, visible=False)
|
| 102 |
|
|
|
|
| 109 |
step=1,
|
| 110 |
label=None,
|
| 111 |
show_label=False,
|
| 112 |
+
container=False, # This is crucial to let the parent Group control the style
|
| 113 |
elem_id="param-slider-wrapper"
|
| 114 |
)
|
| 115 |
param_range_display = gr.Markdown(f"Range: `{PARAM_CHOICES[0]}` to `{PARAM_CHOICES[-1]}`")
|
|
|
|
| 135 |
loading_complete_state.change(fn=_update_button_interactivity, inputs=loading_complete_state, outputs=generate_plot_button)
|
| 136 |
|
| 137 |
def _toggle_filters_visibility(choice):
|
|
|
|
| 138 |
return gr.update(visible=choice == "Tag Filter"), gr.update(visible=choice == "Pipeline Filter")
|
| 139 |
filter_choice_radio.change(fn=_toggle_filters_visibility, inputs=filter_choice_radio, outputs=[tag_filter_dropdown, pipeline_filter_dropdown])
|
| 140 |
|