|
2 | 2 | from pathlib import Path |
3 | 3 | from typing import Union, List |
4 | 4 | from typing_extensions import Annotated |
5 | | -from datasets import load_dataset |
6 | 5 | import commit0.harness.run_pytest_ids |
7 | 6 | import commit0.harness.get_pytest_ids |
8 | 7 | import commit0.harness.build |
@@ -119,10 +118,7 @@ def setup( |
119 | 118 | ) -> None: |
120 | 119 | """Commit0 clone a repo split.""" |
121 | 120 | check_commit0_path() |
122 | | - if "swe" in dataset_name.lower(): |
123 | | - SWE_SPLIT = load_dataset(dataset_name, split=dataset_split)["instance_id"] |
124 | | - check_valid(repo_split, SWE_SPLIT) |
125 | | - else: |
| 121 | + if "commit0" in dataset_name.lower(): |
126 | 122 | check_valid(repo_split, SPLIT) |
127 | 123 |
|
128 | 124 | base_dir = str(Path(base_dir).resolve()) |
@@ -173,12 +169,7 @@ def build( |
173 | 169 | check_commit0_path() |
174 | 170 |
|
175 | 171 | commit0_config = read_commit0_dot_file(commit0_dot_file_path) |
176 | | - if "swe" in commit0_config["dataset_name"].lower(): |
177 | | - SWE_SPLIT = load_dataset( |
178 | | - commit0_config["dataset_name"], split=commit0_config["dataset_split"] |
179 | | - )["instance_id"] |
180 | | - check_valid(commit0_config["repo_split"], SWE_SPLIT) |
181 | | - else: |
| 172 | + if "commit0" in commit0_config["dataset_name"].lower(): |
182 | 173 | check_valid(commit0_config["repo_split"], SPLIT) |
183 | 174 |
|
184 | 175 | typer.echo( |
@@ -210,10 +201,7 @@ def get_tests( |
210 | 201 | ) -> None: |
211 | 202 | """Get tests for a Commit0 repository.""" |
212 | 203 | check_commit0_path() |
213 | | - SWE_SPLIT = load_dataset("princeton-nlp/SWE-bench_Verified", split="test")[ |
214 | | - "instance_id" |
215 | | - ] |
216 | | - check_valid(repo_name, SPLIT_ALL + SWE_SPLIT) |
| 204 | + check_valid(repo_name, SPLIT_ALL) |
217 | 205 |
|
218 | 206 | commit0.harness.get_pytest_ids.main(repo_name, verbose=1) |
219 | 207 |
|
@@ -264,12 +252,7 @@ def test( |
264 | 252 | commit0_config = read_commit0_dot_file(commit0_dot_file_path) |
265 | 253 | if repo_or_repo_path.endswith("/"): |
266 | 254 | repo_or_repo_path = repo_or_repo_path[:-1] |
267 | | - if "swe" in commit0_config["dataset_name"].lower(): |
268 | | - SWE_SPLIT = load_dataset( |
269 | | - commit0_config["dataset_name"], split=commit0_config["dataset_split"] |
270 | | - )["instance_id"] |
271 | | - check_valid(repo_or_repo_path.split("/")[-1], SWE_SPLIT) |
272 | | - else: |
| 255 | + if "commit0" in commit0_config["dataset_name"].lower(): |
273 | 256 | check_valid(repo_or_repo_path.split("/")[-1], SPLIT) |
274 | 257 |
|
275 | 258 | if reference: |
@@ -335,12 +318,7 @@ def evaluate( |
335 | 318 | branch = "reference" |
336 | 319 |
|
337 | 320 | commit0_config = read_commit0_dot_file(commit0_dot_file_path) |
338 | | - if "swe" in commit0_config["dataset_name"].lower(): |
339 | | - SWE_SPLIT = load_dataset( |
340 | | - commit0_config["dataset_name"], split=commit0_config["dataset_split"] |
341 | | - )["instance_id"] |
342 | | - check_valid(commit0_config["repo_split"], SWE_SPLIT) |
343 | | - else: |
| 321 | + if "commit0" in commit0_config["dataset_name"].lower(): |
344 | 322 | check_valid(commit0_config["repo_split"], SPLIT) |
345 | 323 |
|
346 | 324 | typer.echo(f"Evaluating repository split: {commit0_config['repo_split']}") |
@@ -416,12 +394,7 @@ def save( |
416 | 394 | """Save Commit0 split you choose in Setup Stage to GitHub.""" |
417 | 395 | check_commit0_path() |
418 | 396 | commit0_config = read_commit0_dot_file(commit0_dot_file_path) |
419 | | - if "swe" in commit0_config["dataset_name"].lower(): |
420 | | - SWE_SPLIT = load_dataset( |
421 | | - commit0_config["dataset_name"], split=commit0_config["dataset_split"] |
422 | | - )["instance_id"] |
423 | | - check_valid(commit0_config["repo_split"], SWE_SPLIT) |
424 | | - else: |
| 397 | + if "commit0" in commit0_config["dataset_name"].lower(): |
425 | 398 | check_valid(commit0_config["repo_split"], SPLIT) |
426 | 399 |
|
427 | 400 | typer.echo(f"Saving repository split: {commit0_config['repo_split']}") |
|
0 commit comments