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]

Change instances.flavor to instances.subset

carlosejimenezaa50d0c276f3
diff --git a/sweagent/run/batch_instances.py b/sweagent/run/batch_instances.py
index abc581a4..1c23fd03 100644
--- a/sweagent/run/batch_instances.py
+++ b/sweagent/run/batch_instances.py
@@ -238,7 +238,7 @@ class InstancesFromHuggingFace(BaseModel, AbstractInstanceSource):
class SWEBenchInstances(BaseModel, AbstractInstanceSource):
"""Load instances from SWE-bench."""
- flavor: Literal["lite", "verified", "full"] = "lite"
+ subset: Literal["lite", "verified", "full"] = "lite"
split: Literal["dev", "test"] = "dev"
@@ -262,13 +262,13 @@ class SWEBenchInstances(BaseModel, AbstractInstanceSource):
"""Shuffle the instances (before filtering and slicing)."""
def _get_huggingface_name(self) -> str:
- if self.flavor == "full":
+ if self.subset == "full":
return "princeton-nlp/SWE-Bench"
- elif self.flavor == "verified":
+ elif self.subset == "verified":
return "princeton-nlp/SWE-Bench_Verified"
- elif self.flavor == "lite":
+ elif self.subset == "lite":
return "princeton-nlp/SWE-Bench_Lite"
- msg = f"Unsupported flavor: {self.flavor}"
+ msg = f"Unsupported subset: {self.subset}"
raise ValueError(msg)
def get_instance_configs(self) -> list[BatchInstance]:
@@ -282,7 +282,7 @@ class SWEBenchInstances(BaseModel, AbstractInstanceSource):
@property
def id(self) -> str:
- return f"swe_bench_{self.flavor}"
+ return f"swe_bench_{self.subset}"
class ExpertInstancesFromFile(BaseModel, AbstractInstanceSource):
diff --git a/tests/test_batch_instance.py b/tests/test_batch_instance.py
index fbe1e8de..0d6b4feb 100644
--- a/tests/test_batch_instance.py
+++ b/tests/test_batch_instance.py
@@ -32,12 +32,12 @@ def test_slice_spec_to_slice():
@pytest.mark.slow
def test_get_swe_bench_instances():
- for flavor in ["lite", "verified", "full"]:
+ for subset in ["lite", "verified", "full"]:
for split in ["dev", "test"]:
- if flavor == "verified" and split == "dev":
+ if subset == "verified" and split == "dev":
continue
- print(flavor, split)
- instance_config = SWEBenchInstances(flavor=flavor, split=split) # type: ignore
+ print(subset, split)
+ instance_config = SWEBenchInstances(subset=subset, split=split) # type: ignore
instances = instance_config.get_instance_configs()
assert len(instances) > 0
assert all(isinstance(instance, BatchInstance) for instance in instances)
diff --git a/tests/test_run_batch.py b/tests/test_run_batch.py
index afcd7358..b9c0418f 100644
--- a/tests/test_run_batch.py
+++ b/tests/test_run_batch.py
@@ -91,7 +91,7 @@ def test_empty_instances_expert(test_data_sources_path: Path, tmp_path: Path):
# "run-batch",
# "--agent.model.name",
# "instant_empty_submit",
-# "--instances.flavor",
+# "--instances.subset",
# "lite",
# "--instances.split",
# "test",