Skip to content

Commit

Permalink
fix info logger path (in case of git repo path problems)
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier committed Feb 8, 2024
1 parent 163e038 commit a39d6a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lighteval/logging/info_loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ class GeneralConfigLogger:

def __init__(self) -> None:
"""Stores the current lighteval commit for reproducibility, and starts the evaluation timer."""
repo = git.Repo(os.path.dirname(__file__).split("src")[0])
self.lighteval_sha = repo.git.rev_parse("HEAD")
try:
repo = git.Repo(os.path.dirname(__file__).split("src")[0])
except git.InvalidGitRepositoryError:
repo = None

self.lighteval_sha = repo.git.rev_parse("HEAD") if repo is not None else "?"
self.start_time = time.perf_counter()

def log_args_info(
Expand Down

0 comments on commit a39d6a3

Please sign in to comment.