From 32e178962d291f45a7aee9ba946aebd95606464a Mon Sep 17 00:00:00 2001 From: vcim <132882956+vcim@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:33:07 +0200 Subject: [PATCH] Bugfix llama_index.py Dict in dataset of the evaluate function specified. Does not work -> Dataset and then check of "ground_truth" in column_names. --- src/ragas/integrations/llama_index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ragas/integrations/llama_index.py b/src/ragas/integrations/llama_index.py index ff9c5b84e..7ba31b732 100644 --- a/src/ragas/integrations/llama_index.py +++ b/src/ragas/integrations/llama_index.py @@ -43,7 +43,7 @@ def validate_dataset(dataset: dict, metrics: list[Metric]): def evaluate( query_engine, - dataset: dict, + dataset: Dataset, metrics: list[Metric], llm: t.Optional[LlamaindexLLM] = None, embeddings: t.Optional[LlamaIndexEmbeddings] = None, @@ -98,7 +98,7 @@ def evaluate( "answer": answers, } ) - if "ground_truth" in dataset: + if "ground_truth" in dataset.column_names: hf_dataset = hf_dataset.add_column( name="ground_truth", column=dataset["ground_truth"],