Thank you first commit
Browse files- .gitattributes +1 -0
- chat_template.jinja +112 -0
- config.json +47 -0
- generation_config.json +6 -0
- model-00001-of-00005.safetensors +3 -0
- model-00002-of-00005.safetensors +3 -0
- model-00003-of-00005.safetensors +3 -0
- model-00004-of-00005.safetensors +3 -0
- model-00005-of-00005.safetensors +3 -0
- model.safetensors.index.json +0 -0
- tokenizer.json +3 -0
- tokenizer_config.json +91 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro render_content(msg) -%}
|
| 2 |
+
{%- set c = msg.get('content') -%}
|
| 3 |
+
{%- if c is string -%}
|
| 4 |
+
{{ c }}
|
| 5 |
+
{%- elif c is not none -%}
|
| 6 |
+
{% for content in c -%}
|
| 7 |
+
{% if content['type'] == 'image' or content['type'] == 'image_url' -%}
|
| 8 |
+
<|media_begin|>image<|media_content|><|media_pad|><|media_end|>
|
| 9 |
+
{% elif content['type'] == 'video' or content['type']== 'video_url'-%}
|
| 10 |
+
<|kimi_k25_video_placeholder|>
|
| 11 |
+
{% else -%}
|
| 12 |
+
{{ content['text'] }}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- endfor -%}
|
| 15 |
+
{%- endif -%}
|
| 16 |
+
{%- endmacro -%}
|
| 17 |
+
|
| 18 |
+
{% macro set_roles(message) -%}
|
| 19 |
+
{%- set role_name = message.get('name') or message['role'] -%}
|
| 20 |
+
{%- if message['role'] == 'user' -%}
|
| 21 |
+
<|im_user|>{{role_name}}<|im_middle|>
|
| 22 |
+
{%- elif message['role'] == 'assistant' -%}
|
| 23 |
+
<|im_assistant|>{{role_name}}<|im_middle|>
|
| 24 |
+
{%- else -%}
|
| 25 |
+
<|im_system|>{{role_name}}<|im_middle|>
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endmacro -%}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
{%- macro render_toolcalls(message) -%}
|
| 31 |
+
<|tool_calls_section_begin|>
|
| 32 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 33 |
+
{%- set formatted_id = tool_call['id'] -%}
|
| 34 |
+
<|tool_call_begin|>{{ formatted_id }}<|tool_call_argument_begin|>{% if tool_call['function']['arguments'] is string %}{{ tool_call['function']['arguments'] }}{% else %}{{ tool_call['function']['arguments'] | tojson }}{% endif %}<|tool_call_end|>
|
| 35 |
+
{%- endfor -%}
|
| 36 |
+
<|tool_calls_section_end|>
|
| 37 |
+
{%- endmacro -%}
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
{%- set preserve_thinking = preserve_thinking | default(false) -%}
|
| 41 |
+
{# Find last non-tool-call assistant message. If preserve_thinking, keep -1 so hist is empty and all msgs use suffix (retain reasoning). #}
|
| 42 |
+
{%- set ns = namespace(last_non_tool_call_assistant_msg=-1) -%}
|
| 43 |
+
{%- if not preserve_thinking -%}
|
| 44 |
+
{%- for idx in range(messages|length-1, -1, -1) -%}
|
| 45 |
+
{%- if messages[idx]['role'] == 'assistant' and not messages[idx].get('tool_calls') -%}
|
| 46 |
+
{%- set ns.last_non_tool_call_assistant_msg = idx -%}
|
| 47 |
+
{%- break -%}
|
| 48 |
+
{%- endif -%}
|
| 49 |
+
{%- endfor -%}
|
| 50 |
+
{%- endif -%}
|
| 51 |
+
|
| 52 |
+
{# split all messages into history & suffix, reasoning_content in suffix should be reserved.#}
|
| 53 |
+
{%- set hist_msgs = messages[:ns.last_non_tool_call_assistant_msg+1] -%}
|
| 54 |
+
{%- set suffix_msgs = messages[ns.last_non_tool_call_assistant_msg+1:] -%}
|
| 55 |
+
|
| 56 |
+
{%- if tools -%}
|
| 57 |
+
{%- if tools_ts_str -%}
|
| 58 |
+
<|im_system|>tool_declare<|im_middle|>{{ tools_ts_str }}<|im_end|>
|
| 59 |
+
{%- else -%}
|
| 60 |
+
<|im_system|>tool_declare<|im_middle|>{{ tools | tojson(separators=(',', ':')) }}<|im_end|>
|
| 61 |
+
{%- endif -%}
|
| 62 |
+
{%- endif -%}
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
{%- for message in hist_msgs -%}
|
| 66 |
+
{{set_roles(message)}}
|
| 67 |
+
{%- if message['role'] == 'assistant' -%}
|
| 68 |
+
<think></think>{{render_content(message)}}
|
| 69 |
+
{%- if message.get('tool_calls') -%}
|
| 70 |
+
{{render_toolcalls(message)}}
|
| 71 |
+
{%- endif -%}
|
| 72 |
+
{%- elif message['role'] == 'tool' -%}
|
| 73 |
+
{%- set tool_call_id = message.tool_call_id -%}
|
| 74 |
+
## Return of {{ tool_call_id }}
|
| 75 |
+
{{render_content(message)}}
|
| 76 |
+
{%- elif message['content'] is not none -%}
|
| 77 |
+
{{render_content(message)}}
|
| 78 |
+
{%- endif -%}
|
| 79 |
+
<|im_end|>
|
| 80 |
+
{%- endfor -%}
|
| 81 |
+
|
| 82 |
+
{%- for message in suffix_msgs -%}
|
| 83 |
+
{{set_roles(message)}}
|
| 84 |
+
{%- if message['role'] == 'assistant' -%}
|
| 85 |
+
{%- if thinking is defined and thinking is false and preserve_thinking is false -%}
|
| 86 |
+
<think></think>{{render_content(message)}}
|
| 87 |
+
{%- else -%}
|
| 88 |
+
{%- set rc = message.get('reasoning', message.get('reasoning_content', '')) -%}
|
| 89 |
+
<think>{{rc}}</think>{{render_content(message)}}
|
| 90 |
+
{%- endif -%}
|
| 91 |
+
{%- if message.get('tool_calls') -%}
|
| 92 |
+
{{render_toolcalls(message)}}
|
| 93 |
+
{%- endif -%}
|
| 94 |
+
{%- elif message['role'] == 'tool' -%}
|
| 95 |
+
{%- set tool_call_id = message.tool_call_id -%}
|
| 96 |
+
## Return of {{ tool_call_id }}
|
| 97 |
+
{{render_content(message)}}
|
| 98 |
+
{%- elif message['content'] is not none -%}
|
| 99 |
+
{{render_content(message)}}
|
| 100 |
+
{%- endif -%}
|
| 101 |
+
<|im_end|>
|
| 102 |
+
{%- endfor -%}
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
{%- if add_generation_prompt -%}
|
| 106 |
+
<|im_assistant|>assistant<|im_middle|>
|
| 107 |
+
{%- if thinking is defined and thinking is false -%}
|
| 108 |
+
<think></think>
|
| 109 |
+
{%- else -%}
|
| 110 |
+
<think>
|
| 111 |
+
{%- endif -%}
|
| 112 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekV3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"aux_loss_alpha": 0.001,
|
| 8 |
+
"bos_token_id": 163584,
|
| 9 |
+
"eos_token_id": 163586,
|
| 10 |
+
"ep_size": 1,
|
| 11 |
+
"first_k_dense_replace": 1,
|
| 12 |
+
"hidden_act": "silu",
|
| 13 |
+
"hidden_size": 2048,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 11264,
|
| 16 |
+
"kv_lora_rank": 512,
|
| 17 |
+
"max_position_embeddings": 8192,
|
| 18 |
+
"model_type": "deepseek_v3",
|
| 19 |
+
"moe_intermediate_size": 1408,
|
| 20 |
+
"moe_layer_freq": 1,
|
| 21 |
+
"n_group": 1,
|
| 22 |
+
"n_routed_experts": 64,
|
| 23 |
+
"n_shared_experts": 2,
|
| 24 |
+
"norm_topk_prob": true,
|
| 25 |
+
"num_attention_heads": 16,
|
| 26 |
+
"num_experts_per_tok": 6,
|
| 27 |
+
"num_hidden_layers": 27,
|
| 28 |
+
"num_key_value_heads": 16,
|
| 29 |
+
"num_nextn_predict_layers": 0,
|
| 30 |
+
"pretraining_tp": 1,
|
| 31 |
+
"q_lora_rank": null,
|
| 32 |
+
"qk_nope_head_dim": 128,
|
| 33 |
+
"qk_rope_head_dim": 64,
|
| 34 |
+
"rms_norm_eps": 1e-05,
|
| 35 |
+
"rope_theta": 50000.0,
|
| 36 |
+
"routed_scaling_factor": 2.446,
|
| 37 |
+
"scoring_func": "sigmoid",
|
| 38 |
+
"seq_aux": true,
|
| 39 |
+
"tie_word_embeddings": false,
|
| 40 |
+
"topk_group": 1,
|
| 41 |
+
"topk_method": "noaux_tc",
|
| 42 |
+
"torch_dtype": "bfloat16",
|
| 43 |
+
"transformers_version": "4.46.3",
|
| 44 |
+
"use_cache": true,
|
| 45 |
+
"v_head_dim": 128,
|
| 46 |
+
"vocab_size": 163840
|
| 47 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_length": 8192,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
163586
|
| 5 |
+
]
|
| 6 |
+
}
|
model-00001-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5a1d782c6f616694d6baa171a0d414a86af6fa3c7042f8acfafb10314d76b273
|
| 3 |
+
size 5367016282
|
model-00002-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8a2e02829ee0c2f1c6871ed7a808ca5b76acfc072b26b448511512eef04a2b82
|
| 3 |
+
size 5364155121
|
model-00003-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15ea57ad163564eb648aa88031a2421f52895a6bbc0bd2e8145a3f85cd754186
|
| 3 |
+
size 5364154907
|
model-00004-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c077607d55fce90f6611e16710f04e7d2f76726d45d59f89d8ba45bec5a3346
|
| 3 |
+
size 5365194052
|
model-00005-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:107e29c1872d0ac666e159a4d1479f7e3dcb7d95d1aab71b712be8c9becd24cd
|
| 3 |
+
size 10460368351
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:298d5c670a2bdc9e632010dd4e793786da781d98a3312f34916496d10ccc743a
|
| 3 |
+
size 19593079
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"163584": {
|
| 4 |
+
"content": "[BOS]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"163585": {
|
| 12 |
+
"content": "[EOS]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"163586": {
|
| 20 |
+
"content": "<|im_end|>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"163601": {
|
| 28 |
+
"content": "<|im_middle|>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"163587": {
|
| 36 |
+
"content": "<|im_user|>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"163588": {
|
| 44 |
+
"content": "<|im_assistant|>",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
"163594": {
|
| 52 |
+
"content": "<|im_system|>",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": true
|
| 58 |
+
},
|
| 59 |
+
"163838": {
|
| 60 |
+
"content": "[PAD]",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false,
|
| 65 |
+
"special": true
|
| 66 |
+
},
|
| 67 |
+
"163839": {
|
| 68 |
+
"content": "[UNK]",
|
| 69 |
+
"lstrip": false,
|
| 70 |
+
"normalized": false,
|
| 71 |
+
"rstrip": false,
|
| 72 |
+
"single_word": false,
|
| 73 |
+
"special": true
|
| 74 |
+
}
|
| 75 |
+
},
|
| 76 |
+
"additional_special_tokens": [
|
| 77 |
+
"<|im_end|>",
|
| 78 |
+
"<|im_user|>",
|
| 79 |
+
"<|im_assistant|>",
|
| 80 |
+
"<|im_system|>",
|
| 81 |
+
"<|im_middle|>"
|
| 82 |
+
],
|
| 83 |
+
"bos_token": "[BOS]",
|
| 84 |
+
"clean_up_tokenization_spaces": false,
|
| 85 |
+
"eos_token": "[EOS]",
|
| 86 |
+
"extra_special_tokens": {},
|
| 87 |
+
"model_max_length": 1048576,
|
| 88 |
+
"pad_token": "[PAD]",
|
| 89 |
+
"unk_token": "[UNK]",
|
| 90 |
+
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 91 |
+
}
|