mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
[Fix] Update get_data_path for LCBench and HumanEval (#1375)
This commit is contained in:
parent
fea11b1d20
commit
eee5a5be23
@ -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']
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user