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 17, 05:30 UTC
Add baichuan chat template jinjia file (#2390)
KKY committed
Jan 9, 2024 at 11:13 UTC
74cd5abdd14b8a7b24a6bf4929f64ae59a3bbd5c
1 file changed
+22
examples/template_baichuan.jinja
new
+22
@@ -0,0 +1,22 @@
1
+{{ (messages|selectattr('role', 'equalto', 'system')|list|last).content|trim if (messages|selectattr('role', 'equalto', 'system')|list) else '' }}
2
+
3
+{% for message in messages %}
4
+{% if message['role'] == 'user' %}
5
+<reserved_106>
6
+{{ message['content']|trim -}}
7
+{% if not loop.last %}
8
+
9
+
10
+{% endif %}
11
+{% elif message['role'] == 'assistant' %}
12
+<reserved_107>
13
+{{ message['content']|trim -}}
14
+{% if not loop.last %}
15
+
16
+
17
+{% endif %}
18
+{% endif %}
19
+{% endfor %}
20
+{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}
21
+<reserved_107>
22
+{% endif %}
\ No newline at end of file