Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Polishing up leaderboard UI #1461

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions mteb/leaderboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,25 @@ def format_list(props: list[str]):
return ", ".join(props)


def update_task_info(task_names: str) -> str:
def update_task_info(task_names: str) -> gr.DataFrame:
tasks = mteb.get_tasks(tasks=task_names)
df = tasks.to_dataframe()
df = tasks.to_dataframe(
properties=["name", "type", "languages", "domains", "reference", "main_score"]
)
df["languages"] = df["languages"].map(format_list)
df["domains"] = df["domains"].map(format_list)
df["name"] = "[" + df["name"] + "](" + df["reference"] + ")"
df = df.rename(
columns={
"name": "Task Name",
"type": "Task Type",
"languages": "Languages",
"domains": "Domains",
"license": "License",
"main_score": "Metric",
}
)
return df
df = df.drop(columns="reference")
return gr.DataFrame(df, datatype=["markdown"] + ["str"] * (len(df.columns) - 1))


all_results = load_results().filter_models()
Expand Down Expand Up @@ -215,6 +219,9 @@ def update_task_info(task_names: str) -> str:
citation = gr.Markdown(update_citation, inputs=[benchmark_select])
with gr.Column():
plot = gr.Plot(performance_size_plot, inputs=[summary_table])
gr.Markdown(
"*We only display models that have been run on all tasks in the benchmark*"
)
with gr.Tab("Summary"):
summary_table.render()
with gr.Tab("Performance per task"):
Expand Down
2 changes: 1 addition & 1 deletion mteb/leaderboard/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def scores_to_tables(
joint_table_style,
# column_widths=column_widths,
datatype=column_types,
wrap=True,
# wrap=True,
),
gr.DataFrame(per_task_style),
)