[Refactor] Remove InputPreprocessor (#53064)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -54,11 +54,10 @@ def test_text_only_model_mm_data_maps_to_bad_request():
|
||||
|
||||
with pytest.raises(ValueError, match="text-only") as exc_info:
|
||||
renderer._process_multimodal(
|
||||
prompt="What is in this image?",
|
||||
prompt=[1],
|
||||
mm_data={"image": [cherry_pil_image]},
|
||||
mm_uuids=None,
|
||||
mm_processor_kwargs=None,
|
||||
tokenization_kwargs=None,
|
||||
)
|
||||
|
||||
error_response = create_error_response(exc_info.value)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
import pytest
|
||||
|
||||
from vllm.config import ModelConfig, VllmConfig
|
||||
from vllm.inputs.preprocess import InputPreprocessor
|
||||
|
||||
pytestmark = pytest.mark.cpu_test
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model_id", ["facebook/chameleon-7b"])
|
||||
@pytest.mark.parametrize("prompt", ["", {"prompt_token_ids": []}])
|
||||
@pytest.mark.skip(
|
||||
reason=(
|
||||
"Applying huggingface processor on text inputs results in "
|
||||
"significant performance regression for multimodal models. "
|
||||
"See https://github.com/vllm-project/vllm/issues/26320"
|
||||
)
|
||||
)
|
||||
def test_preprocessor_always_mm_code_path(model_id, prompt):
|
||||
model_config = ModelConfig(model=model_id)
|
||||
vllm_config = VllmConfig(model_config=model_config)
|
||||
input_preprocessor = InputPreprocessor(vllm_config)
|
||||
|
||||
# HF processor adds sep token
|
||||
tokenizer = input_preprocessor.get_tokenizer()
|
||||
sep_token_id = tokenizer.vocab[tokenizer.sep_token]
|
||||
|
||||
processed_inputs = input_preprocessor.preprocess(prompt)
|
||||
assert sep_token_id in processed_inputs["prompt_token_ids"]
|
||||
Reference in New Issue
Block a user