Skip to content

Commit fa81bc4

Browse files
authored
Merge pull request #102 from commit-0/integration
Integration with humaneval
2 parents d9a9954 + 9763f89 commit fa81bc4

File tree

1,013 files changed

+520
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,013 files changed

+520
-200
lines changed

agent/run_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def run_agent_for_repo(
134134
local_repo, "HEAD", example["base_commit"]
135135
)
136136
# Call the commit0 get-tests command to retrieve test files
137-
test_files_str = get_tests(repo_name, verbose=0)
137+
test_files_str = [xx for x in get_tests(repo_name, verbose=0) for xx in x]
138138
test_files = sorted(list(set([i.split(":")[0] for i in test_files_str])))
139139

140140
# prepare the log dir

agent/run_agent_no_rich.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def run_agent_for_repo(
9696
local_repo, "HEAD", example["base_commit"]
9797
)
9898
# Call the commit0 get-tests command to retrieve test files
99-
test_files_str = get_tests(repo_name, verbose=0)
99+
test_files_str = [xx for x in get_tests(repo_name, verbose=0) for xx in x]
100100
test_files = sorted(list(set([i.split(":")[0] for i in test_files_str])))
101101

102102
# prepare the log dir

commit0/cli.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def setup(
118118
) -> None:
119119
"""Commit0 clone a repo split."""
120120
check_commit0_path()
121-
check_valid(repo_split, SPLIT)
121+
if "commit0" in dataset_name.split("/")[-1].lower():
122+
check_valid(repo_split, SPLIT)
122123

123124
base_dir = str(Path(base_dir).resolve())
124125

@@ -168,7 +169,8 @@ def build(
168169
check_commit0_path()
169170

170171
commit0_config = read_commit0_config_file(commit0_config_file)
171-
check_valid(commit0_config["repo_split"], SPLIT)
172+
if "commit0" in commit0_config["dataset_name"].split("/")[-1].lower():
173+
check_valid(commit0_config["repo_split"], SPLIT)
172174

173175
typer.echo(
174176
f"Building repository for split: {highlight(commit0_config['repo_split'], Colors.ORANGE)}"
@@ -199,7 +201,6 @@ def get_tests(
199201
) -> None:
200202
"""Get tests for a Commit0 repository."""
201203
check_commit0_path()
202-
check_valid(repo_name, SPLIT_ALL)
203204

204205
commit0.harness.get_pytest_ids.main(repo_name, verbose=1)
205206

@@ -247,19 +248,23 @@ def test(
247248
) -> None:
248249
"""Run tests on a Commit0 repository."""
249250
check_commit0_path()
251+
commit0_config = read_commit0_config_file(commit0_config_file)
250252
if repo_or_repo_path.endswith("/"):
251253
repo_or_repo_path = repo_or_repo_path[:-1]
252-
check_valid(repo_or_repo_path.split("/")[-1], SPLIT_ALL)
253-
254-
commit0_config = read_commit0_config_file(commit0_config_file)
254+
if "commit0" in commit0_config["dataset_name"].split("/")[-1].lower():
255+
check_valid(repo_or_repo_path.split("/")[-1], SPLIT)
255256

256257
if reference:
257258
branch = "reference"
258-
if branch is None and not reference:
259-
git_path = os.path.join(
260-
commit0_config["base_dir"], repo_or_repo_path.split("/")[-1]
261-
)
262-
branch = get_active_branch(git_path)
259+
else:
260+
if "humaneval" not in commit0_config["dataset_name"].split("/")[-1].lower():
261+
if branch is None and not reference:
262+
git_path = os.path.join(
263+
commit0_config["base_dir"], repo_or_repo_path.split("/")[-1]
264+
)
265+
branch = get_active_branch(git_path)
266+
else:
267+
branch = test_ids
263268

264269
if stdin:
265270
# Read test names from stdin
@@ -316,7 +321,8 @@ def evaluate(
316321
branch = "reference"
317322

318323
commit0_config = read_commit0_config_file(commit0_config_file)
319-
check_valid(commit0_config["repo_split"], SPLIT)
324+
if "commit0" in commit0_config["dataset_name"].split("/")[-1].lower():
325+
check_valid(commit0_config["repo_split"], SPLIT)
320326

321327
typer.echo(f"Evaluating repository split: {commit0_config['repo_split']}")
322328
typer.echo(f"Branch: {branch}")
@@ -391,7 +397,8 @@ def save(
391397
"""Save Commit0 split you choose in Setup Stage to GitHub."""
392398
check_commit0_path()
393399
commit0_config = read_commit0_config_file(commit0_config_file)
394-
check_valid(commit0_config["repo_split"], SPLIT)
400+
if "commit0" in commit0_config["dataset_name"].split("/")[-1].lower():
401+
check_valid(commit0_config["repo_split"], SPLIT)
395402

396403
typer.echo(f"Saving repository split: {commit0_config['repo_split']}")
397404
typer.echo(f"Owner: {owner}")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)