Skip to content

Commit

Permalink
Remove default score and add more complete error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothiraldan committed Jan 31, 2025
1 parent b60ac99 commit ff224da
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,11 @@ def _parse_model_output(self, content: str) -> score_result.ScoreResult:
dict_content = json.loads(content)
score: float = float(dict_content["score"])

if not (0.0 <= score <= 1.0):
score = 0.5

return score_result.ScoreResult(
name=self.name, value=score, reason=dict_content["reason"]
)
except Exception as e:
LOGGER.error(f"Failed to parse model output: {e}")
LOGGER.error(f"Failed to parse model output: {e}", exc_info=True)
raise MetricComputationError(
"Failed to parse usefulness score from model output"
f"Failed to parse usefulness score from model output: {repr(e)}"
)

0 comments on commit ff224da

Please sign in to comment.