Parse command-line arguments for the SWE-Bench runner.
()
| 48 | |
| 49 | |
| 50 | def parse_args(): |
| 51 | """Parse command-line arguments for the SWE-Bench runner.""" |
| 52 | # Get the full path to the repo root |
| 53 | repo_root = Path(__file__).parent.parent.parent.parent.absolute() |
| 54 | default_workflow = ( |
| 55 | repo_root / "src/benchmarks/swe_bench_verified/swe_bench_agent.yaml" |
| 56 | ) |
| 57 | |
| 58 | parser = argparse.ArgumentParser(description="Run SWE-Bench-Verified benchmark") |
| 59 | parser.add_argument( |
| 60 | "--dataset", |
| 61 | type=str, |
| 62 | default="princeton-nlp/SWE-bench_Verified", |
| 63 | help="HuggingFace dataset to use (default: princeton-nlp/SWE-bench_Verified)", |
| 64 | ) |
| 65 | parser.add_argument( |
| 66 | "--split", |
| 67 | type=str, |
| 68 | default="test", |
| 69 | help="Split of the dataset to run (default: test, options: test, verified, lite)", |
| 70 | ) |
| 71 | parser.add_argument( |
| 72 | "--workflow-file", |
| 73 | type=str, |
| 74 | default=str(default_workflow), |
| 75 | help="Path to YAML workflow file", |
| 76 | ) |
| 77 | parser.add_argument( |
| 78 | "--model", |
| 79 | type=str, |
| 80 | default="gpt-5", |
| 81 | help="Model to use for the agent", |
| 82 | ) |
| 83 | from harness.paths import outputs_root |
| 84 | |
| 85 | parser.add_argument( |
| 86 | "--output-dir", |
| 87 | type=str, |
| 88 | default=str(outputs_root() / "swe_bench_results"), |
| 89 | help="Directory to save results and patches", |
| 90 | ) |
| 91 | parser.add_argument( |
| 92 | "--instance-ids", |
| 93 | type=str, |
| 94 | nargs="+", |
| 95 | help="List of specific instance IDs to run (e.g., django__django-10880 flask__flask-5063)", |
| 96 | ) |
| 97 | parser.add_argument( |
| 98 | "--save-logs", |
| 99 | action="store_true", |
| 100 | help="Save all print logs to a file for each instance", |
| 101 | ) |
| 102 | parser.add_argument( |
| 103 | "--dashboard", |
| 104 | action="store_true", |
| 105 | help="Start the dashboard and point it at the output directory", |
| 106 | ) |
| 107 | parser.add_argument( |