Skip to content

Commit

Permalink
Made bulk loading easier by also allowing first timestamp more genera…
Browse files Browse the repository at this point in the history
…lly.
  • Loading branch information
JoelNiklaus committed Jan 13, 2025
1 parent 3a22d93 commit dae2d2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lighteval/logging/evaluation_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def save_results(self, date_id: str, results_dict: dict):

def _get_details_sub_folder(self, date_id: str):
output_dir_details = Path(self.output_dir) / "details" / self.general_config_logger.model_name
if date_id == "latest":
if date_id in ["first", "last"]:
# Get all folders in output_dir_details
if not self.fs.exists(output_dir_details):
raise FileNotFoundError(f"Details directory {output_dir_details} does not exist")
Expand All @@ -222,8 +222,8 @@ def _get_details_sub_folder(self, date_id: str):
if not folders:
raise FileNotFoundError(f"No timestamp folders found in {output_dir_details}")

# Parse timestamps and get latest
date_id = max(folders)
# Parse timestamps and get first or last
date_id = max(folders) if date_id == "last" else min(folders)
return output_dir_details / date_id

def load_details_datasets(self, date_id: str, task_names: list[str]) -> dict[str, Dataset]:
Expand Down

0 comments on commit dae2d2b

Please sign in to comment.