8000 feat(execution): minor update · bigcode-project/selfcodealign@0d6c6c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d6c6c5

Browse files
committed
feat(execution): minor update
1 parent 016d96c commit 0d6c6c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/star_align/execution_filter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def make_python_membound_code_prefix(limit_mb):
4747
class Args:
4848
response_paths: list[str]
4949
result_path: str
50+
save_request_errors: bool = False
51+
shuffle: bool = field(default=True)
5052
cache_paths: list[str] = field(default_factory=list)
5153
max_batched_tasks: int = 10000
5254
max_workers: int = cpu_count()
@@ -184,6 +186,8 @@ def main():
184186
print(cleanup_command)
185187

186188
raw_data = load_dataset("json", data_files=args.response_paths, split="train")
189+
if args.shuffle:
190+
raw_data = raw_data.shuffle()
187191
if len(args.cache_paths) > 0:
188192
cached_data = load_dataset("json", data_files=args.cache_paths, split="train")
189193
cached_dict: dict[str, dict] = {
@@ -252,7 +256,8 @@ def pass_rate_str(passed: int, total: int, tag: str = "") -> str:
252256
continue
253257
idx, response, code, passed, output = future_result
254258
if output == "Failed to execute program":
255-
continue
259+
if not args.save_request_errors:
260+
continue
256261
newdata = form_new_data(
257262
item=raw_data[idx],
258263
response=response,

0 commit comments

Comments
 (0)
0