Improve dropdown titles
Browse files- app.py +42 -0
- views/example_view.py +32 -19
- views/leaderboard_category.py +38 -24
app.py
CHANGED
|
@@ -1051,6 +1051,26 @@ body {
|
|
| 1051 |
background: var(--povisle-surface) !important;
|
| 1052 |
position: relative !important;
|
| 1053 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1054 |
#leaderboard-filter-row > * + *::before {
|
| 1055 |
background: #ddd7d3;
|
| 1056 |
bottom: 18px;
|
|
@@ -1072,6 +1092,28 @@ body {
|
|
| 1072 |
#family-filter {
|
| 1073 |
border-left: 1px dashed #ddd7d3 !important;
|
| 1074 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1075 |
#leaderboard-view-tabs {
|
| 1076 |
border: 0 !important;
|
| 1077 |
box-shadow: none !important;
|
|
|
|
| 1051 |
background: var(--povisle-surface) !important;
|
| 1052 |
position: relative !important;
|
| 1053 |
}
|
| 1054 |
+
.povisle-filter-field,
|
| 1055 |
+
.leaderboard-filter-field {
|
| 1056 |
+
background: var(--povisle-surface) !important;
|
| 1057 |
+
gap: 0 !important;
|
| 1058 |
+
padding: 14px 14px 12px !important;
|
| 1059 |
+
}
|
| 1060 |
+
.povisle-filter-field .block,
|
| 1061 |
+
.povisle-filter-field .form,
|
| 1062 |
+
.povisle-filter-field .wrap,
|
| 1063 |
+
.povisle-filter-field .wrap-inner,
|
| 1064 |
+
.povisle-filter-field .input-container,
|
| 1065 |
+
.leaderboard-filter-field .block,
|
| 1066 |
+
.leaderboard-filter-field .form,
|
| 1067 |
+
.leaderboard-filter-field .wrap,
|
| 1068 |
+
.leaderboard-filter-field .wrap-inner,
|
| 1069 |
+
.leaderboard-filter-field .input-container {
|
| 1070 |
+
background: transparent !important;
|
| 1071 |
+
border: 0 !important;
|
| 1072 |
+
box-shadow: none !important;
|
| 1073 |
+
}
|
| 1074 |
#leaderboard-filter-row > * + *::before {
|
| 1075 |
background: #ddd7d3;
|
| 1076 |
bottom: 18px;
|
|
|
|
| 1092 |
#family-filter {
|
| 1093 |
border-left: 1px dashed #ddd7d3 !important;
|
| 1094 |
}
|
| 1095 |
+
#leaderboard-filter-row label,
|
| 1096 |
+
#leaderboard-filter-row label span,
|
| 1097 |
+
#leaderboard-filter-row .label-wrap,
|
| 1098 |
+
#leaderboard-filter-row .label-wrap span,
|
| 1099 |
+
#leaderboard-filter-row [data-testid="block-label"],
|
| 1100 |
+
#leaderboard-filter-row [data-testid="block-label"] span {
|
| 1101 |
+
color: var(--povisle-ink) !important;
|
| 1102 |
+
opacity: 1 !important;
|
| 1103 |
+
}
|
| 1104 |
+
#leaderboard-filter-row .label-wrap span,
|
| 1105 |
+
#leaderboard-filter-row [data-testid="block-label"] span {
|
| 1106 |
+
font-weight: 700 !important;
|
| 1107 |
+
}
|
| 1108 |
+
#leaderboard-filter-row input,
|
| 1109 |
+
#leaderboard-filter-row textarea,
|
| 1110 |
+
#leaderboard-filter-row [role="combobox"],
|
| 1111 |
+
#leaderboard-filter-row [data-testid="token"],
|
| 1112 |
+
#leaderboard-filter-row .token,
|
| 1113 |
+
#leaderboard-filter-row .selected-token,
|
| 1114 |
+
#leaderboard-filter-row .multiselect-token {
|
| 1115 |
+
color: var(--povisle-ink) !important;
|
| 1116 |
+
}
|
| 1117 |
#leaderboard-view-tabs {
|
| 1118 |
border: 0 !important;
|
| 1119 |
box-shadow: none !important;
|
views/example_view.py
CHANGED
|
@@ -132,27 +132,40 @@ def render_examples_tab(examples_df: pd.DataFrame) -> None:
|
|
| 132 |
initial_subcategory = ALL_OPTION
|
| 133 |
initial_task_type = ALL_OPTION
|
| 134 |
initial_value = filter_examples(examples_df, initial_task_type, initial_category, initial_subcategory)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
with gr.Row(elem_id="examples-filter-row"):
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
examples_table = gr.Dataframe(
|
| 157 |
value=initial_value,
|
| 158 |
headers=EXAMPLE_COLUMNS,
|
|
|
|
| 132 |
initial_subcategory = ALL_OPTION
|
| 133 |
initial_task_type = ALL_OPTION
|
| 134 |
initial_value = filter_examples(examples_df, initial_task_type, initial_category, initial_subcategory)
|
| 135 |
+
filter_label_style = (
|
| 136 |
+
"color: #181416; font-size: 0.86rem; font-weight: 700; "
|
| 137 |
+
"line-height: 1.2; margin: 0 0 8px;"
|
| 138 |
+
)
|
| 139 |
|
| 140 |
with gr.Row(elem_id="examples-filter-row"):
|
| 141 |
+
with gr.Column(elem_classes=["povisle-filter-field"]):
|
| 142 |
+
gr.HTML(f'<div style="{filter_label_style}">Type of task</div>')
|
| 143 |
+
task_type_filter = gr.Dropdown(
|
| 144 |
+
choices=TASK_TYPE_FILTER_OPTIONS,
|
| 145 |
+
value=initial_task_type,
|
| 146 |
+
multiselect=False,
|
| 147 |
+
allow_custom_value=False,
|
| 148 |
+
label="Type of task",
|
| 149 |
+
show_label=False,
|
| 150 |
+
)
|
| 151 |
+
with gr.Column(elem_classes=["povisle-filter-field"]):
|
| 152 |
+
gr.HTML(f'<div style="{filter_label_style}">Category</div>')
|
| 153 |
+
category_filter = gr.Dropdown(
|
| 154 |
+
choices=category_options(examples_df),
|
| 155 |
+
value=initial_category,
|
| 156 |
+
allow_custom_value=False,
|
| 157 |
+
label="Category",
|
| 158 |
+
show_label=False,
|
| 159 |
+
)
|
| 160 |
+
with gr.Column(elem_classes=["povisle-filter-field"]):
|
| 161 |
+
gr.HTML(f'<div style="{filter_label_style}">Subcategory</div>')
|
| 162 |
+
subcategory_filter = gr.Dropdown(
|
| 163 |
+
choices=subcategory_options(examples_df, initial_category),
|
| 164 |
+
value=initial_subcategory,
|
| 165 |
+
allow_custom_value=False,
|
| 166 |
+
label="Subcategory",
|
| 167 |
+
show_label=False,
|
| 168 |
+
)
|
| 169 |
examples_table = gr.Dataframe(
|
| 170 |
value=initial_value,
|
| 171 |
headers=EXAMPLE_COLUMNS,
|
views/leaderboard_category.py
CHANGED
|
@@ -168,31 +168,45 @@ def render_leaderboard_filters(leaderboard_df: pd.DataFrame):
|
|
| 168 |
elem_id="leaderboard-search",
|
| 169 |
)
|
| 170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
with gr.Row(elem_id="leaderboard-filter-row"):
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
return search_box, type_filter, size_filter, family_filter
|
| 198 |
|
|
|
|
| 168 |
elem_id="leaderboard-search",
|
| 169 |
)
|
| 170 |
|
| 171 |
+
filter_label_style = (
|
| 172 |
+
"color: #181416; font-size: 0.86rem; font-weight: 700; "
|
| 173 |
+
"line-height: 1.2; margin: 0 0 8px;"
|
| 174 |
+
)
|
| 175 |
+
|
| 176 |
with gr.Row(elem_id="leaderboard-filter-row"):
|
| 177 |
+
with gr.Column(elem_classes=["povisle-filter-field"]):
|
| 178 |
+
gr.HTML(f'<div style="{filter_label_style}">Model Type</div>')
|
| 179 |
+
type_filter = gr.Dropdown(
|
| 180 |
+
choices=[ALL_OPTION, *available_types],
|
| 181 |
+
value=[ALL_OPTION],
|
| 182 |
+
multiselect=True,
|
| 183 |
+
allow_custom_value=False,
|
| 184 |
+
label="Model Type",
|
| 185 |
+
show_label=False,
|
| 186 |
+
elem_id="type-filter",
|
| 187 |
+
)
|
| 188 |
+
with gr.Column(elem_classes=["povisle-filter-field"]):
|
| 189 |
+
gr.HTML(f'<div style="{filter_label_style}">Size</div>')
|
| 190 |
+
size_filter = gr.Dropdown(
|
| 191 |
+
choices=[ALL_OPTION, *size_options],
|
| 192 |
+
value=[ALL_OPTION],
|
| 193 |
+
multiselect=True,
|
| 194 |
+
allow_custom_value=False,
|
| 195 |
+
label="Size",
|
| 196 |
+
show_label=False,
|
| 197 |
+
elem_id="size-filter",
|
| 198 |
+
)
|
| 199 |
+
with gr.Column(elem_classes=["povisle-filter-field"]):
|
| 200 |
+
gr.HTML(f'<div style="{filter_label_style}">Family</div>')
|
| 201 |
+
family_filter = gr.Dropdown(
|
| 202 |
+
choices=[ALL_OPTION, *family_options],
|
| 203 |
+
value=[ALL_OPTION],
|
| 204 |
+
multiselect=True,
|
| 205 |
+
allow_custom_value=False,
|
| 206 |
+
label="Family",
|
| 207 |
+
show_label=False,
|
| 208 |
+
elem_id="family-filter",
|
| 209 |
+
)
|
| 210 |
|
| 211 |
return search_box, type_filter, size_filter, family_filter
|
| 212 |
|