A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Bugfix] set system_message in phi4mini chat template (#23309)
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
jerryzhuang committed
Aug 22, 2025 at 00:22 UTC
f8daddcc4c199c7257835cc4671f51400361b5e8
1 file changed
+8
-6
examples/tool_chat_template_phi4_mini.jinja
+8
-6
@@ -1,10 +1,14 @@
1
+{%- if messages and messages[0]['role'] == 'system' %}
2
+ {%- set system_message = messages[0]['content']|trim %}
3
+ {%- set messages = messages[1:] %}
4
+{%- else %}
5
+ {%- set system_message = "You are a helpful assistant." %}
6
+{%- endif %}
7
+
8
{%- if messages %}
2
- {%- if system_message or tools %}
9
<|system|>
4
-
5
-{%- if system_message %}
10
{{ system_message }}
7
-{%- endif %}
11
+{%- if tools %}
12
In addition to plain text responses, you can chose to call one or more of the provided functions.
13
14
Use the following rule to decide when to call a function:
@@ -19,13 +23,11 @@ If you decide to call functions:
23
* make sure you pick the right functions that match the user intent
24
25
22
-{%- if tools %}
26
{%- for t in tools %}
27
{{- t | tojson(indent=4) }}
28
{{- "\n\n" }}
29
{%- endfor %}
30
{%- endif %}<|end|>
28
- {%- endif %}
31
32
{%- for message in messages %}
33
{%- if message.role != "system" %}