Skip to content

Commit

Permalink
Merge pull request #913 from parea-ai/fix-check-score-is-finite
Browse files Browse the repository at this point in the history
fix: failing dataset level eval failing exp results
  • Loading branch information
joschkabraun committed May 29, 2024
2 parents 310c2f7 + ada812a commit 0ef86f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion parea/schemas/log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Any, Dict, List, Optional, Union

import math
from enum import Enum

from attrs import define, field
Expand Down Expand Up @@ -70,9 +71,14 @@ class Log:
@define
class EvaluationResult:
name: str
score: float
score: float = field()
reason: Optional[str] = None

@score.validator
def _check_score_is_finite(self, attribute, value):
if not math.isfinite(value):
raise ValueError(f"Score must be finite, got {value}")


@define
class EvaluatedLog(Log):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "parea-ai"
packages = [{ include = "parea" }]
version = "0.2.163"
version = "0.2.164"
description = "Parea python sdk"
readme = "README.md"
authors = ["joel-parea-ai <[email protected]>"]
Expand Down

0 comments on commit 0ef86f3

Please sign in to comment.