4848# yapf: enable
4949from vllm .transformers_utils .processor import cached_get_processor
5050from vllm .transformers_utils .tokenizer import AnyTokenizer , MistralTokenizer
51- from vllm .utils import deprecate_kwargs , random_uuid
51+ from vllm .utils import random_uuid
5252
5353logger = 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- )
390386def 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- )
495486def 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- )
12921270def 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 (
0 commit comments