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]

Fix: output dir should not subdir with configs

Kilian Lieret2e6b1124e4b7
diff --git a/sweagent/run/common.py b/sweagent/run/common.py
index 061c1d8d..aaffd8ae 100644
--- a/sweagent/run/common.py
+++ b/sweagent/run/common.py
@@ -133,7 +133,7 @@ class BasicCLI:
parser = ArgumentParser(description=__doc__, add_help=False)
parser.add_argument(
"--config",
- type=str,
+ type=Path,
action="append",
default=[],
help=(
diff --git a/sweagent/run/run_batch.py b/sweagent/run/run_batch.py
index 6922f2b8..7057c51c 100644
--- a/sweagent/run/run_batch.py
+++ b/sweagent/run/run_batch.py
@@ -69,8 +69,8 @@ class RunBatchConfig(BaseSettings, cli_implicit_flags=False):
source_id = self.instances.id
model_id = self.agent.model.id
config_file = getattr(self, "_config_files", ["no_config"])[0]
- if isinstance(config_file, Path):
- config_file = config_file.stem
+ if config_file != "no_config":
+ config_file = Path(config_file).stem
suffix = f"__{self.suffix}" if self.suffix else ""
self.output_dir = Path.cwd() / "trajectories" / user_id / f"{config_file}__{model_id}___{source_id}{suffix}"