Skip to content

Commit

Permalink
typo fix + fixes json encoder to fit metric storage
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier committed Jul 5, 2024
1 parent b3cfbc2 commit 417a7aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lighteval/logging/evaluation_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import time
from dataclasses import asdict, is_dataclass
from datetime import datetime
from enum import Enum
from pathlib import Path

from datasets import Dataset, load_dataset
Expand Down Expand Up @@ -59,6 +60,8 @@ def default(self, o):
return asdict(o)
if callable(o):
return o.__name__
if isinstance(o, Enum):
return o.name
return super().default(o)


Expand Down
2 changes: 1 addition & 1 deletion src/lighteval/metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def compute(self, **kwargs) -> dict: # result: Union[list[ModelReturn], ModelRe
return {}
if isinstance(self, MetricGrouping):
return self.sample_level_fn(**kwargs) # result, formatted_doc,
return {self.name: self.sample_level_fn(**kwargs)} # result, formatted_doc,
return {self.metric_name: self.sample_level_fn(**kwargs)} # result, formatted_doc,


@dataclass
Expand Down

0 comments on commit 417a7aa

Please sign in to comment.