mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 09:35:50 +08:00
[Bugfix] Fix regression on pooling models from PR#29621 (#29921)
Signed-off-by: Roger Wang <hey@rogerw.io> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
5cdd664509
commit
4dd7978374
@ -134,11 +134,17 @@ class EmbeddingItems(
|
|||||||
or a list of embedding tensors (one per item).
|
or a list of embedding tensors (one per item).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def _unwrap(
|
||||||
|
self, item: torch.Tensor | MediaWithBytes[torch.Tensor]
|
||||||
|
) -> torch.Tensor:
|
||||||
|
"""Extract media from wrapper if present."""
|
||||||
|
return item.media if isinstance(item, MediaWithBytes) else item
|
||||||
|
|
||||||
def get_count(self) -> int:
|
def get_count(self) -> int:
|
||||||
return len(self.data)
|
return len(self.data)
|
||||||
|
|
||||||
def get(self, index: int) -> torch.Tensor:
|
def get(self, index: int) -> torch.Tensor:
|
||||||
return self.data[index]
|
return self._unwrap(self.data[index])
|
||||||
|
|
||||||
def get_processor_data(self) -> Mapping[str, object]:
|
def get_processor_data(self) -> Mapping[str, object]:
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user