From 30f07ba4f50b650af64b4de1d1cf0ad50f6894d4 Mon Sep 17 00:00:00 2001 From: xzb <2598514867@qq.com> Date: Tue, 17 Jun 2025 16:42:50 +0800 Subject: [PATCH] Fixes chat-template-content-format not skipping auto detection --- vllm/entrypoints/chat_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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