diff --git a/opencompass/datasets/__init__.py b/opencompass/datasets/__init__.py index 51c5228d..dd75241e 100644 --- a/opencompass/datasets/__init__.py +++ b/opencompass/datasets/__init__.py @@ -49,9 +49,9 @@ from .ds1000_interpreter import * # noqa: F401, F403 from .eprstmt import * # noqa: F401, F403 from .FinanceIQ import * # noqa: F401, F403 from .flores import * # noqa: F401, F403 +from .gaia import * # noqa: F401, F403 from .game24 import * # noqa: F401, F403 from .gaokao_math import * # noqa: F401, F403 -from .gaia import * # noqa: F401, F403 from .GaokaoBench import * # noqa: F401, F403 from .generic import * # noqa: F401, F403 from .govrepcrs import * # noqa: F401, F403 diff --git a/opencompass/datasets/gaia.py b/opencompass/datasets/gaia.py index 9db1e5fd..841dffc9 100644 --- a/opencompass/datasets/gaia.py +++ b/opencompass/datasets/gaia.py @@ -1,11 +1,10 @@ import json -from os import environ import os +from os import environ from datasets import Dataset from opencompass.registry import LOAD_DATASET -from opencompass.utils import get_data_path from opencompass.utils.datasets_info import DATASETS_MAPPING from .base import BaseDataset @@ -33,7 +32,7 @@ class GAIADataset(BaseDataset): 'level': item['Level'] }) except Exception as e: - print(f"Error loading local file: {e}") + print(f'Error loading local file: {e}') else: # 从本地读取 compass_data_cache = os.environ.get('COMPASS_DATA_CACHE') @@ -49,12 +48,13 @@ class GAIADataset(BaseDataset): 'file_name': line['file_name'], 'level': line['Level'] } - + # 只有在file_name不为空时设置file_path if line['file_name']: - row_data['file_path'] = f'{local_path}/{line["file_name"]}' + file_name = line['file_name'] + row_data['file_path'] = f'{local_path}/{file_name}' else: row_data['file_path'] = '' - + rows.append(row_data) return Dataset.from_list(rows)