Skip to content

Commit 4aed0ca

Browse files
authored
[bugfix] Avoid the time consumption caused by creating dummy videos. (#16371)
1 parent 1621b25 commit 4aed0ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vllm/multimodal/profiling.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def _get_dummy_audios(
7878
length: int,
7979
num_audios: int,
8080
) -> list[npt.NDArray]:
81+
if num_audios == 0:
82+
return []
8183
audio = np.zeros((length, ))
8284
return [audio] * num_audios
8385

@@ -88,6 +90,8 @@ def _get_dummy_images(
8890
height: int,
8991
num_images: int,
9092
) -> list[Image.Image]:
93+
if num_images == 0:
94+
return []
9195
image = Image.new("RGB", (width, height), color=255)
9296
return [image] * num_images
9397

@@ -99,6 +103,8 @@ def _get_dummy_videos(
99103
num_frames: int,
100104
num_videos: int,
101105
) -> list[npt.NDArray]:
106+
if num_videos == 0:
107+
return []
102108
video = np.full((num_frames, width, height, 3), 255)
103109
return [video] * num_videos
104110

0 commit comments

Comments
 (0)