[Frontend] Chat template fallbacks for multimodal models (#17805)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-05-07 23:05:54 -07:00
committed by GitHub
parent 843b222723
commit 96722aa81d
18 changed files with 219 additions and 52 deletions
+2 -1
View File
@@ -937,10 +937,11 @@ async def init_app_state(
chat_template=resolved_chat_template)
else:
hf_chat_template = resolve_hf_chat_template(
vllm_config.model_config,
tokenizer,
chat_template=None,
tools=None,
trust_remote_code=model_config.trust_remote_code)
)
if hf_chat_template != resolved_chat_template:
logger.warning(
+2 -2
View File
@@ -394,11 +394,11 @@ class OpenAIServing:
model_config = self.model_config
resolved_content_format = resolve_chat_template_content_format(
model_config,
chat_template,
tool_dicts,
chat_template_content_format,
tokenizer,
trust_remote_code=model_config.trust_remote_code,
)
conversation, mm_data_future = parse_chat_messages_futures(
messages,
@@ -425,8 +425,8 @@ class OpenAIServing:
)
else:
request_prompt = apply_hf_chat_template(
model_config,
tokenizer,
trust_remote_code=model_config.trust_remote_code,
conversation=conversation,
**_chat_template_kwargs,
)