From 2a8a37044f0c07fd22b80a898bc9ad076077826b Mon Sep 17 00:00:00 2001 From: Kenneth Enevoldsen Date: Thu, 14 Nov 2024 11:34:10 +0100 Subject: [PATCH] fix: Unsure TaskResults can handle runtime and version being unspecified --- mteb/load_results/task_results.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mteb/load_results/task_results.py b/mteb/load_results/task_results.py index ce2e97965..202ed9b5f 100644 --- a/mteb/load_results/task_results.py +++ b/mteb/load_results/task_results.py @@ -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 @@ -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