Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- chat_template.jinja +4 -16
- special_tokens_map.json +1 -1
- tokenizer_config.json +2 -2
chat_template.jinja
CHANGED
|
@@ -15,20 +15,9 @@
|
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
-
{%- for
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
-
{%-
|
| 21 |
-
{%- set tool_start = '<tool_response>' %}
|
| 22 |
-
{%- set tool_start_length = tool_start|length %}
|
| 23 |
-
{%- set start_of_message = message.content[:tool_start_length] %}
|
| 24 |
-
{%- set tool_end = '</tool_response>' %}
|
| 25 |
-
{%- set tool_end_length = tool_end|length %}
|
| 26 |
-
{%- set start_pos = (message.content|length) - tool_end_length %}
|
| 27 |
-
{%- if start_pos < 0 %}
|
| 28 |
-
{%- set start_pos = 0 %}
|
| 29 |
-
{%- endif %}
|
| 30 |
-
{%- set end_of_message = message.content[start_pos:] %}
|
| 31 |
-
{%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
|
| 32 |
{%- set ns.multi_step_tool = false %}
|
| 33 |
{%- set ns.last_query_index = index %}
|
| 34 |
{%- endif %}
|
|
@@ -43,9 +32,8 @@
|
|
| 43 |
{%- set reasoning_content = message.reasoning_content %}
|
| 44 |
{%- else %}
|
| 45 |
{%- if '</think>' in message.content %}
|
| 46 |
-
{%- set content =
|
| 47 |
-
{%- set reasoning_content =
|
| 48 |
-
{%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('\n') %}
|
| 49 |
{%- endif %}
|
| 50 |
{%- endif %}
|
| 51 |
{%- if loop.index0 > ns.last_query_index %}
|
|
|
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
{%- set ns.multi_step_tool = false %}
|
| 22 |
{%- set ns.last_query_index = index %}
|
| 23 |
{%- endif %}
|
|
|
|
| 32 |
{%- set reasoning_content = message.reasoning_content %}
|
| 33 |
{%- else %}
|
| 34 |
{%- if '</think>' in message.content %}
|
| 35 |
+
{%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
|
| 36 |
+
{%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
|
|
|
| 37 |
{%- endif %}
|
| 38 |
{%- endif %}
|
| 39 |
{%- if loop.index0 > ns.last_query_index %}
|
special_tokens_map.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
| 22 |
"single_word": false
|
| 23 |
},
|
| 24 |
"pad_token": {
|
| 25 |
-
"content": "<|
|
| 26 |
"lstrip": false,
|
| 27 |
"normalized": false,
|
| 28 |
"rstrip": false,
|
|
|
|
| 22 |
"single_word": false
|
| 23 |
},
|
| 24 |
"pad_token": {
|
| 25 |
+
"content": "<|endoftext|>",
|
| 26 |
"lstrip": false,
|
| 27 |
"normalized": false,
|
| 28 |
"rstrip": false,
|
tokenizer_config.json
CHANGED
|
@@ -231,8 +231,8 @@
|
|
| 231 |
"eos_token": "<|im_end|>",
|
| 232 |
"errors": "replace",
|
| 233 |
"extra_special_tokens": {},
|
| 234 |
-
"model_max_length":
|
| 235 |
-
"pad_token": "<|
|
| 236 |
"padding_side": "left",
|
| 237 |
"split_special_tokens": false,
|
| 238 |
"tokenizer_class": "Qwen2Tokenizer",
|
|
|
|
| 231 |
"eos_token": "<|im_end|>",
|
| 232 |
"errors": "replace",
|
| 233 |
"extra_special_tokens": {},
|
| 234 |
+
"model_max_length": 32768,
|
| 235 |
+
"pad_token": "<|endoftext|>",
|
| 236 |
"padding_side": "left",
|
| 237 |
"split_special_tokens": false,
|
| 238 |
"tokenizer_class": "Qwen2Tokenizer",
|