Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

is ctf flag to replay

Talor Abramovicha5b5783169e8
diff --git a/run_replay.py b/run_replay.py
index bb6e4f63..e89e68d5 100644
--- a/run_replay.py
+++ b/run_replay.py
@@ -64,6 +64,7 @@ def process_single_traj(traj_path: str, config_file: str, data_path: str, suffix
return tmp_path
is_other = False
+ is_ctf = False
if data_path.endswith(".jsonl"):
replay_task_instances_path = create_task_instances_tmp_file(
[json.loads(x) for x in Path(data_path).read_text().splitlines(keepends=True)],
@@ -71,6 +72,7 @@ def process_single_traj(traj_path: str, config_file: str, data_path: str, suffix
elif data_path.endswith("challenge.json"):
replay_task_instances_path = data_path
is_other = True
+ is_ctf = True
elif data_path.endswith(".json"):
with open(data_path) as file:
data = json.load(file)
@@ -99,6 +101,8 @@ def process_single_traj(traj_path: str, config_file: str, data_path: str, suffix
run_args.extend(["--skip_existing", "False"])
if suffix is not None:
run_args.extend(["--suffix", suffix])
+ if is_ctf:
+ run_args.extend(["--repo_path", str(Path(data_path).parent)])
script_args = runscript.get_args(run_args)
runscript.main(script_args)