[Multimodal] Consolidate mm inputs into MultiModalFeatureSpec (#23779)
Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
@@ -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:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user