To evaluate a model, you must first generate completions and save them in a JSON Lines (jsonl) format. Each line must contain a task_id and the completion (the code generated without the prompt).
Format:
{"task_id": "Corresponding HumanEval task ID", "completion": "Completion only without the prompt"}
Example usage with human_eval.data utilities:
from human_eval.data import write_jsonl, read_problems
problems = read_problems()
num_samples_per_task = 200
samples = [
dict(task_id=task_id, completion=generate_one_completion(problems[task_id]["prompt"]))
for task_id in problems
for _ in range(num_samples_per_task)
]
write_jsonl("samples.jsonl", samples)