Skip to content

Commit ff449fc

Browse files
authored
fix: answer_correctness embedding (#513)
1 parent 0e93396 commit ff449fc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/ragas/metrics/_answer_correctness.py

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def __post_init__(self: t.Self):
104104
if not all([w >= 0 for w in self.weights]):
105105
raise ValueError("Weights must be non-negative")
106106

107+
def init_model(self):
108+
super().init_model()
107109
if self.answer_similarity is None and self.weights[1] != 0:
108110
self.answer_similarity = AnswerSimilarity(
109111
llm=self.llm, batch_size=self.batch_size, embeddings=self.embeddings

tests/benchmarks/benchmark_eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# data
2020
ds = load_dataset("explodinggradients/amnesty_qa", "english")
2121
assert isinstance(ds, DatasetDict)
22-
eval_dataset = ds["train"]
22+
eval_dataset = ds["eval"]
2323

2424
# metrics
2525
metrics = [

0 commit comments

Comments
 (0)