@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 787b84a9fc
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 12, 03:30 UTC

[Bugfix] Follow-up fix on MediaWithBytes (#29951)

Signed-off-by: Roger Wang <hey@rogerw.io>

Roger Wang committed Dec 3, 2025 at 02:42 UTC 787b84a9fc9d1744f82addf40912e9fb84c0b4c5
3 files changed +5 -2
vllm/multimodal/base.py
+2
@@ -21,6 +21,8 @@ class MediaWithBytes(Generic[_T]):
21
22 The wrapper delegates attribute access to the underlying media object,
23 making it behave transparently like the wrapped type (e.g., PIL.Image).
24 +
25 + NOTE: Currently, this wrapper is used only for the image modality.
26 """
27
28 media: _T
vllm/multimodal/inputs.py
+2 -1
@@ -32,6 +32,7 @@ if TYPE_CHECKING:
32 from PIL.Image import Image
33 from transformers.feature_extraction_utils import BatchFeature
34
35 + from .base import MediaWithBytes
36 from .processing import MultiModalHashes
37
38 else:
@@ -59,7 +60,7 @@ Represents a single audio
60 item, which can be passed to a HuggingFace `AudioProcessor`.
61 """
62
62 -ImageItem: TypeAlias = Union[HfImageItem, "torch.Tensor"]
63 +ImageItem: TypeAlias = Union[HfImageItem, "torch.Tensor", "MediaWithBytes[HfImageItem]"]
64 """
65 A `transformers.image_utils.ImageInput` representing a single image
66 item, which can be passed to a HuggingFace `ImageProcessor`.
vllm/multimodal/parse.py
+1 -1
@@ -484,7 +484,7 @@ class MultiModalDataParser:
484 return ImageEmbeddingItems(data)
485
486 if (
487 - isinstance(data, PILImage.Image)
487 + isinstance(data, (PILImage.Image, MediaWithBytes))
488 or isinstance(data, (np.ndarray, torch.Tensor))
489 and data.ndim == 3
490 ):