MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / evaluate_pass_at_n

Function evaluate_pass_at_n

scripts/eval_aime_benchmark.py:438–452  ·  view source on GitHub ↗

Evaluate if any of the n attempts got the correct answer. Args: attempts (List[Dict]): List of attempt results correct_answer (int): The correct answer Returns: Tuple[bool, Optional[int]]: (whether any attempt was correct, first correct attempt numb

(attempts: List[Dict], correct_answer: int)

Source from the content-addressed store, hash-verified

436 return attempts
437
438def evaluate_pass_at_n(attempts: List[Dict], correct_answer: int) -> Tuple[bool, Optional[int]]:
439 """
440 Evaluate if any of the n attempts got the correct answer.
441
442 Args:
443 attempts (List[Dict]): List of attempt results
444 correct_answer (int): The correct answer
445
446 Returns:
447 Tuple[bool, Optional[int]]: (whether any attempt was correct, first correct attempt number)
448 """
449 for attempt in attempts:
450 if attempt["predicted_answer"] == correct_answer:
451 return True, attempt["attempt_number"]
452 return False, None
453
454def load_existing_results(filename: str) -> List[Dict]:
455 """Load existing results from file if it exists."""

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected