Create a 5-instance subset for quick testing.
()
| 77 | |
| 78 | |
| 79 | def make_small_subset() -> None: |
| 80 | """Create a 5-instance subset for quick testing.""" |
| 81 | subset_path = DATA_DIR / "swe_bench_lite_5.json" |
| 82 | if subset_path.exists(): |
| 83 | return |
| 84 | |
| 85 | instances = json.loads(JSON_PATH.read_text()) |
| 86 | # Pick instances from different repos for variety |
| 87 | seen_repos: set[str] = set() |
| 88 | subset: list[dict] = [] |
| 89 | for inst in instances: |
| 90 | repo = inst["repo"] |
| 91 | if repo not in seen_repos and len(subset) < 5: |
| 92 | subset.append(inst) |
| 93 | seen_repos.add(repo) |
| 94 | |
| 95 | subset_path.write_text(json.dumps(subset, indent=2)) |
| 96 | repos = [s["repo"] for s in subset] |
| 97 | print(f"Created 5-instance subset: {subset_path}") |
| 98 | print(f" Repos: {', '.join(repos)}") |
| 99 | |
| 100 | |
| 101 | def main() -> None: |