Upload optimized ONNX model
#1
by Xenova HF Staff - opened
- .gitattributes +2 -0
- chat_template.jinja +11 -0
- config.json +76 -0
- generation_config.json +6 -0
- onnx/model.onnx +3 -0
- onnx/model.onnx_data +3 -0
- onnx/model_fp16.onnx +3 -0
- onnx/model_fp16.onnx_data +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ 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 |
+
onnx/model.onnx_data filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
onnx/model_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true) %}{%- for message in messages %}{%- if message['role'] == 'system' %}{%- if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{%- else %}{% set ns.system_prompt = ns.system_prompt + '
|
| 2 |
+
|
| 3 |
+
' + message['content'] %}{%- endif %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '
|
| 4 |
+
' + '```json' + '
|
| 5 |
+
' + tool['function']['arguments'] + '
|
| 6 |
+
' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'
|
| 7 |
+
' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '
|
| 8 |
+
' + '```json' + '
|
| 9 |
+
' + tool['function']['arguments'] + '
|
| 10 |
+
' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{{'<|Assistant|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'
|
| 11 |
+
<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|>'}}{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekV3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "deepseek-ai/DeepSeek-V3--configuration_deepseek.DeepseekV3Config",
|
| 9 |
+
"AutoModel": "deepseek-ai/DeepSeek-V3--modeling_deepseek.DeepseekV3Model",
|
| 10 |
+
"AutoModelForCausalLM": "deepseek-ai/DeepSeek-V3--modeling_deepseek.DeepseekV3ForCausalLM"
|
| 11 |
+
},
|
| 12 |
+
"aux_loss_alpha": 0.001,
|
| 13 |
+
"bos_token_id": 0,
|
| 14 |
+
"dtype": "float32",
|
| 15 |
+
"eos_token_id": 1,
|
| 16 |
+
"ep_size": 1,
|
| 17 |
+
"first_k_dense_replace": 3,
|
| 18 |
+
"head_dim": 64,
|
| 19 |
+
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 8,
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 128,
|
| 23 |
+
"kv_lora_rank": 512,
|
| 24 |
+
"max_position_embeddings": 163840,
|
| 25 |
+
"model_type": "deepseek_v3",
|
| 26 |
+
"moe_intermediate_size": 2048,
|
| 27 |
+
"moe_layer_freq": 1,
|
| 28 |
+
"n_group": 2,
|
| 29 |
+
"n_routed_experts": 4,
|
| 30 |
+
"n_shared_experts": 1,
|
| 31 |
+
"norm_topk_prob": true,
|
| 32 |
+
"num_attention_heads": 2,
|
| 33 |
+
"num_experts_per_tok": 2,
|
| 34 |
+
"num_hidden_layers": 2,
|
| 35 |
+
"num_key_value_heads": 2,
|
| 36 |
+
"num_nextn_predict_layers": 1,
|
| 37 |
+
"pad_token_id": null,
|
| 38 |
+
"pretraining_tp": 1,
|
| 39 |
+
"q_lora_rank": 1536,
|
| 40 |
+
"qk_head_dim": 192,
|
| 41 |
+
"qk_nope_head_dim": 128,
|
| 42 |
+
"qk_rope_head_dim": 64,
|
| 43 |
+
"rms_norm_eps": 1e-06,
|
| 44 |
+
"rope_interleave": true,
|
| 45 |
+
"rope_parameters": {
|
| 46 |
+
"beta_fast": 32.0,
|
| 47 |
+
"beta_slow": 1.0,
|
| 48 |
+
"factor": 40.0,
|
| 49 |
+
"mscale": 1.0,
|
| 50 |
+
"mscale_all_dim": 1.0,
|
| 51 |
+
"original_max_position_embeddings": 4096,
|
| 52 |
+
"rope_theta": 10000,
|
| 53 |
+
"rope_type": "yarn",
|
| 54 |
+
"type": "yarn"
|
| 55 |
+
},
|
| 56 |
+
"routed_scaling_factor": 2.5,
|
| 57 |
+
"scoring_func": "sigmoid",
|
| 58 |
+
"seq_aux": true,
|
| 59 |
+
"tie_word_embeddings": false,
|
| 60 |
+
"topk_group": 4,
|
| 61 |
+
"topk_method": "noaux_tc",
|
| 62 |
+
"transformers_version": "5.3.0.dev0",
|
| 63 |
+
"use_cache": true,
|
| 64 |
+
"v_head_dim": 128,
|
| 65 |
+
"vocab_size": 129280,
|
| 66 |
+
"transformers.js_config": {
|
| 67 |
+
"use_external_data_format": {
|
| 68 |
+
"model.onnx": 1,
|
| 69 |
+
"model_fp16.onnx": 1
|
| 70 |
+
},
|
| 71 |
+
"kv_cache_dtype": {
|
| 72 |
+
"q4f16": "float16",
|
| 73 |
+
"fp16": "float16"
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 1,
|
| 5 |
+
"transformers_version": "5.3.0.dev0"
|
| 6 |
+
}
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:622a7640a1eac483f5a6f485ee5069521c2d65fc9a834db84058c89f7a028f70
|
| 3 |
+
size 40227
|
onnx/model.onnx_data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ebcf05627c0aace009f74e720931a135399ac5d86eaabc2736264865ddd03c72
|
| 3 |
+
size 57225216
|
onnx/model_fp16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:782ddf8124bc822943eb5f1d472e754f7b4e4a77eaa8cca6fa7848ba0d55f0a5
|
| 3 |
+
size 40232
|
onnx/model_fp16.onnx_data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c4c7ce7d17d037e74257e288bb1e7bda7c8b245ccb02f772ff21f7780858aa5
|
| 3 |
+
size 28612608
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<\uff5cbegin\u2581of\u2581sentence\uff5c>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<\uff5cend\u2581of\u2581sentence\uff5c>",
|
| 7 |
+
"is_local": false,
|
| 8 |
+
"model_max_length": 131072,
|
| 9 |
+
"pad_token": "<\uff5cend\u2581of\u2581sentence\uff5c>",
|
| 10 |
+
"sp_model_kwargs": {},
|
| 11 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 12 |
+
"unk_token": null,
|
| 13 |
+
"use_default_system_prompt": false,
|
| 14 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true) %}{%- for message in messages %}{%- if message['role'] == 'system' %}{%- if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{%- else %}{% set ns.system_prompt = ns.system_prompt + '\n\n' + message['content'] %}{%- endif %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<\uff5cUser\uff5c>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<\uff5cAssistant\uff5c><\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}{%- set ns.is_first = true -%}{%- else %}{{'\n' + '<\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}{{'<\uff5ctool\u2581calls\u2581end\uff5c><\uff5cend\u2581of\u2581sentence\uff5c>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<\uff5ctool\u2581outputs\u2581end\uff5c>' + message['content'] + '<\uff5cend\u2581of\u2581sentence\uff5c>'}}{%- set ns.is_tool = false -%}{%- else %}{{'<\uff5cAssistant\uff5c>' + message['content'] + '<\uff5cend\u2581of\u2581sentence\uff5c>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<\uff5ctool\u2581outputs\u2581begin\uff5c><\uff5ctool\u2581output\u2581begin\uff5c>' + message['content'] + '<\uff5ctool\u2581output\u2581end\uff5c>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\n<\uff5ctool\u2581output\u2581begin\uff5c>' + message['content'] + '<\uff5ctool\u2581output\u2581end\uff5c>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<\uff5ctool\u2581outputs\u2581end\uff5c>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<\uff5cAssistant\uff5c>'}}{% endif %}"
|
| 15 |
+
}
|