Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza committed Jan 10, 2024
1 parent bbf7c4d commit 850b57b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions haystack/evaluation/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(
Metric.SAS: self._calculate_sas,
}

# pylint: disable=too-many-return-statements
def calculate_metrics(self, metric: Union[Metric, Callable[..., MetricsResult]], **kwargs) -> MetricsResult:
"""
Calculate evaluation metrics based on the provided Metric or using the custom metric function.
Expand All @@ -49,7 +48,7 @@ def calculate_metrics(self, metric: Union[Metric, Callable[..., MetricsResult]],
:return: MetricsResult containing the calculated metric.
"""

if metric in self._supported_metrics:
if isinstance(metric, Metric):
return self._supported_metrics[metric](**kwargs)

return metric(self, **kwargs)
Expand Down

0 comments on commit 850b57b

Please sign in to comment.