Skip to content

Commit

Permalink
Bugfix of evaluate function in llama_index.py (#1223)
Browse files Browse the repository at this point in the history
Dict in dataset of the evaluate function specified. Does not work ->
Dataset and then check of "ground_truth" in column_names.
  • Loading branch information
vcim authored Aug 27, 2024
1 parent 9dc26e2 commit 7f1073f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ragas/integrations/llama_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit 7f1073f

Please sign in to comment.