Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 9, 2024
1 parent e77e58c commit e4cd9c6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions evals/metrics/ragas/ragas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def format_ragas_metric_name(name: str):
return f"{name} (ragas)"






class RagasMetric:
"""This metric checks if the output is more than 3 letters."""

Expand Down Expand Up @@ -64,7 +60,7 @@ def __init__(
from datasets import Dataset
except ModuleNotFoundError:
raise ModuleNotFoundError("Please install dataset")

self.metrics_instance = {
"answer_correctness": answer_correctness,
"answer_relevancy": answer_relevancy,
Expand Down Expand Up @@ -110,9 +106,9 @@ def __init__(
if metric == "answer_relevancy" and self.embeddings is None:
raise ValueError("answer_relevancy metric need provide embeddings model.")
tmp_metrics.append(self.metrics_instance[metric])

self.metrics = tmp_metrics

else: # default metrics
self.metrics = [
answer_relevancy,
Expand All @@ -122,7 +118,6 @@ def __init__(
context_precision,
context_recall,
]


async def a_measure(self, test_case: Dict):
return self.measure(test_case)
Expand Down

0 comments on commit e4cd9c6

Please sign in to comment.