Upload folder using huggingface_hub
Browse files- chat_template.jinja +26 -31
- config.json +1 -1
- generation_config.json +3 -2
- model-00001-of-00002.safetensors +2 -2
- model-00002-of-00002.safetensors +2 -2
- tokenizer_config.json +1 -1
- training_args.bin +3 -0
chat_template.jinja
CHANGED
|
@@ -14,6 +14,14 @@
|
|
| 14 |
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
{%- for message in messages %}
|
| 18 |
{%- if message.content is string %}
|
| 19 |
{%- set content = message.content %}
|
|
@@ -23,13 +31,24 @@
|
|
| 23 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 24 |
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 25 |
{%- elif message.role == "assistant" %}
|
| 26 |
-
|
| 27 |
-
{%-
|
| 28 |
-
|
| 29 |
-
{
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
{%- if message.tool_calls %}
|
| 34 |
{%- for tool_call in message.tool_calls %}
|
| 35 |
{%- if (loop.first and content) or (not loop.first) %}
|
|
@@ -50,30 +69,6 @@
|
|
| 50 |
{%- endfor %}
|
| 51 |
{%- endif %}
|
| 52 |
{{- '<|im_end|>\n' }}
|
| 53 |
-
{%- endgeneration -%}
|
| 54 |
-
{%- else -%}
|
| 55 |
-
{{- content }}
|
| 56 |
-
{%- if message.tool_calls %}
|
| 57 |
-
{%- for tool_call in message.tool_calls %}
|
| 58 |
-
{%- if (loop.first and content) or (not loop.first) %}
|
| 59 |
-
{{- '\n' }}
|
| 60 |
-
{%- endif %}
|
| 61 |
-
{%- if tool_call.function %}
|
| 62 |
-
{%- set tool_call = tool_call.function %}
|
| 63 |
-
{%- endif %}
|
| 64 |
-
{{- '<tool_call>\n{"name": "' }}
|
| 65 |
-
{{- tool_call.name }}
|
| 66 |
-
{{- '", "arguments": ' }}
|
| 67 |
-
{%- if tool_call.arguments is string %}
|
| 68 |
-
{{- tool_call.arguments }}
|
| 69 |
-
{%- else %}
|
| 70 |
-
{{- tool_call.arguments | tojson }}
|
| 71 |
-
{%- endif %}
|
| 72 |
-
{{- '}\n</tool_call>' }}
|
| 73 |
-
{%- endfor %}
|
| 74 |
-
{%- endif %}
|
| 75 |
-
{{- '<|im_end|>\n' }}
|
| 76 |
-
{%- endif %}
|
| 77 |
{%- elif message.role == "tool" %}
|
| 78 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 79 |
{{- '<|im_start|>user' }}
|
|
|
|
| 14 |
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 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 message.content is string 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 %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
| 26 |
{%- if message.content is string %}
|
| 27 |
{%- set content = message.content %}
|
|
|
|
| 31 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
{%- elif message.role == "assistant" %}
|
| 34 |
+
{%- set reasoning_content = '' %}
|
| 35 |
+
{%- if message.reasoning_content is string %}
|
| 36 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
+
{%- else %}
|
| 38 |
+
{%- if '</think>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 44 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 45 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 46 |
+
{%- else %}
|
| 47 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- else %}
|
| 50 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 51 |
+
{%- endif %}
|
| 52 |
{%- if message.tool_calls %}
|
| 53 |
{%- for tool_call in message.tool_calls %}
|
| 54 |
{%- if (loop.first and content) or (not loop.first) %}
|
|
|
|
| 69 |
{%- endfor %}
|
| 70 |
{%- endif %}
|
| 71 |
{{- '<|im_end|>\n' }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
{%- elif message.role == "tool" %}
|
| 73 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
{{- '<|im_start|>user' }}
|
config.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
-
"dtype": "
|
| 8 |
"eos_token_id": 151645,
|
| 9 |
"head_dim": 128,
|
| 10 |
"hidden_act": "silu",
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"dtype": "bfloat16",
|
| 8 |
"eos_token_id": 151645,
|
| 9 |
"head_dim": 128,
|
| 10 |
"hidden_act": "silu",
|
generation_config.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"do_sample": true,
|
| 3 |
"eos_token_id": [
|
| 4 |
151645,
|
| 5 |
151643
|
| 6 |
],
|
| 7 |
"pad_token_id": 151643,
|
| 8 |
-
"temperature": 0.
|
| 9 |
"top_k": 20,
|
| 10 |
-
"top_p": 0.
|
| 11 |
"transformers_version": "4.57.3"
|
| 12 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
"do_sample": true,
|
| 4 |
"eos_token_id": [
|
| 5 |
151645,
|
| 6 |
151643
|
| 7 |
],
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
+
"temperature": 0.6,
|
| 10 |
"top_k": 20,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
"transformers_version": "4.57.3"
|
| 13 |
}
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7210a54ec230a534793ec5db8e45c1cba24a7d84af20e6ef98277adbc908fe5
|
| 3 |
+
size 4967215328
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d87f9f18de6f60aea9ead3fa71d9d802850d5713baf9487857b96953cd7c336b
|
| 3 |
+
size 3077766608
|
tokenizer_config.json
CHANGED
|
@@ -231,7 +231,7 @@
|
|
| 231 |
"eos_token": "<|im_end|>",
|
| 232 |
"errors": "replace",
|
| 233 |
"extra_special_tokens": {},
|
| 234 |
-
"model_max_length":
|
| 235 |
"pad_token": "<|endoftext|>",
|
| 236 |
"split_special_tokens": false,
|
| 237 |
"tokenizer_class": "Qwen2Tokenizer",
|
|
|
|
| 231 |
"eos_token": "<|im_end|>",
|
| 232 |
"errors": "replace",
|
| 233 |
"extra_special_tokens": {},
|
| 234 |
+
"model_max_length": 262144,
|
| 235 |
"pad_token": "<|endoftext|>",
|
| 236 |
"split_special_tokens": false,
|
| 237 |
"tokenizer_class": "Qwen2Tokenizer",
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8d5debf9e85563d6e6662ce392b834283ddbdf8157c76b3cd55a2b75477fba47
|
| 3 |
+
size 5841
|