mirror of
https://github.com/vllm-project/vllm.git
synced 2026-10-28 09:45:26 +08:00
[Bugfix] Respect the configured offline chat template (#61061)
Signed-off-by: Ting Sun <suntcrick@gmail.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
1 parent
93d2cab35e
commit
b99fdbe1f8
2 files changed
+5
-1
No files matched your search
@@ -14,6 +14,7 @@ from vllm.renderers.chat_utils import ChatCompletionMessageParam
|
||||
|
||||
def _make_mock_llm() -> LLM:
|
||||
llm = object.__new__(LLM)
|
||||
llm.chat_template = None
|
||||
llm.model_config = SimpleNamespace(
|
||||
runner_type="generate", enable_prompt_embeds=False
|
||||
)
|
||||
|
||||
@@ -54,6 +54,7 @@ class OfflineInferenceMixin:
|
||||
renderer: BaseRenderer
|
||||
llm_engine: "LLMEngine"
|
||||
model_config: ModelConfig
|
||||
chat_template: str | None
|
||||
|
||||
def _resolve_mm_lora(
|
||||
self,
|
||||
@@ -180,7 +181,9 @@ class OfflineInferenceMixin:
|
||||
renderer = self.renderer
|
||||
|
||||
chat_params = ChatParams(
|
||||
chat_template=chat_template,
|
||||
chat_template=(
|
||||
self.chat_template if chat_template is None else chat_template
|
||||
),
|
||||
chat_template_content_format=chat_template_content_format,
|
||||
chat_template_kwargs=merge_kwargs(
|
||||
chat_template_kwargs,
|
||||
|
||||
Reference in new issue
Block a user