Spaces:
Runtime error
Runtime error
Madhavan Iyengar
commited on
Commit
·
741f250
1
Parent(s):
3a99aac
remove unwanted ui elements
Browse files
app.py
CHANGED
@@ -79,10 +79,10 @@ leaderboard_df[numeric_cols] = leaderboard_df[numeric_cols].applymap(custom_form
|
|
79 |
def update_table(
|
80 |
hidden_df: pd.DataFrame,
|
81 |
columns: list,
|
82 |
-
type_query: list,
|
83 |
-
precision_query: str,
|
84 |
-
size_query: list,
|
85 |
-
show_deleted: bool,
|
86 |
query: str,
|
87 |
):
|
88 |
# filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted)
|
@@ -119,13 +119,13 @@ def filter_queries(query: str, filtered_df: pd.DataFrame) -> pd.DataFrame:
|
|
119 |
final_df.append(temp_filtered_df)
|
120 |
if len(final_df) > 0:
|
121 |
filtered_df = pd.concat(final_df)
|
122 |
-
|
123 |
-
|
124 |
-
)
|
125 |
|
126 |
return filtered_df
|
127 |
|
128 |
|
|
|
129 |
def filter_models(
|
130 |
df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool
|
131 |
) -> pd.DataFrame:
|
@@ -180,33 +180,12 @@ with demo:
|
|
180 |
elem_id="column-select",
|
181 |
interactive=True,
|
182 |
)
|
183 |
-
with gr.Row():
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
with gr.Column(min_width=320):
|
188 |
#with gr.Box(elem_id="box-filter"):
|
189 |
-
filter_columns_type = gr.CheckboxGroup(
|
190 |
-
label="Model types",
|
191 |
-
choices=[t.to_str() for t in ModelType],
|
192 |
-
value=[t.to_str() for t in ModelType],
|
193 |
-
interactive=True,
|
194 |
-
elem_id="filter-columns-type",
|
195 |
-
)
|
196 |
-
filter_columns_precision = gr.CheckboxGroup(
|
197 |
-
label="Precision",
|
198 |
-
choices=[i.value.name for i in Precision],
|
199 |
-
value=[i.value.name for i in Precision],
|
200 |
-
interactive=True,
|
201 |
-
elem_id="filter-columns-precision",
|
202 |
-
)
|
203 |
-
filter_columns_size = gr.CheckboxGroup(
|
204 |
-
label="Model sizes (in billions of parameters)",
|
205 |
-
choices=list(NUMERIC_INTERVALS.keys()),
|
206 |
-
value=list(NUMERIC_INTERVALS.keys()),
|
207 |
-
interactive=True,
|
208 |
-
elem_id="filter-columns-size",
|
209 |
-
)
|
210 |
|
211 |
leaderboard_table = gr.components.Dataframe(
|
212 |
value=leaderboard_df[
|
@@ -232,30 +211,26 @@ with demo:
|
|
232 |
[
|
233 |
hidden_leaderboard_table_for_search,
|
234 |
shown_columns,
|
235 |
-
|
236 |
-
filter_columns_precision,
|
237 |
-
filter_columns_size,
|
238 |
-
deleted_models_visibility,
|
239 |
search_bar,
|
240 |
],
|
241 |
leaderboard_table,
|
242 |
)
|
243 |
-
|
|
|
244 |
selector.change(
|
245 |
update_table,
|
246 |
[
|
247 |
hidden_leaderboard_table_for_search,
|
248 |
shown_columns,
|
249 |
-
|
250 |
-
filter_columns_precision,
|
251 |
-
filter_columns_size,
|
252 |
-
deleted_models_visibility,
|
253 |
search_bar,
|
254 |
],
|
255 |
leaderboard_table,
|
256 |
queue=True,
|
257 |
)
|
258 |
|
|
|
259 |
with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):
|
260 |
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
261 |
|
|
|
79 |
def update_table(
|
80 |
hidden_df: pd.DataFrame,
|
81 |
columns: list,
|
82 |
+
# type_query: list,
|
83 |
+
# precision_query: str,
|
84 |
+
# size_query: list,
|
85 |
+
# show_deleted: bool,
|
86 |
query: str,
|
87 |
):
|
88 |
# filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted)
|
|
|
119 |
final_df.append(temp_filtered_df)
|
120 |
if len(final_df) > 0:
|
121 |
filtered_df = pd.concat(final_df)
|
122 |
+
existing_columns = [col for col in [AutoEvalColumn.model.name, AutoEvalColumn.precision.name, AutoEvalColumn.revision.name] if col in filtered_df.columns]
|
123 |
+
filtered_df = filtered_df.drop_duplicates(subset=existing_columns)
|
|
|
124 |
|
125 |
return filtered_df
|
126 |
|
127 |
|
128 |
+
|
129 |
def filter_models(
|
130 |
df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool
|
131 |
) -> pd.DataFrame:
|
|
|
180 |
elem_id="column-select",
|
181 |
interactive=True,
|
182 |
)
|
183 |
+
# with gr.Row():
|
184 |
+
# deleted_models_visibility = gr.Checkbox(
|
185 |
+
# value=False, label="Show gated/private/deleted models", interactive=True
|
186 |
+
# )
|
187 |
+
# with gr.Column(min_width=320):
|
188 |
#with gr.Box(elem_id="box-filter"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
leaderboard_table = gr.components.Dataframe(
|
191 |
value=leaderboard_df[
|
|
|
211 |
[
|
212 |
hidden_leaderboard_table_for_search,
|
213 |
shown_columns,
|
214 |
+
# deleted_models_visibility,
|
|
|
|
|
|
|
215 |
search_bar,
|
216 |
],
|
217 |
leaderboard_table,
|
218 |
)
|
219 |
+
|
220 |
+
for selector in [shown_columns]:
|
221 |
selector.change(
|
222 |
update_table,
|
223 |
[
|
224 |
hidden_leaderboard_table_for_search,
|
225 |
shown_columns,
|
226 |
+
# deleted_models_visibility,
|
|
|
|
|
|
|
227 |
search_bar,
|
228 |
],
|
229 |
leaderboard_table,
|
230 |
queue=True,
|
231 |
)
|
232 |
|
233 |
+
|
234 |
with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):
|
235 |
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
236 |
|