Reduce the image processing latency in VLM (#11541)
Co-authored-by: qiuxuan.lzw <qiuxuan.lzw@alibaba-inc.com>
This commit is contained in:
@@ -313,7 +313,9 @@ class BaseMultimodalProcessor(ABC):
|
||||
try:
|
||||
if modality == Modality.IMAGE:
|
||||
img, _ = load_image(data)
|
||||
return img.convert("RGB") if discard_alpha_channel else img
|
||||
if discard_alpha_channel and img.mode != "RGB":
|
||||
img = img.convert("RGB")
|
||||
return img
|
||||
elif modality == Modality.VIDEO:
|
||||
return load_video(data, frame_count_limit)
|
||||
elif modality == Modality.AUDIO:
|
||||
|
||||
Reference in New Issue
Block a user