Skip to content

Commit c8631bc

Browse files
Yangruipischenxijun1029
authored andcommitted
fix: modality length mismatch with image_data (sgl-project#7887)
1 parent a6c419a commit c8631bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/sglang/srt/managers/io_struct.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ def _normalize_image_data(self, num):
297297
self.modalities.append("image")
298298
elif len(self.image_data[i]) > 1:
299299
self.modalities.append("multi-images")
300+
else:
301+
# Ensure len(self.modalities) == len(self.image_data)
302+
self.modalities.append(None)
300303
# Expand parallel_sample_num
301304
self.image_data = self.image_data * self.parallel_sample_num
302305
self.modalities = self.modalities * self.parallel_sample_num

0 commit comments

Comments
 (0)