- perf_stats aggregator lives in eval/, not model/: the import failed silently and EVERY perf column was empty (not just ttft). Now warns on stderr instead of swallowing. - repeats > 1 get their own checkpoint key (:rep2, :rep3, ...): repeat 2 previously restored repeat 1's predictions and finished instantly with identical scores. rep1 keeps the legacy key (existing checkpoints still resume). - repeats summary: report the MEAN score and aggregate time/tokens over ALL runs (was: last run only). - README: six-benchmark command as the primary example. Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
968 B
Python
34 lines
968 B
Python
"""MMLU (official source: cais/mmlu)."""
|
|
|
|
from ..sample import Sample
|
|
from ..registry import register_dataset
|
|
from ..spec import DatasetSpec
|
|
|
|
_LETTERS = 'ABCDEFGHIJ'
|
|
|
|
|
|
@register_dataset(
|
|
DatasetSpec(
|
|
name='mmlu',
|
|
source='cais/mmlu', # official: https://huggingface.co/datasets/cais/mmlu
|
|
subset='all', # 57 subjects; override with --subset <subject>
|
|
split='test',
|
|
prompt_style='cot_letter', # es contract: CoT + last-line ANSWER
|
|
few_shot_split='dev',
|
|
few_shot_num=5,
|
|
task_type='mcq',
|
|
tags=['knowledge'],
|
|
description='Massive Multitask Language Understanding (official).',
|
|
)
|
|
)
|
|
def mmlu():
|
|
def to_sample(record: dict) -> Sample:
|
|
return Sample(
|
|
input=record['question'],
|
|
choices=list(record['choices']),
|
|
target=_LETTERS[int(record['answer'])],
|
|
metadata={'subject': record.get('subject')},
|
|
)
|
|
|
|
return to_sample
|