[Frontend] early return chat format resolution when specified (#19735)

This commit is contained in:
xzbdmw 2025-06-20 02:49:59 +08:00 committed by GitHub
parent ead2110297
commit ea10dd9d9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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