mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-21 05:25:02 +08:00
optimize: eliminate duplicate split_enc_dec_inputs calls (#25573)
Signed-off-by: nicole-lihui <nicole.li@daocloud.io> Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
parent
c26e7b14d7
commit
d8ffa3c5f4
@ -388,9 +388,9 @@ class Processor:
|
||||
|
||||
eos_token_id = self.input_preprocessor.get_eos_token_id()
|
||||
|
||||
self._validate_model_inputs(processed_inputs)
|
||||
|
||||
encoder_inputs, decoder_inputs = split_enc_dec_inputs(processed_inputs)
|
||||
self._validate_model_inputs(encoder_inputs, decoder_inputs)
|
||||
|
||||
# Mypy does not always properly infer the types of some elements of
|
||||
# discriminated unions of TypedDicts, because of how it handles
|
||||
# inheritance of TypedDict. If we explicitly extract the items we want
|
||||
@ -458,9 +458,8 @@ class Processor:
|
||||
trace_headers=trace_headers,
|
||||
)
|
||||
|
||||
def _validate_model_inputs(self, inputs: ProcessorInputs):
|
||||
encoder_inputs, decoder_inputs = split_enc_dec_inputs(inputs)
|
||||
|
||||
def _validate_model_inputs(self, encoder_inputs: Optional[SingletonInputs],
|
||||
decoder_inputs: SingletonInputs):
|
||||
if encoder_inputs is not None:
|
||||
self._validate_model_input(encoder_inputs, prompt_type="encoder")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user