Skip to content

Commit

Permalink
Replace modal.Mount( with suggested fix (#288)
Browse files Browse the repository at this point in the history
* Replace `modal.Mount(` with suggested fix

* Update
  • Loading branch information
john-b-yang authored Jan 16, 2025
1 parent 3ad332f commit 82238cd
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions swebench/harness/modal_eval/run_evaluation_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ def _get_sandbox(self, timeout: int | None = None):
timeout = 60 * 30

return modal.Sandbox.create(
image=self.image,
image=self.image.add_local_file(
REMOTE_SANDBOX_ENTRYPOINT_PATH,
REMOTE_SANDBOX_ENTRYPOINT_PATH,
),
timeout=timeout,
cpu=4,
mounts=[
modal.Mount.from_local_file(
REMOTE_SANDBOX_ENTRYPOINT_PATH,
REMOTE_SANDBOX_ENTRYPOINT_PATH,
)
],
)

async def _read_stream(self, stream: modal.io_streams.StreamReader, output_list: list[str]):
Expand Down Expand Up @@ -303,13 +300,10 @@ def get_log_dir(pred: dict, run_id: str, instance_id: str) -> Path:
return RUN_EVALUATION_LOG_DIR / run_id / model_name_or_path / instance_id

@app.function(
image=swebench_image,
mounts=[
modal.Mount.from_local_file(
LOCAL_SANDBOX_ENTRYPOINT_PATH,
REMOTE_SANDBOX_ENTRYPOINT_PATH,
)
],
image=swebench_image.add_local_file(
LOCAL_SANDBOX_ENTRYPOINT_PATH,
REMOTE_SANDBOX_ENTRYPOINT_PATH,
),
timeout=120*60, # Much larger than default timeout to account for image build time
)
def run_instance_modal(
Expand Down

0 comments on commit 82238cd

Please sign in to comment.