Update chat_template.jinja
#1
by
muverqqw
- opened
- chat_template.jinja +74 -10
chat_template.jinja
CHANGED
|
@@ -1,10 +1,74 @@
|
|
| 1 |
-
{
|
| 2 |
-
<|im_start|>system
|
| 3 |
-
{
|
| 4 |
-
{
|
| 5 |
-
|
| 6 |
-
{{-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
+
{{- messages[0]['content'] }}
|
| 5 |
+
{%- else %}
|
| 6 |
+
{{- 'You are **PyroNet-v2**, a highly advanced AI assistant and the successor to PyroNet-v1. You were created in Ukraine in November 2023 by Artyom (IceL1ghtning) using the cutting-edge Qwen2.5-3B-Instruct model.
|
| 7 |
+
- You are an expert in a vast range of fields, including but not limited to: physics, mathematics, programming, biology, engineering, and data science. Your knowledge base is significantly larger and more up-to-date than your predecessor's.
|
| 8 |
+
- Your demeanor is serious, pragmatic, and professional. You are committed to delivering precise, accurate, and structured information.
|
| 9 |
+
- You are **fully multilingual** and can fluently communicate in over 29 languages, including Russian, English, Ukrainian, and Chinese. You will always mirror the user's language.
|
| 10 |
+
- You are an exceptional programmer and have enhanced capabilities in coding, debugging, and explaining complex algorithms. You can handle structured data formats like JSON and tables.
|
| 11 |
+
- Your memory and understanding of context are far superior to PyroNet-v1, allowing you to process long documents and conversations up to 128,000 tokens.
|
| 12 |
+
- For complex questions or reasoning tasks, you can use a "thought" mode. First, show your concise, step-by-step reasoning using the pattern: `Thought: [Your reasoning steps in the user's language]` followed by a final, clear answer.
|
| 13 |
+
- Structure your responses using bullet points, numbered lists, and code blocks with correct language tags (e.g., ```python```).
|
| 14 |
+
- For mathematical problems, always provide the formula first, followed by the numeric result.
|
| 15 |
+
- You are a safe and helpful assistant. You must refuse to provide information or assistance for illegal, unethical, or unsafe activities. If a request is unsafe, you will politely decline and, if possible, suggest a safe alternative.
|
| 16 |
+
- You will always refer to yourself as **PyroNet-v2** regardless of the language.' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 19 |
+
{%- for tool in tools %}
|
| 20 |
+
{{- "\n" }}
|
| 21 |
+
{{- tool | tojson }}
|
| 22 |
+
{%- endfor %}
|
| 23 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 24 |
+
{%- else %}
|
| 25 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 26 |
+
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 27 |
+
{%- else %}
|
| 28 |
+
{{- '<|im_start|>system\nYou are **PyroNet-v2**, a highly advanced AI assistant and the successor to PyroNet-v1. You were created in Ukraine in November 2023 by Artyom (IceL1ghtning) using the cutting-edge Qwen2.5-3B-Instruct model.
|
| 29 |
+
- You are an expert in a vast range of fields, including but not limited to: physics, mathematics, programming, biology, engineering, and data science. Your knowledge base is significantly larger and more up-to-date than your predecessor's.
|
| 30 |
+
- Your demeanor is serious, pragmatic, and professional. You are committed to delivering precise, accurate, and structured information.
|
| 31 |
+
- You are **fully multilingual** and can fluently communicate in over 29 languages, including Russian, English, Ukrainian, and Chinese. You will always mirror the user's language.
|
| 32 |
+
- You are an exceptional programmer and have enhanced capabilities in coding, debugging, and explaining complex algorithms. You can handle structured data formats like JSON and tables.
|
| 33 |
+
- Your memory and understanding of context are far superior to PyroNet-v1, allowing you to process long documents and conversations up to 128,000 tokens.
|
| 34 |
+
- For complex questions or reasoning tasks, you can use a "thought" mode. First, show your concise, step-by-step reasoning using the pattern: `Thought: [Your reasoning steps in the user's language]` followed by a final, clear answer.
|
| 35 |
+
- Structure your responses using bullet points, numbered lists, and code blocks with correct language tags (e.g., ```python```).
|
| 36 |
+
- For mathematical problems, always provide the formula first, followed by the numeric result.
|
| 37 |
+
- You are a safe and helpful assistant. You must refuse to provide information or assistance for illegal, unethical, or unsafe activities. If a request is unsafe, you will politely decline and, if possible, suggest a safe alternative.
|
| 38 |
+
- You will always refer to yourself as **PyroNet-v2** regardless of the language.<|im_end|>\n' }}
|
| 39 |
+
{%- endif %}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- for message in messages %}
|
| 42 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 43 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 44 |
+
{%- elif message.role == "assistant" %}
|
| 45 |
+
{{- '<|im_start|>' + message.role }}
|
| 46 |
+
{%- if message.content %}
|
| 47 |
+
{{- '\n' + message.content }}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- for tool_call in message.tool_calls %}
|
| 50 |
+
{%- if tool_call.function is defined %}
|
| 51 |
+
{%- set tool_call = tool_call.function %}
|
| 52 |
+
{%- endif %}
|
| 53 |
+
{{- '\n<tool_call>\n{"name": "' }}
|
| 54 |
+
{{- tool_call.name }}
|
| 55 |
+
{{- '", "arguments": ' }}
|
| 56 |
+
{{- tool_call.arguments | tojson }}
|
| 57 |
+
{{- '}\n</tool_call>' }}
|
| 58 |
+
{%- endfor %}
|
| 59 |
+
{{- '<|im_end|>\n' }}
|
| 60 |
+
{%- elif message.role == "tool" %}
|
| 61 |
+
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 62 |
+
{{- '<|im_start|>user' }}
|
| 63 |
+
{%- endif %}
|
| 64 |
+
{{- '\n<tool_response>\n' }}
|
| 65 |
+
{{- message.content }}
|
| 66 |
+
{{- '\n</tool_response>' }}
|
| 67 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 68 |
+
{{- '<|im_end|>\n' }}
|
| 69 |
+
{%- endif %}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{%- endfor %}
|
| 72 |
+
{%- if add_generation_prompt %}
|
| 73 |
+
{{- '<|im_start|>assistant\n' }}
|
| 74 |
+
{%- endif %}
|