From ad1a2f7ef37ab10ad77c9de44ed23ed23245b5c5 Mon Sep 17 00:00:00 2001 From: Travis Johnson Date: Mon, 11 Nov 2024 13:47:59 -0700 Subject: [PATCH] support system prompt with object content Signed-off-by: Travis Johnson --- examples/tool_chat_template_llama3.2_json.jinja | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/tool_chat_template_llama3.2_json.jinja b/examples/tool_chat_template_llama3.2_json.jinja index 4f09b0bcf992d..d915dc42bf543 100644 --- a/examples/tool_chat_template_llama3.2_json.jinja +++ b/examples/tool_chat_template_llama3.2_json.jinja @@ -29,7 +29,12 @@ {#- This block extracts the system message, so we can slot it into the right place. #} {%- if messages[0]['role'] == 'system' %} - {%- set system_message = messages[0]['content']|trim %} + {%- if messages[0]['content'] is string %} + {%- set system_message = messages[0]['content']|trim %} + {%- else %} + {#- Support vLLM's transforming of a content string to JSON. #} + {%- set system_message = messages[0]['content'][0]['text']|trim %} + {%- endif %} {%- set messages = messages[1:] %} {%- else %} {%- if tools is not none %}