[Core] Rename input data types (#8688)
This commit is contained in:
@@ -12,7 +12,7 @@ from vllm.logger import init_logger
|
||||
from vllm.utils import (get_allowed_kwarg_only_overrides, print_warning_once,
|
||||
resolve_mm_processor_kwargs)
|
||||
|
||||
from .data import LLMInputs
|
||||
from .data import DecoderOnlyInputs
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from vllm.config import ModelConfig
|
||||
@@ -100,7 +100,7 @@ class _MultiModalCounts(UserDict):
|
||||
raise KeyError(msg) from exc
|
||||
|
||||
|
||||
InputProcessor = Callable[[InputContext, LLMInputs], LLMInputs]
|
||||
InputProcessor = Callable[[InputContext, DecoderOnlyInputs], DecoderOnlyInputs]
|
||||
"""Preprocess the inputs to the model."""
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ class InputRegistry:
|
||||
# Avoid circular import
|
||||
from vllm.sequence import SequenceData
|
||||
|
||||
dummy_seq_data = SequenceData.from_token_counts((0, seq_len))
|
||||
dummy_seq_data = SequenceData.from_prompt_token_counts((0, seq_len))
|
||||
dummy_multi_modal_data = None
|
||||
|
||||
return dummy_seq_data, dummy_multi_modal_data
|
||||
@@ -245,8 +245,11 @@ class InputRegistry:
|
||||
|
||||
return seq_data, mm_data
|
||||
|
||||
def _default_input_processor(self, ctx: InputContext,
|
||||
inputs: LLMInputs) -> LLMInputs:
|
||||
def _default_input_processor(
|
||||
self,
|
||||
ctx: InputContext,
|
||||
inputs: DecoderOnlyInputs,
|
||||
) -> DecoderOnlyInputs:
|
||||
"""The default input processor is a no-op."""
|
||||
return inputs
|
||||
|
||||
@@ -279,7 +282,7 @@ class InputRegistry:
|
||||
.get(model_cls, self._default_input_processor)
|
||||
|
||||
def process_input(self, model_config: "ModelConfig",
|
||||
inputs: LLMInputs) -> LLMInputs:
|
||||
inputs: DecoderOnlyInputs) -> DecoderOnlyInputs:
|
||||
"""
|
||||
Apply an input processor to an instance of model inputs.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user