rebase 2026/2/5
This commit is contained in:
1 parent
0144a424ed
commit
24b04f58a0
20 files changed
+782
-648
No files matched your search
@@ -1,4 +1,3 @@
|
||||
from ast import Dict
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
@@ -37,8 +36,9 @@ class OmniRequestState(RequestState):
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Omni-specific: multimodal output accumulation
|
||||
self.mm_type: str | None = None
|
||||
self.mm_accumulated: Dict[str, Any] | None = None
|
||||
self.mm_accumulated: dict[str, Any] | None = None
|
||||
|
||||
def add_multimodal_tensor(self, payload: Any | None, mm_type: str | None) -> None:
|
||||
if payload is None:
|
||||
@@ -57,7 +57,7 @@ class OmniRequestState(RequestState):
|
||||
return x
|
||||
|
||||
if isinstance(payload, dict):
|
||||
incoming: Dict[str, Any] = {}
|
||||
incoming: dict[str, Any] = {}
|
||||
target_key = self.mm_type or "hidden"
|
||||
|
||||
# Iterate directly without unnecessary dict copy
|
||||
@@ -257,8 +257,9 @@ class MultimodalOutputProcessor(VLLMOutputProcessor):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
tokenizer: TokenizerLike,
|
||||
tokenizer: TokenizerLike | None,
|
||||
log_stats: bool,
|
||||
stream_interval: int = 1,
|
||||
engine_core_output_type: str | None = None,
|
||||
):
|
||||
"""Initialize the multimodal output processor.
|
||||
@@ -266,11 +267,12 @@ class MultimodalOutputProcessor(VLLMOutputProcessor):
|
||||
Args:
|
||||
tokenizer: Tokenizer for detokenizing text outputs
|
||||
log_stats: Whether to log statistics
|
||||
stream_interval: Stream interval for output generation
|
||||
engine_core_output_type: Optional output type specification
|
||||
(e.g., "image", "audio", "latents"). Used to route outputs
|
||||
to appropriate processors. If None, output type is inferred.
|
||||
"""
|
||||
super().__init__(tokenizer=tokenizer, log_stats=log_stats)
|
||||
super().__init__(tokenizer=tokenizer, log_stats=log_stats, stream_interval=stream_interval)
|
||||
self.output_handlers: dict[str, Callable[[EngineCoreOutput], None]] = {}
|
||||
self._reqid_to_mm_type: dict[str, str] = {}
|
||||
self.engine_core_output_type = engine_core_output_type
|
||||
|
||||
Reference in new issue
Block a user