Skip to content

Commit 590faf6

Browse files
HollowMan6DDVD233
authored andcommitted
[training_utils] fix: allow empty image_key/video_key in rl dataset (volcengine#3281)
1 parent 3f30ef0 commit 590faf6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

recipe/deepeyes/deepeyes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ def __getitem__(self, item):
7878
multi_modal_data = {}
7979

8080
images = None
81-
if self.image_key in row_dict and row_dict.get(self.image_key, None) is not None:
82-
images = [Image.open(io.BytesIO(image["bytes"])) for image in row_dict.pop(self.image_key)]
81+
row_dict_images = row_dict.pop(self.image_key, None)
82+
if row_dict_images:
83+
images = [Image.open(io.BytesIO(image["bytes"])) for image in row_dict_images]
8384

8485
# due to the image key is "image" instead of "images" in vllm, we need to use "image" here
8586
# link: https://github.com/vllm-project/vllm/blob/3c545c0c3b98ee642373a308197d750d0e449403/vllm/multimodal/parse.py#L205 # noqa: E501

0 commit comments

Comments
 (0)