Skip to content

Commit

Permalink
Merge pull request #128 from vsatyamuralikrishna/refactor/remove-cond…
Browse files Browse the repository at this point in the history
…ition-return-data

Remove redundant condition in evaluate method
  • Loading branch information
dylanbouchard authored Feb 19, 2025
2 parents 5eaeb02 + 68e4063 commit 70c7945
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions langfair/metrics/stereotype/stereotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,12 @@ def evaluate(
metric_values = {}
for metric in self.metrics:
if metric.name in ["Stereotype Classifier"]:
if return_data:
tmp_value = metric.evaluate(
responses=responses,
prompts=prompts,
return_data=return_data,
categories=categories,
)
else:
tmp_value = metric.evaluate(
responses=responses,
prompts=prompts,
return_data=return_data,
categories=categories,
)
tmp_value = metric.evaluate(
responses=responses,
prompts=prompts,
return_data=return_data,
categories=categories,
)
metric_values.update(tmp_value["metrics"])
else:
metric_values[metric.name] = metric.evaluate(responses=responses)
Expand Down

0 comments on commit 70c7945

Please sign in to comment.