From 8b8dd10b071cfbda0ff1262f9b3ac8d48c8a96d1 Mon Sep 17 00:00:00 2001 From: carlosejimenez Date: Fri, 22 Nov 2024 01:16:51 +0000 Subject: [PATCH] Fix empty instances error in prepare_images --- swebench/harness/prepare_images.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swebench/harness/prepare_images.py b/swebench/harness/prepare_images.py index d6ad710d..3d14fe81 100644 --- a/swebench/harness/prepare_images.py +++ b/swebench/harness/prepare_images.py @@ -12,7 +12,7 @@ def filter_dataset_to_build( dataset: list, - instance_ids: list, + instance_ids: list | None, client: docker.DockerClient, force_rebuild: bool ): @@ -28,6 +28,9 @@ def filter_dataset_to_build( # Get existing images existing_images = list_images(client) data_to_build = [] + + if instance_ids is None: + instance_ids = [instance[KEY_INSTANCE_ID] for instance in dataset] # Check if all instance IDs are in the dataset not_in_dataset = set(instance_ids).difference(set([instance[KEY_INSTANCE_ID] for instance in dataset]))