Skip to content

Commit

Permalink
Arena leaderboard: add checkbox to hide proprietary models
Browse files Browse the repository at this point in the history
  • Loading branch information
juodumas committed Jan 9, 2025
1 parent 8664268 commit 8d9a195
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fastchat/serve/monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def arena_hard_process(leaderboard_table_file, filepath):


def get_arena_table(
arena_df, model_table_df, arena_subset_df=None, hidden_models=None, is_overall=False
arena_df, model_table_df, arena_subset_df=None, hidden_models=None, is_overall=False,
hide_proprietary=False
):
arena_df = arena_df.sort_values(
by=["final_ranking", "rating"], ascending=[True, False]
Expand Down Expand Up @@ -315,6 +316,9 @@ def process_row(row):
print(f"Warning: {model_key} not found in model table")
return None

if hide_proprietary and model_info.get("License", "Unknown").startswith('Propr'):
return None

ranking = row.get("final_ranking") or row.name + 1
result = [ranking if isinstance(ranking, str) else int(ranking)]

Expand Down Expand Up @@ -483,6 +487,7 @@ def update_leaderboard_and_plots(category, filters):
else deprecated_model_name
),
is_overall=category == "Overall",
hide_proprietary="Hide Proprietary" in filters,
)
if category != "Overall":
arena_values = update_leaderboard_df(arena_values)
Expand Down Expand Up @@ -590,7 +595,7 @@ def update_leaderboard_and_plots(category, filters):
)
with gr.Column(scale=2):
category_checkbox = gr.CheckboxGroup(
["Style Control", "Show Deprecated"],
["Style Control", "Show Deprecated", "Hide Proprietary"],
label="Apply filter",
info="",
)
Expand Down

0 comments on commit 8d9a195

Please sign in to comment.