From 6eab869018c1d48b1bc6e58023a0500b05afdd16 Mon Sep 17 00:00:00 2001 From: YangQianli92 <108046369+YangQianli92@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:30:30 +0800 Subject: [PATCH] Update base.py --- metagpt/rag/benchmark/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/metagpt/rag/benchmark/base.py b/metagpt/rag/benchmark/base.py index 2634f139f..1d8d9c600 100644 --- a/metagpt/rag/benchmark/base.py +++ b/metagpt/rag/benchmark/base.py @@ -2,6 +2,7 @@ import asyncio import json import os from typing import List +from pathlib import Path import evaluate import jieba @@ -159,16 +160,16 @@ class RAGBenchmark: @staticmethod def load_dataset(ds_names: list[str] = ["all"]): - infos = read_json_file(os.path.join(EXAMPLE_BENCHMARK_PATH, "dataset_info.json")) + infos = read_json_file(Path(EXAMPLE_BENCHMARK_PATH) / "dataset_info.json") dataset_config = DatasetConfig( datasets=[ DatasetInfo( name=name, document_files=[ - os.path.join(EXAMPLE_BENCHMARK_PATH, name, file) + Path(EXAMPLE_BENCHMARK_PATH) / name / file, for file in info["document_file"] ], - gt_info=read_json_file(os.path.join(EXAMPLE_BENCHMARK_PATH, name, info["gt_file"])), + gt_info=read_json_file(Path(EXAMPLE_BENCHMARK_PATH) / name / info["gt_file"]), ) for dataset_info in infos for name, info in dataset_info.items()