Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alekszievr committed Jan 17, 2025
1 parent 2944dc3 commit 2df6cd0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions evals/eval_on_hotpot.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def incremental_eval_on_QA_dataset(
return incremental_results


if __name__ == "__main__":
async def main():
parser = argparse.ArgumentParser()

parser.add_argument("--dataset", type=str, required=True, help="Which dataset to evaluate on")
Expand All @@ -135,12 +135,17 @@ async def incremental_eval_on_QA_dataset(
args = parser.parse_args()

if args.rag_option == "cognee_incremental":
avg_scores = asyncio.run(
incremental_eval_on_QA_dataset(args.dataset, args.num_samples, args.metrics)
avg_scores = await incremental_eval_on_QA_dataset(
args.dataset, args.num_samples, args.metrics
)

else:
avg_scores = asyncio.run(
eval_on_QA_dataset(args.dataset, args.rag_option, args.num_samples, args.metrics)
avg_scores = await eval_on_QA_dataset(
args.dataset, args.rag_option, args.num_samples, args.metrics
)

logger.info(f"{avg_scores}")


if __name__ == "__main__":
asyncio.run(main())
2 changes: 1 addition & 1 deletion evals/qa_eval_parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"hotpotqa"
],
"rag_option": [
"cognee_incremental"
"cognee_incremental",
"no_rag",
"simple_rag",
"brute_force"
Expand Down
2 changes: 1 addition & 1 deletion evals/qa_eval_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def save_results_as_image(results, out_path):
for num_samples, table_data in num_samples_data.items():
df = pd.DataFrame.from_dict(table_data, orient="index")
df.index.name = f"Dataset: {dataset}, Num Samples: {num_samples}"
image_path = Path(out_path) / Path(f"table_{dataset}_{num_samples}.png")
image_path = out_path / Path(f"table_{dataset}_{num_samples}.png")
save_table_as_image(df, image_path)


Expand Down

0 comments on commit 2df6cd0

Please sign in to comment.