[Fix] Update get_data_path for LCBench and HumanEval (#1375)

This commit is contained in:
Songyang Zhang 2024-07-29 19:28:09 +08:00 committed by GitHub
parent fea11b1d20
commit eee5a5be23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@ from datasets import DatasetDict, concatenate_datasets, load_dataset
from opencompass.openicl.icl_evaluator import BaseEvaluator
from opencompass.registry import ICL_EVALUATORS, LOAD_DATASET
from opencompass.utils import get_data_path
from .base import BaseDataset
@ -37,6 +38,7 @@ class LCDataset(BaseDataset):
num_repeats(int): Number of repetition for this dataset to get
multiple responses in special cases.
"""
path = get_data_path(path, local_mode=True)
def processing_test(example):
example['test_case'] = example['test_list']

View File

@ -33,7 +33,7 @@ pip install -e evalplus'''
class HumanevalDataset(BaseDataset):
@staticmethod
def load(path: str, num_repeats: int = 1):
def load(path: str, num_repeats: int = 1, local_mode: bool = False):
"""Load humaneval dataset for pass k mode.
Note that you can use num_repeats > 1 when your model does not support
@ -49,7 +49,7 @@ class HumanevalDataset(BaseDataset):
num_repeats(int): Number of repetition for this dataset to get
multiple responses in special cases.
"""
path = get_data_path(path)
path = get_data_path(path, local_mode=local_mode)
if environ.get('DATASET_SOURCE') == 'ModelScope':
from modelscope import MsDataset
dataset = MsDataset.load(path, subset_name='openai_humaneval', split='test')