Spaces:
Running
Running
Mandark-droid
commited on
Commit
·
c4cc2c2
1
Parent(s):
97b96ca
Wire up sidebar filters to filter leaderboard and drilldown data
Browse files
app.py
CHANGED
|
@@ -304,6 +304,27 @@ with gr.Blocks(title="TraceMind-AI") as app:
|
|
| 304 |
outputs=[leaderboard_table]
|
| 305 |
)
|
| 306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
viz_type.change(
|
| 308 |
fn=update_analytics,
|
| 309 |
inputs=[viz_type],
|
|
|
|
| 304 |
outputs=[leaderboard_table]
|
| 305 |
)
|
| 306 |
|
| 307 |
+
# Sidebar filter handlers
|
| 308 |
+
def apply_sidebar_model_filter(model, sort_by_col):
|
| 309 |
+
"""Apply sidebar model filter to leaderboard"""
|
| 310 |
+
return apply_filters(model, "All", sort_by_col), gr.update(value=model)
|
| 311 |
+
|
| 312 |
+
sidebar_model_filter.change(
|
| 313 |
+
fn=apply_sidebar_model_filter,
|
| 314 |
+
inputs=[sidebar_model_filter, sort_by],
|
| 315 |
+
outputs=[leaderboard_by_model, model_filter]
|
| 316 |
+
)
|
| 317 |
+
|
| 318 |
+
def apply_sidebar_agent_type_filter(agent_type):
|
| 319 |
+
"""Apply sidebar agent type filter to drilldown"""
|
| 320 |
+
return load_drilldown(agent_type, "All"), gr.update(value=agent_type)
|
| 321 |
+
|
| 322 |
+
sidebar_agent_type_filter.change(
|
| 323 |
+
fn=apply_sidebar_agent_type_filter,
|
| 324 |
+
inputs=[sidebar_agent_type_filter],
|
| 325 |
+
outputs=[leaderboard_table, drilldown_agent_type]
|
| 326 |
+
)
|
| 327 |
+
|
| 328 |
viz_type.change(
|
| 329 |
fn=update_analytics,
|
| 330 |
inputs=[viz_type],
|