traj-mc / code /eval /lm_tasks /code_instruct /mbpp_instruct.yaml
ttishere's picture
Publish code/eval
76d1db9 verified
Raw History Blame Contribute Delete
1.47 kB
# Chat-aware MBPP for LLaDA-8B-Instruct. Stock mbpp.yaml has NO filter at all -- the
# raw response string is executed -- so a chat answer ("Here's the code: ```python...")
# fails on prose exactly like humaneval does. Added here:
# filter_fn: extract_code_mbpp (falls back to the raw string when unfenced)
# until: keeps "[DONE]", which the 3-shot exemplars teach the model to emit,
# and adds <|eot_id|> for the turns where it answers in chat style.
# Everything else, including the fewshot exemplars, is the stock task.
task: mbpp_instruct
dataset_path: google-research-datasets/mbpp
dataset_name: full
unsafe_code: true
output_type: generate_until
test_split: test
doc_to_text: "You are an expert Python programmer, and here is your task: {{text}} Your code should pass these tests:\n\n{{test_list[0]}}\n{{test_list[1]}}\n{{test_list[2]}}\n[BEGIN]\n"
doc_to_target: "{% if is_fewshot is defined %}{{code}}\n[DONE]{% else %}{{test_list[0]}}\n{{test_list[1]}}\n{{test_list[2]}}{% endif %}"
target_delimiter: ""
metric_list:
- metric: !function utils.pass_at_1
aggregation: mean
higher_is_better: true
generation_kwargs:
until:
- "[DONE]"
- "<|eot_id|>"
do_sample: false
num_fewshot: 3
fewshot_config:
sampler: first_n
samples: !function utils.list_fewshot_samples
filter_list:
- name: "extract_code"
filter:
- function: "custom"
filter_fn: !function utils.extract_code_mbpp
metadata:
version: 1.0