MCPcopy Create free account
hub / github.com/OpenCodeInterpreter/OpenCodeInterpreter / check_correctness

Function check_correctness

evaluation/evaluate/utils.py:337–380  ·  view source on GitHub ↗
(
    dataset: str,
    completion_id: int,
    problem: Dict[str, Any],
    solution: str,
    expected_output: Dict[str, List],
    version="base",
    fast_check=False,
    identifier=None,
    min_time_limit: float = 0.1,
    gt_time_limit_factor: float = 2.0,
)

Source from the content-addressed store, hash-verified

335
336
337def check_correctness(
338 dataset: str,
339 completion_id: int,
340 problem: Dict[str, Any],
341 solution: str,
342 expected_output: Dict[str, List],
343 version="base",
344 fast_check=False,
345 identifier=None,
346 min_time_limit: float = 0.1,
347 gt_time_limit_factor: float = 2.0,
348) -> Dict[str, Union[int, Optional[Result]]]:
349 ret = {
350 "completion_id": completion_id,
351 "task_id": problem["task_id"],
352 "_identifier": identifier,
353 }
354
355 ret["base"] = untrusted_check(
356 dataset,
357 solution,
358 problem["base_input"],
359 problem["entry_point"],
360 expected=expected_output["base"],
361 atol=problem["atol"],
362 ref_time=expected_output["base_time"],
363 fast_check=fast_check,
364 min_time_limit=min_time_limit,
365 gt_time_limit_factor=gt_time_limit_factor,
366 )
367 if version=="plus":
368 ret["plus"] = untrusted_check(
369 dataset,
370 solution,
371 problem["plus_input"],
372 problem["entry_point"],
373 expected=expected_output["plus"],
374 atol=problem["atol"],
375 ref_time=expected_output["plus_time"],
376 fast_check=fast_check,
377 min_time_limit=min_time_limit,
378 gt_time_limit_factor=gt_time_limit_factor,
379 )
380 return ret

Callers 4

generate_multi_roundFunction · 0.90
generate_multi_roundFunction · 0.90
generate_multi_roundFunction · 0.90
generate_multi_roundFunction · 0.90

Calls 1

untrusted_checkFunction · 0.70

Tested by

no test coverage detected