Unverified Commit ea10dd9d authored by xzbdmw's avatar xzbdmw Committed by GitHub
Browse files

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

parent ead21102
...@@ -448,6 +448,9 @@ def resolve_chat_template_content_format( ...@@ -448,6 +448,9 @@ def resolve_chat_template_content_format(
model_config: ModelConfig, model_config: ModelConfig,
trust_remote_code: Optional[bool] = None, trust_remote_code: Optional[bool] = None,
) -> _ChatTemplateContentFormat: ) -> _ChatTemplateContentFormat:
if given_format != "auto":
return given_format
detected_format = _resolve_chat_template_content_format( detected_format = _resolve_chat_template_content_format(
chat_template, chat_template,
tools, tools,
...@@ -461,7 +464,7 @@ def resolve_chat_template_content_format( ...@@ -461,7 +464,7 @@ def resolve_chat_template_content_format(
detected_format=detected_format, detected_format=detected_format,
) )
return detected_format if given_format == "auto" else given_format return detected_format
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment