Skip to content

Commit

Permalink
fix: update task metadata to allow for null
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen committed Nov 14, 2024
1 parent 3a1a470 commit 573f111
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
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

0 comments on commit 573f111

Please sign in to comment.