Skip to content

Commit 4dd7978

Browse files
[Bugfix] Fix regression on pooling models from PR#29621 (vllm-project#29921)
Signed-off-by: Roger Wang <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 5cdd664 commit 4dd7978

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vllm/multimodal/parse.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,17 @@ class EmbeddingItems(
134134
or a list of embedding tensors (one per item).
135135
"""
136136

137+
def _unwrap(
138+
self, item: torch.Tensor | MediaWithBytes[torch.Tensor]
139+
) -> torch.Tensor:
140+
"""Extract media from wrapper if present."""
141+
return item.media if isinstance(item, MediaWithBytes) else item
142+
137143
def get_count(self) -> int:
138144
return len(self.data)
139145

140146
def get(self, index: int) -> torch.Tensor:
141-
return self.data[index]
147+
return self._unwrap(self.data[index])
142148

143149
def get_processor_data(self) -> Mapping[str, object]:
144150
return {}

0 commit comments

Comments
 (0)