mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-08 08:27:09 +08:00
[bugfix] Avoid the time consumption caused by creating dummy videos. (#16371)
This commit is contained in:
parent
1621b25288
commit
4aed0ca6a2
@ -78,6 +78,8 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
|
|||||||
length: int,
|
length: int,
|
||||||
num_audios: int,
|
num_audios: int,
|
||||||
) -> list[npt.NDArray]:
|
) -> list[npt.NDArray]:
|
||||||
|
if num_audios == 0:
|
||||||
|
return []
|
||||||
audio = np.zeros((length, ))
|
audio = np.zeros((length, ))
|
||||||
return [audio] * num_audios
|
return [audio] * num_audios
|
||||||
|
|
||||||
@ -88,6 +90,8 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
|
|||||||
height: int,
|
height: int,
|
||||||
num_images: int,
|
num_images: int,
|
||||||
) -> list[Image.Image]:
|
) -> list[Image.Image]:
|
||||||
|
if num_images == 0:
|
||||||
|
return []
|
||||||
image = Image.new("RGB", (width, height), color=255)
|
image = Image.new("RGB", (width, height), color=255)
|
||||||
return [image] * num_images
|
return [image] * num_images
|
||||||
|
|
||||||
@ -99,6 +103,8 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
|
|||||||
num_frames: int,
|
num_frames: int,
|
||||||
num_videos: int,
|
num_videos: int,
|
||||||
) -> list[npt.NDArray]:
|
) -> list[npt.NDArray]:
|
||||||
|
if num_videos == 0:
|
||||||
|
return []
|
||||||
video = np.full((num_frames, width, height, 3), 255)
|
video = np.full((num_frames, width, height, 3), 255)
|
||||||
return [video] * num_videos
|
return [video] * num_videos
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user