diff --git a/vllm/entrypoints/chat_utils.py b/vllm/entrypoints/chat_utils.py index 95c806c228b8..7951c49f5da0 100644 --- a/vllm/entrypoints/chat_utils.py +++ b/vllm/entrypoints/chat_utils.py @@ -448,6 +448,9 @@ def resolve_chat_template_content_format( model_config: ModelConfig, trust_remote_code: Optional[bool] = None, ) -> _ChatTemplateContentFormat: + if given_format != "auto": + return given_format + detected_format = _resolve_chat_template_content_format( chat_template, tools, @@ -461,7 +464,7 @@ def resolve_chat_template_content_format( detected_format=detected_format, ) - return detected_format if given_format == "auto" else given_format + return detected_format