32 lines
958 B
Python
32 lines
958 B
Python
"""HumanEval (official source: openai/openai_humaneval)."""
|
|
|
|
from ..sample import Sample
|
|
from ..registry import register_dataset
|
|
from ..spec import DatasetSpec
|
|
|
|
|
|
@register_dataset(
|
|
DatasetSpec(
|
|
name='humaneval',
|
|
source='openai/openai_humaneval', # official: https://huggingface.co/datasets/openai/openai_humaneval
|
|
split='test',
|
|
gen_config={'temperature': 1.0, 'max_tokens': 32768},
|
|
task_type='coding',
|
|
tags=['code'],
|
|
description='OpenAI HumanEval function synthesis (official). Tests in metadata for sandbox.',
|
|
)
|
|
)
|
|
def humaneval():
|
|
def to_sample(record: dict) -> Sample:
|
|
return Sample(
|
|
input=record['prompt'],
|
|
target=record['canonical_solution'],
|
|
metadata={
|
|
'task_id': record['task_id'],
|
|
'test': record['test'],
|
|
'entry_point': record['entry_point'],
|
|
},
|
|
)
|
|
|
|
return to_sample
|