Skip to content

Commit

Permalink
fix(backend): fix zero devision
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabrouk committed Jul 28, 2024
1 parent d692856 commit 3313ef3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions agenta-backend/agenta_backend/services/evaluators_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,11 @@ def diff(ground_truth: Any, app_output: Any, compare_schema_only: bool) -> float
)

cumulated_score += key_score

average_score = cumulated_score / no_of_keys
return average_score
try:
average_score = cumulated_score / no_of_keys
return average_score
except ZeroDivisionError:
return 0.0


def auto_json_diff(
Expand Down

0 comments on commit 3313ef3

Please sign in to comment.