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]

Add multimodal support

carlosejimenez76c65b5da769
diff --git a/sweagent/run/batch_instances.py b/sweagent/run/batch_instances.py
index 1b5d9b3a..35311e3b 100644
--- a/sweagent/run/batch_instances.py
+++ b/sweagent/run/batch_instances.py
@@ -159,7 +159,7 @@ class SimpleBatchInstance(BaseModel):
if image_name is None:
# Docker doesn't allow double underscore, so we replace them with a magic token
id_docker_compatible = iid.replace("__", "_1776_")
- image_name = f"swebench/sweb.eval.x86_64.{id_docker_compatible}:latest"
+ image_name = f"swebench/sweb.eval.x86_64.{id_docker_compatible}:latest".lower()
return cls(
image_name=image_name,
problem_statement=instance["problem_statement"],
@@ -247,7 +247,7 @@ class InstancesFromHuggingFace(BaseModel, AbstractInstanceSource):
class SWEBenchInstances(BaseModel, AbstractInstanceSource):
"""Load instances from SWE-bench."""
- subset: Literal["lite", "verified", "full"] = "lite"
+ subset: Literal["lite", "verified", "full", "multimodal"] = "lite"
split: Literal["dev", "test"] = "dev"
@@ -280,6 +280,8 @@ class SWEBenchInstances(BaseModel, AbstractInstanceSource):
return "princeton-nlp/SWE-Bench_Verified"
elif self.subset == "lite":
return "princeton-nlp/SWE-Bench_Lite"
+ elif self.subset == "multimodal":
+ return "princeton-nlp/SWE-Bench_Multimodal"
msg = f"Unsupported subset: {self.subset}"
raise ValueError(msg)
diff --git a/sweagent/run/hooks/swe_bench_evaluate.py b/sweagent/run/hooks/swe_bench_evaluate.py
index 67bdae27..09498d97 100644
--- a/sweagent/run/hooks/swe_bench_evaluate.py
+++ b/sweagent/run/hooks/swe_bench_evaluate.py
@@ -17,7 +17,7 @@ from sweagent.utils.log import get_logger
class SweBenchEvaluate(RunHook):
- _SUBSET_MAP = {"lite": "swe-bench_lite", "verified": "swe-bench_verified"}
+ _SUBSET_MAP = {"lite": "swe-bench_lite", "verified": "swe-bench_verified", "multimodal": "swe-bench_multimodal"}
def __init__(self, output_dir: Path, subset: str, split: str, continuous_submission_every: int = 0) -> None:
super().__init__()
diff --git a/tests/test_batch_instance.py b/tests/test_batch_instance.py
index c1184f85..3389e22c 100644
--- a/tests/test_batch_instance.py
+++ b/tests/test_batch_instance.py
@@ -32,7 +32,7 @@ def test_slice_spec_to_slice():
@pytest.mark.slow
def test_get_swe_bench_instances():
- for subset in ["lite", "verified", "full"]:
+ for subset in ["lite", "verified", "full", "multimodal"]:
for split in ["dev", "test"]:
if subset == "verified" and split == "dev":
continue