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

fix: update task metadata to allow for null #1448

Merged
merged 1 commit into from
Nov 14, 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
10 changes: 6 additions & 4 deletions mteb/leaderboard/figures.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import numpy as np
import pandas as pd
import plotly.express as px
Expand Down Expand Up @@ -68,7 +70,7 @@ def performance_size_plot(df: pd.DataFrame) -> go.Figure:
hover_name="Model",
)
fig.update_layout(
coloraxis_colorbar=dict(
coloraxis_colorbar=dict( # noqa
title="Max Tokens",
tickvals=[2, 3, 4, 5],
ticktext=[
Expand All @@ -78,7 +80,7 @@ def performance_size_plot(df: pd.DataFrame) -> go.Figure:
"100K",
],
),
hoverlabel=dict(
hoverlabel=dict( # noqa
bgcolor="white",
font_size=16,
),
Expand All @@ -87,7 +89,7 @@ def performance_size_plot(df: pd.DataFrame) -> go.Figure:
textposition="top center",
)
fig.update_layout(
font=dict(size=16, color="black"),
margin=dict(b=20, t=10, l=20, r=10),
font=dict(size=16, color="black"), # noqa
margin=dict(b=20, t=10, l=20, r=10), # noqa
)
return fig
2 changes: 1 addition & 1 deletion mteb/leaderboard/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_means_per_types(df: pd.DataFrame) -> pd.DataFrame:
[name_to_score.get(task_name, np.nan) for task_name in task_names]
)
records.append(
dict(
dict( # noqa
model_name=model_name,
model_revision=model_revision,
task_type=task_type,
Expand Down
7 changes: 5 additions & 2 deletions mteb/load_results/task_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ class TaskResult(BaseModel):

dataset_revision: str
task_name: str
mteb_version: str
mteb_version: str | None
scores: dict[Split, list[ScoresDict]]
evaluation_time: float
evaluation_time: float | None
kg_co2_emissions: float | None = None

@classmethod
Expand Down Expand Up @@ -290,6 +290,9 @@ def from_disk(cls, path: Path, load_historic_data: bool = True) -> TaskResult:
f"Error loading TaskResult from disk. You can try to load historic data by setting `load_historic_data=True`. Error: {e}"
)

if data["mteb_version"] is None:
data.pop("mteb_version")

pre_1_11_load = (
(
"mteb_version" in data
Expand Down
Loading