[Multimodal] Consolidate mm inputs into MultiModalFeatureSpec (#23779)

Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Flora Feng
2025-08-29 18:36:57 +08:00
committed by GitHub
parent d9e00dbd1f
commit 69f46359dd
16 changed files with 143 additions and 146 deletions
+23
View File
@@ -198,6 +198,29 @@ A dictionary containing nested tensors which have been batched via
"""
@dataclass
class MultiModalFeatureSpec:
"""
Represents a single multimodal input with its processed data and metadata.
Used by the V1 engine to track multimodal data through processing and
caching. A request containing multiple multimodal items will have one
MultiModalFeatureSpec per item.
"""
data: Optional["MultiModalKwargsItem"]
"""Multimodal data for this feature"""
modality: str
"""Based on the input, e.g., "image", "audio", "video"."""
identifier: str
"""mm_hash or uuid for caching encoder outputs."""
mm_position: PlaceholderRange
"""e.g., PlaceholderRange(offset=2, length=336)"""
@dataclass
class MultiModalFieldElem:
"""