Skip to content

Commit 3c20b8c

Browse files
DarkLight1337jingyu
authored andcommitted
[Deprecation] Remove deprecated args and methods (vllm-project#21907)
Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: jingyu <[email protected]>
1 parent 0ed0511 commit 3c20b8c

File tree

3 files changed

+5
-59
lines changed

3 files changed

+5
-59
lines changed

vllm/entrypoints/chat_utils.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# yapf: enable
4949
from vllm.transformers_utils.processor import cached_get_processor
5050
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
51-
from vllm.utils import deprecate_kwargs, random_uuid
51+
from vllm.utils import random_uuid
5252

5353
logger = init_logger(__name__)
5454

@@ -383,17 +383,12 @@ def resolve_mistral_chat_template(
383383
return None
384384

385385

386-
@deprecate_kwargs(
387-
"trust_remote_code",
388-
additional_message="Please use `model_config.trust_remote_code` instead.",
389-
)
390386
def resolve_hf_chat_template(
391387
tokenizer: Union[PreTrainedTokenizer, PreTrainedTokenizerFast],
392388
chat_template: Optional[str],
393389
tools: Optional[list[dict[str, Any]]],
394390
*,
395391
model_config: ModelConfig,
396-
trust_remote_code: Optional[bool] = None,
397392
) -> Optional[str]:
398393
# 1st priority: The given chat template
399394
if chat_template is not None:
@@ -488,18 +483,13 @@ def _log_chat_template_content_format(
488483
)
489484

490485

491-
@deprecate_kwargs(
492-
"trust_remote_code",
493-
additional_message="Please use `model_config.trust_remote_code` instead.",
494-
)
495486
def resolve_chat_template_content_format(
496487
chat_template: Optional[str],
497488
tools: Optional[list[dict[str, Any]]],
498489
given_format: ChatTemplateContentFormatOption,
499490
tokenizer: AnyTokenizer,
500491
*,
501492
model_config: ModelConfig,
502-
trust_remote_code: Optional[bool] = None,
503493
) -> _ChatTemplateContentFormat:
504494
if given_format != "auto":
505495
return given_format
@@ -568,17 +558,9 @@ def add(self, modality: ModalityStr, item: _T) -> Optional[str]:
568558

569559
input_modality = modality.replace("_embeds", "")
570560

571-
if mm_registry.has_processor(model_config):
572-
mm_processor = mm_registry.create_processor(model_config)
573-
allowed_counts = mm_processor.info.get_allowed_mm_limits()
574-
allowed_count = allowed_counts.get(input_modality, 0)
575-
else:
576-
mm_config = model_config.multimodal_config
577-
if mm_config is None:
578-
msg = "This model does not support multi-modal inputs"
579-
raise ValueError(msg)
580-
581-
allowed_count = mm_config.get_limit_per_prompt(input_modality)
561+
mm_processor = mm_registry.create_processor(model_config)
562+
allowed_counts = mm_processor.info.get_allowed_mm_limits()
563+
allowed_count = allowed_counts.get(input_modality, 0)
582564

583565
current_count = len(self._items_by_modality[modality]) + 1
584566
if current_count > allowed_count:
@@ -1285,10 +1267,6 @@ def parse_chat_messages_futures(
12851267
return conversation, mm_tracker.all_mm_data()
12861268

12871269

1288-
@deprecate_kwargs(
1289-
"trust_remote_code",
1290-
additional_message="Please use `model_config.trust_remote_code` instead.",
1291-
)
12921270
def apply_hf_chat_template(
12931271
tokenizer: Union[PreTrainedTokenizer, PreTrainedTokenizerFast],
12941272
conversation: list[ConversationMessage],
@@ -1297,8 +1275,6 @@ def apply_hf_chat_template(
12971275
*,
12981276
model_config: ModelConfig,
12991277
tokenize: bool = False, # Different from HF's default
1300-
# Deprecated, explicitly capture here so it doesn't slit into kwargs.
1301-
trust_remote_code: Optional[bool] = None,
13021278
**kwargs: Any,
13031279
) -> str:
13041280
hf_chat_template = resolve_hf_chat_template(

vllm/multimodal/registry.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import TYPE_CHECKING, Generic, Optional, Protocol, TypeVar
66

77
import torch.nn as nn
8-
from typing_extensions import deprecated
98

109
from vllm.envs import VLLM_MM_INPUT_CACHE_GIB
1110
from vllm.inputs import InputProcessingContext
@@ -105,13 +104,6 @@ def reset_processor_cache(self) -> bool:
105104

106105
return True # Success
107106

108-
@deprecated("Legacy input processor/mapper pipeline has been removed. "
109-
"Please update your model runner to use "
110-
"`seq_group_metadata.multi_modal_data` directly without "
111-
"further processing.")
112-
def create_input_mapper(self, model_config: "ModelConfig"):
113-
return lambda data, mm_processor_kwargs: data
114-
115107
def get_max_tokens_per_item_by_modality(
116108
self,
117109
model_config: "ModelConfig",
@@ -182,16 +174,6 @@ def get_max_multimodal_tokens(self, model_config: "ModelConfig") -> int:
182174
"""
183175
return sum(self.get_max_tokens_by_modality(model_config).values())
184176

185-
@deprecated("Legacy input processor/mapper pipeline has been removed. "
186-
"Please update your model runner to use "
187-
"`seq_group_metadata.multi_modal_data` directly without "
188-
"further processing.")
189-
def init_mm_limits_per_prompt(
190-
self,
191-
model_config: "ModelConfig",
192-
) -> None:
193-
pass
194-
195177
def get_mm_limits_per_prompt(
196178
self,
197179
model_config: "ModelConfig",
@@ -246,13 +228,6 @@ def _get_model_cls(self, model_config: "ModelConfig"):
246228
model_cls, _ = get_model_architecture(model_config)
247229
return model_cls
248230

249-
@deprecated("Legacy input processor/mapper pipeline has been removed. "
250-
"Please update your model runner to use "
251-
"`seq_group_metadata.multi_modal_data` directly without "
252-
"further processing.")
253-
def has_processor(self, model_config: "ModelConfig") -> bool:
254-
return True
255-
256231
def create_processor(
257232
self,
258233
model_config: "ModelConfig",

vllm/worker/neuron_model_runner.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
from vllm.model_executor import SamplingMetadata
1616
from vllm.model_executor.layers.sampler import SamplerOutput
1717
from vllm.model_executor.model_loader.neuron import get_neuron_model
18-
from vllm.multimodal import (MULTIMODAL_REGISTRY, BatchedTensorInputs,
19-
MultiModalKwargs)
18+
from vllm.multimodal import BatchedTensorInputs, MultiModalKwargs
2019
from vllm.platforms import current_platform
2120
from vllm.sampling_params import SamplingParams
2221
from vllm.sequence import IntermediateTensors, SequenceGroupMetadata
@@ -88,10 +87,6 @@ def __init__(
8887
self.device = self.device_config.device
8988
self.pin_memory = is_pin_memory_available()
9089

91-
# Multi-modal data support
92-
self.multi_modal_input_mapper = MULTIMODAL_REGISTRY \
93-
.create_input_mapper(self.model_config)
94-
9590
# Lazy initialization.
9691
self.model: nn.Module # initialize after load_model.
9792

0 commit comments

Comments
 (0)