Skip to content

Commit

Permalink
Fix push_details_to_hub
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Dec 18, 2024
1 parent 2b0f03d commit d0f1bad
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/lighteval/logging/evaluation_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,14 @@ def push_details_to_hub(self, repo_id: str, path_in_repo: str, private: bool | N
repo_id = repo_id if "/" in repo_id else f"{self.hub_results_org}/{repo_id}"
private = private if private is not None else not self.public
self.api.create_repo(repo_id, private=private, repo_type="dataset", exist_ok=True)
details_json = "\n".join([json.dumps(detail) for detail in self.details])
self.api.upload_file(
repo_id=repo_id,
path_or_fileobj=details_json.encode(),
path_in_repo=path_in_repo,
repo_type="dataset",
)
for task_name, details in self.details:
details_json = "\n".join([json.dumps(detail) for detail in details])
self.api.upload_file(
repo_id=repo_id,
path_or_fileobj=details_json.encode(),
path_in_repo=path_in_repo.format(task_name=task_name),
repo_type="dataset",
)

def recreate_metadata_card(self, repo_id: str) -> None: # noqa: C901
"""Fully updates the details repository metadata card for the currently evaluated model
Expand Down

0 comments on commit d0f1bad

Please sign in to comment.