Skip to content

Commit 7f1073f

Browse files
authored
Bugfix of evaluate function in llama_index.py (#1223)
Dict in dataset of the evaluate function specified. Does not work -> Dataset and then check of "ground_truth" in column_names.
1 parent 9dc26e2 commit 7f1073f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ragas/integrations/llama_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def validate_dataset(dataset: dict, metrics: list[Metric]):
4343

4444
def evaluate(
4545
query_engine,
46-
dataset: dict,
46+
dataset: Dataset,
4747
metrics: list[Metric],
4848
llm: t.Optional[LlamaindexLLM] = None,
4949
embeddings: t.Optional[LlamaIndexEmbeddings] = None,
@@ -98,7 +98,7 @@ def evaluate(
9898
"answer": answers,
9999
}
100100
)
101-
if "ground_truth" in dataset:
101+
if "ground_truth" in dataset.column_names:
102102
hf_dataset = hf_dataset.add_column(
103103
name="ground_truth",
104104
column=dataset["ground_truth"],

0 commit comments

Comments
 (0)