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: run batch processing with modal (#1023)

Volker Seeker41f06dc84e39
diff --git a/sweagent/run/batch_instances.py b/sweagent/run/batch_instances.py
index b35c5bef..80f8841a 100644
--- a/sweagent/run/batch_instances.py
+++ b/sweagent/run/batch_instances.py
@@ -127,8 +127,12 @@ class SimpleBatchInstance(BaseModel):
return BatchInstance(
env=EnvironmentConfig(deployment=deployment, repo=repo), problem_statement=problem_statement
)
+
deployment.image = self.image_name # type: ignore
- deployment.python_standalone_dir = "/root" # type: ignore
+
+ if isinstance(deployment, DockerDeploymentConfig):
+ deployment.python_standalone_dir = "/root" # type: ignore
+
return BatchInstance(
env=EnvironmentConfig(deployment=deployment, repo=repo), problem_statement=problem_statement
)
@@ -269,7 +273,10 @@ class SWEBenchInstances(BaseModel, AbstractInstanceSource):
from datasets import load_dataset
ds: list[dict[str, Any]] = load_dataset(self._get_huggingface_name(), split=self.split) # type: ignore
- self.deployment.platform = "linux/amd64"
+
+ if isinstance(self.deployment, DockerDeploymentConfig):
+ self.deployment.platform = "linux/amd64"
+
instances = [
SimpleBatchInstance.from_swe_bench(instance).to_full_batch_instance(self.deployment) for instance in ds
]