Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# --- START OF FINAL,
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import pandas as pd
|
|
@@ -77,12 +77,8 @@ def create_treemap(treemap_data, count_by, title=None):
|
|
| 77 |
fig.update_traces(textinfo="label+value+percent root", hovertemplate="<b>%{label}</b><br>%{value:,} " + count_by + "<br>%{percentRoot:.2%} of total<extra></extra>")
|
| 78 |
return fig
|
| 79 |
|
| 80 |
-
# --- FINAL FIX: This CSS now correctly targets the container you identified ---
|
| 81 |
custom_css = """
|
| 82 |
-
|
| 83 |
-
#param-slider-wrapper .tab-like-container {
|
| 84 |
-
display: none !important;
|
| 85 |
-
}
|
| 86 |
"""
|
| 87 |
|
| 88 |
with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css) as demo:
|
|
@@ -99,17 +95,21 @@ with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css
|
|
| 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 |
|
| 102 |
-
#
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
top_k_dropdown = gr.Dropdown(label="Number of Top Organizations", choices=TOP_K_CHOICES, value=25)
|
| 115 |
skip_orgs_textbox = gr.Textbox(label="Organizations to Skip (comma-separated)", value="TheBloke,MaziyarPanahi,unsloth,modularai,Gensyn,bartowski")
|
|
|
|
| 1 |
+
# --- START OF FINAL, POLISHED FILE app.py ---
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import pandas as pd
|
|
|
|
| 77 |
fig.update_traces(textinfo="label+value+percent root", hovertemplate="<b>%{label}</b><br>%{value:,} " + count_by + "<br>%{percentRoot:.2%} of total<extra></extra>")
|
| 78 |
return fig
|
| 79 |
|
|
|
|
| 80 |
custom_css = """
|
| 81 |
+
#param-slider-wrapper .tab-like-container { display: none !important; }
|
|
|
|
|
|
|
|
|
|
| 82 |
"""
|
| 83 |
|
| 84 |
with gr.Blocks(title="🤗 ModelVerse Explorer", fill_width=True, css=custom_css) as demo:
|
|
|
|
| 95 |
tag_filter_dropdown = gr.Dropdown(label="Select Tag", choices=TAG_FILTER_CHOICES, value=None, visible=False)
|
| 96 |
pipeline_filter_dropdown = gr.Dropdown(label="Select Pipeline Tag", choices=PIPELINE_TAGS, value=None, visible=False)
|
| 97 |
|
| 98 |
+
# --- FIX 2: Wrapped the slider and its labels in a Group for consistent styling ---
|
| 99 |
+
with gr.Group():
|
| 100 |
+
# --- FIX 1: Added a manual label for the slider ---
|
| 101 |
+
gr.Markdown("<div style='font-weight: 500;'>Model Parameters</div>")
|
| 102 |
+
param_range_slider = RangeSlider(
|
| 103 |
+
minimum=0,
|
| 104 |
+
maximum=len(PARAM_CHOICES) - 1,
|
| 105 |
+
value=PARAM_CHOICES_DEFAULT_INDICES,
|
| 106 |
+
step=1,
|
| 107 |
+
label=None, # Label is now handled by the Markdown above
|
| 108 |
+
show_label=False,
|
| 109 |
+
container=False,
|
| 110 |
+
elem_id="param-slider-wrapper"
|
| 111 |
+
)
|
| 112 |
+
param_range_display = gr.Markdown(f"Range: `{PARAM_CHOICES[0]}` to `{PARAM_CHOICES[-1]}`")
|
| 113 |
|
| 114 |
top_k_dropdown = gr.Dropdown(label="Number of Top Organizations", choices=TOP_K_CHOICES, value=25)
|
| 115 |
skip_orgs_textbox = gr.Textbox(label="Organizations to Skip (comma-separated)", value="TheBloke,MaziyarPanahi,unsloth,modularai,Gensyn,bartowski")
|