Upload model
Browse files- chat_template.jinja +47 -44
- config.json +1 -2
- generation_config.json +2 -3
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
- tokenizer_config.json +1 -1
chat_template.jinja
CHANGED
|
@@ -14,15 +14,6 @@
|
|
| 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 |
-
{# o-5DaWwWm #}
|
| 26 |
{%- for message in messages %}
|
| 27 |
{%- if message.content is string %}
|
| 28 |
{%- set content = message.content %}
|
|
@@ -32,44 +23,56 @@
|
|
| 32 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 33 |
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 34 |
{%- elif message.role == "assistant" %}
|
| 35 |
-
{
|
| 36 |
-
{%-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
{
|
| 40 |
-
|
| 41 |
-
{%-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
{%- endif %}
|
|
|
|
|
|
|
|
|
|
| 50 |
{%- else %}
|
| 51 |
-
{{-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
{
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
{%-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
{
|
| 66 |
-
|
| 67 |
-
{
|
| 68 |
-
|
| 69 |
-
{
|
| 70 |
-
{%-
|
|
|
|
| 71 |
{%- endif %}
|
| 72 |
-
{{- '<|im_end|>\n' }}
|
| 73 |
{%- elif message.role == "tool" %}
|
| 74 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 75 |
{{- '<|im_start|>user' }}
|
|
|
|
| 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 |
{%- 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 |
+
{{- '<|im_start|>' + message.role + '\n' }}
|
| 27 |
+
{%- set has_loss = (message.loss is defined and message.loss) %}
|
| 28 |
+
{%- if has_loss %}
|
| 29 |
+
{% generation %}
|
| 30 |
+
{{- content }}
|
| 31 |
+
{%- if message.tool_calls %}
|
| 32 |
+
{%- for tool_call in message.tool_calls %}
|
| 33 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 34 |
+
{{- '\n' }}
|
| 35 |
+
{%- endif %}
|
| 36 |
+
{%- if tool_call.function %}
|
| 37 |
+
{%- set tool_call = tool_call.function %}
|
| 38 |
+
{%- endif %}
|
| 39 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 40 |
+
{{- tool_call.name }}
|
| 41 |
+
{{- '", "arguments": ' }}
|
| 42 |
+
{%- if tool_call.arguments is string %}
|
| 43 |
+
{{- tool_call.arguments }}
|
| 44 |
+
{%- else %}
|
| 45 |
+
{{- tool_call.arguments | tojson }}
|
| 46 |
+
{%- endif %}
|
| 47 |
+
{{- '}\n</tool_call>' }}
|
| 48 |
+
{%- endfor %}
|
| 49 |
{%- endif %}
|
| 50 |
+
{{- '<|im_end|>' }}
|
| 51 |
+
{%- endgeneration %}
|
| 52 |
+
{{- '\n' }}
|
| 53 |
{%- else %}
|
| 54 |
+
{{- content }}
|
| 55 |
+
{%- if message.tool_calls %}
|
| 56 |
+
{%- for tool_call in message.tool_calls %}
|
| 57 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 58 |
+
{{- '\n' }}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{%- if tool_call.function %}
|
| 61 |
+
{%- set tool_call = tool_call.function %}
|
| 62 |
+
{%- endif %}
|
| 63 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 64 |
+
{{- tool_call.name }}
|
| 65 |
+
{{- '", "arguments": ' }}
|
| 66 |
+
{%- if tool_call.arguments is string %}
|
| 67 |
+
{{- tool_call.arguments }}
|
| 68 |
+
{%- else %}
|
| 69 |
+
{{- tool_call.arguments | tojson }}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{{- '}\n</tool_call>' }}
|
| 72 |
+
{%- endfor %}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{{- '<|im_end|>\n' }}
|
| 75 |
{%- endif %}
|
|
|
|
| 76 |
{%- elif message.role == "tool" %}
|
| 77 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 78 |
{{- '<|im_start|>user' }}
|
config.json
CHANGED
|
@@ -4,7 +4,6 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
-
"bos_token_id": 151643,
|
| 8 |
"dtype": "bfloat16",
|
| 9 |
"eos_token_id": 151645,
|
| 10 |
"head_dim": 128,
|
|
@@ -63,7 +62,7 @@
|
|
| 63 |
"sliding_window": null,
|
| 64 |
"tie_word_embeddings": true,
|
| 65 |
"transformers_version": "4.57.1",
|
| 66 |
-
"use_cache":
|
| 67 |
"use_sliding_window": false,
|
| 68 |
"vocab_size": 151936
|
| 69 |
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
|
|
|
| 7 |
"dtype": "bfloat16",
|
| 8 |
"eos_token_id": 151645,
|
| 9 |
"head_dim": 128,
|
|
|
|
| 62 |
"sliding_window": null,
|
| 63 |
"tie_word_embeddings": true,
|
| 64 |
"transformers_version": "4.57.1",
|
| 65 |
+
"use_cache": false,
|
| 66 |
"use_sliding_window": false,
|
| 67 |
"vocab_size": 151936
|
| 68 |
}
|
generation_config.json
CHANGED
|
@@ -1,13 +1,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.
|
| 10 |
"top_k": 20,
|
| 11 |
-
"top_p": 0.
|
| 12 |
"transformers_version": "4.57.1"
|
| 13 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"do_sample": true,
|
| 3 |
"eos_token_id": [
|
| 4 |
151645,
|
| 5 |
151643
|
| 6 |
],
|
| 7 |
"pad_token_id": 151643,
|
| 8 |
+
"temperature": 0.7,
|
| 9 |
"top_k": 20,
|
| 10 |
+
"top_p": 0.8,
|
| 11 |
"transformers_version": "4.57.1"
|
| 12 |
}
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4967215360
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6161ca1f0608777355fe845782b6cf7e0bb960528a6eb367659a15490181ec87
|
| 3 |
size 4967215360
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3077766632
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74e2ab9436bd02bb026875812750223b3f5155e7692f6bd031de8db9712e0778
|
| 3 |
size 3077766632
|
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": 1010000,
|
| 235 |
"pad_token": "<|endoftext|>",
|
| 236 |
"split_special_tokens": false,
|
| 237 |
"tokenizer_class": "Qwen2Tokenizer",
|