| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | """Run the gpt-oss GPQA evaluator with an explicit output-token budget.""" |
| 4 | |
| 5 | import argparse |
| 6 | |
| 7 | from gpt_oss.evals.gpqa_eval import GPQAEval |
| 8 | from gpt_oss.evals.responses_sampler import ResponsesSampler |
| 9 | |
| 10 | |
| 11 | def main() -> None: |
| 12 | parser = argparse.ArgumentParser() |
| 13 | parser.add_argument("--model", required=True) |
| 14 | parser.add_argument("--reasoning-effort", required=True) |
| 15 | parser.add_argument("--base-url", required=True) |
| 16 | parser.add_argument("--n-threads", required=True, type=int) |
| 17 | parser.add_argument("--max-output-tokens", required=True, type=int) |
| 18 | args = parser.parse_args() |
| 19 | |
| 20 | sampler = ResponsesSampler( |
| 21 | model=args.model, |
| 22 | reasoning_model=True, |
| 23 | reasoning_effort=args.reasoning_effort, |
| 24 | base_url=args.base_url, |
| 25 | max_tokens=args.max_output_tokens, |
| 26 | ) |
| 27 | result = GPQAEval(n_repeats=8, n_threads=args.n_threads)(sampler) |
| 28 | # gpt-oss returns a NumPy scalar. Convert it so the parent process gets a |
| 29 | # stable, dependency-independent representation that its regex can parse. |
| 30 | print({"metric": float(result.score)}) |
| 31 | |
| 32 | |
| 33 | if __name__ == "__main__": |
| 34 | main() |