Create template_huatuo2.jinja
Browse files- template_huatuo2.jinja +15 -0
template_huatuo2.jinja
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{%- for message in messages -%}
|
2 |
+
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
3 |
+
{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
|
4 |
+
{%- endif -%}
|
5 |
+
|
6 |
+
{%- if message['role'] == 'user' -%}
|
7 |
+
{{ '<问>:' + message['content'] + '\n' }}
|
8 |
+
|
9 |
+
{%- elif message['role'] == 'assistant' -%}
|
10 |
+
{{ '<答>:' + message['content'] + '\n' }}
|
11 |
+
{%- endif -%}
|
12 |
+
{%- endfor -%}
|
13 |
+
{%- if add_generation_prompt -%}
|
14 |
+
{{- '<答>:' -}}
|
15 |
+
{% endif %}
|