m1ngcheng commited on
Commit
849c58d
·
verified ·
1 Parent(s): fbe251b

Add files using upload-large-folder tool

Browse files
config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LLaDA2MoeModelLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "auto_map": {
7
+ "AutoConfig": "configuration_llada2_moe.LLaDA2MoeConfig",
8
+ "AutoModel": "modeling_llada2_moe.LLaDA2MoeModel",
9
+ "AutoModelForCausalLM": "modeling_llada2_moe.LLaDA2MoeModelLM"
10
+ },
11
+ "embedding_dropout": 0.0,
12
+ "first_k_dense_replace": 1,
13
+ "head_dim": 128,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 4096,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 9216,
18
+ "max_position_embeddings": 32768,
19
+ "max_window_layers": 28,
20
+ "model_type": "llada2_moe",
21
+ "moe_intermediate_size": 1024,
22
+ "moe_router_enable_expert_bias": true,
23
+ "n_group": 8,
24
+ "norm_head": false,
25
+ "norm_softmax": false,
26
+ "norm_topk_prob": true,
27
+ "num_attention_heads": 32,
28
+ "num_experts": 256,
29
+ "num_experts_per_tok": 8,
30
+ "num_hidden_layers": 32,
31
+ "num_key_value_heads": 4,
32
+ "num_shared_experts": 1,
33
+ "output_dropout": 0.0,
34
+ "output_router_logits": false,
35
+ "pad_token_id": 156892,
36
+ "partial_rotary_factor": 0.5,
37
+ "rms_norm_eps": 1e-06,
38
+ "rope_scaling": null,
39
+ "rope_theta": 600000,
40
+ "rotary_dim": 64,
41
+ "routed_scaling_factor": 2.5,
42
+ "router_dtype": "fp32",
43
+ "score_function": "sigmoid",
44
+ "sliding_window": 4096,
45
+ "tie_word_embeddings": false,
46
+ "topk_group": 4,
47
+ "torch_dtype": "bfloat16",
48
+ "transformers_version": "4.51.0",
49
+ "use_bias": false,
50
+ "use_cache": false,
51
+ "use_qkv_bias": false,
52
+ "use_rmsnorm": true,
53
+ "use_sliding_window": false,
54
+ "using_split_qkv_in_self_attention": false,
55
+ "vocab_size": 157184
56
+ }
configuration_llada2_moe.py ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """LLaDA2 MoE model configuration"""
2
+
3
+ from transformers.configuration_utils import PretrainedConfig
4
+
5
+
6
+ class LLaDA2MoeConfig(PretrainedConfig):
7
+ model_type = "llada2_moe"
8
+
9
+ def __init__(
10
+ self,
11
+ vocab_size=30592,
12
+ hidden_size=1024,
13
+ intermediate_size=None,
14
+ num_hidden_layers=24,
15
+ num_attention_heads=16,
16
+ num_key_value_heads=0,
17
+ hidden_act="silu",
18
+ use_qkv_bias=False, # llada2 only
19
+ use_qk_norm=False,
20
+ use_bias=True, # llada2 only
21
+ rms_norm_eps=1e-05,
22
+ norm_head=False, # llada2 only
23
+ tie_word_embeddings=False, # PretrainedConfig key, here change default value.
24
+ embedding_dropout=0.1,
25
+ attention_dropout=0.1,
26
+ output_dropout=0.1,
27
+ initializer_range=0.02,
28
+ max_position_embeddings=16384,
29
+ rope_theta=10000.0,
30
+ use_cache=True,
31
+ use_sliding_window=False,
32
+ sliding_window=4096,
33
+ max_window_layers=28,
34
+ rope_scaling=None,
35
+ pad_token_id=126081,
36
+ num_experts=16,
37
+ num_shared_experts=0,
38
+ num_experts_per_tok=2,
39
+ n_group=8,
40
+ topk_group=4,
41
+ routed_scaling_factor=2.5,
42
+ moe_intermediate_size=None,
43
+ first_k_dense_replace=0,
44
+ head_dim=None,
45
+ output_router_logits=False,
46
+ partial_rotary_factor=0.5,
47
+ **kwargs,
48
+ ):
49
+ self.num_hidden_layers = num_hidden_layers
50
+ self.vocab_size = vocab_size
51
+ self.hidden_size = hidden_size
52
+ self.intermediate_size = intermediate_size
53
+ self.num_attention_heads = num_attention_heads
54
+ self.num_key_value_heads = num_key_value_heads
55
+ self.hidden_act = hidden_act
56
+ self.use_qkv_bias = use_qkv_bias
57
+ self.use_bias = use_bias
58
+ self.norm_head = norm_head
59
+ self.rms_norm_eps = rms_norm_eps
60
+ self.embedding_dropout = embedding_dropout
61
+ self.attention_dropout = attention_dropout
62
+ self.output_dropout = output_dropout
63
+ self.initializer_range = initializer_range
64
+ self.max_position_embeddings = max_position_embeddings
65
+ self.rope_theta = rope_theta
66
+ self.use_cache = use_cache
67
+ self.use_sliding_window = use_sliding_window
68
+ self.sliding_window = sliding_window
69
+ self.max_window_layers = max_window_layers
70
+ self.head_dim = head_dim or self.hidden_size // self.num_attention_heads
71
+ self.rope_scaling = rope_scaling
72
+
73
+ # MoE configs
74
+ self.num_experts = num_experts
75
+ self.num_shared_experts = num_shared_experts
76
+ self.num_experts_per_tok = num_experts_per_tok
77
+ self.n_group = n_group
78
+ self.topk_group = topk_group
79
+ self.moe_intermediate_size = moe_intermediate_size
80
+ self.first_k_dense_replace = first_k_dense_replace
81
+ self.output_router_logits = output_router_logits
82
+ self.routed_scaling_factor = routed_scaling_factor
83
+ self.partial_rotary_factor = partial_rotary_factor
84
+
85
+ super().__init__(
86
+ pad_token_id=pad_token_id, tie_word_embeddings=tie_word_embeddings, **kwargs
87
+ )
model-00000-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10965f0e94973dc1fa9d67145dc94111de4968773c2d6818f0e95bb028c79d63
3
+ size 12304705856
model-00001-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e0372da86b06d5576c018ae3b87303b1f36487df00b3e2781625fde0eb9f4e1
3
+ size 6241216968
model-00002-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abac975420bcf2efdfb6efed606b3ac0d81bdf9fa5b81345d8b0ba4f371baecf
3
+ size 6241217160
model-00003-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f217442742299465f0a566ee88d1e1cccaa6468819d47f83db525bc7aaab0f7
3
+ size 6241217160
model-00004-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1286fad6e4bc073032fa0e1b5a5db65379bbd0d10d39fc88cced5f359e22f58
3
+ size 6241217160
model-00005-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76346ead4a40f1807cc936a74a533ca9dee41491c39611bfbb39aef14d8cd867
3
+ size 6241217160
model-00006-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a303fd89fb0032678611173650ceb96194e6d0a07849fabed6d77ea3a3977a6
3
+ size 6241217160
model-00007-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fce8de55ca6bc0dfc7802277469684f39ba194774660919dfd3db91c8f54881a
3
+ size 6241217160
model-00008-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4f7d73bcc9978fce9f47176e3b6ef7db7020260797564dee6b4438558ae4a92
3
+ size 6241217160
model-00009-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:173e0de554b570c888b8a55ab1ce6dfaf2c11ce64fc2f7cfd698611e7ae258d7
3
+ size 6241217160
model-00010-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81022aa01f59b3e43e956824f493dda0ce2d6831fcf41a0bfd84420d95fa405a
3
+ size 6241217160
model-00011-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88e0f3cf742a046a69b74b944115003755e58a76e4016efd17d4aad2999c6d42
3
+ size 6241217160
model-00012-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1cfd06ffecce41f386579ec03272e2742a6326e917ba1793ffb79928e5ad9696
3
+ size 6241217528
model-00013-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ac6464d1fc6786c52445e2b24400b0eafd3ed4ed42ffb4e02e5b7d47a5d3383
3
+ size 6241217904
model-00014-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd08bc4259afdf0bdb6841c70ba2abc90f1e08017a691d6751bd786a0c6209b3
3
+ size 6241217904
model-00015-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:698b260559ffb7465f16d535a3fb2be0518ee02165da641c0ed835e1c8c9996c
3
+ size 6241217904
model-00016-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b63b86618367304565a7b688d2cc1a0452b97e63bfc3b0d59a12923861abd1d1
3
+ size 6241217904
model-00017-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86835b11658f8727429590cf3663ebaccbc808af2668c7da8c2e05d33800e310
3
+ size 6241217904
model-00018-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:deb65b6879454d0fd42cbed635feabcf7bb56507fc954e60eaa705d11358e482
3
+ size 6241217904
model-00019-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49dfac039fd28ca93d27f5c5ce3efacb98096f28e432007d0ca87203b3c693b3
3
+ size 6241217904
model-00020-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62b565d51b5a66aecd0eaecdb43ab01543d64c4bb71a8a99c59b5ff676507e4b
3
+ size 6241217904
model-00021-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d008e619c43d299b71407e1e042fba557f3ab873053d0c4b32807bc5bf09eb53
3
+ size 6241217904
model-00022-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90c1dfa83a5ab87348a01753686d90fc836da7487bb7d77636b256a4dc50f8a1
3
+ size 6241217904
model-00023-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:922bb51c33bcfb7c8c69df77d0d57c4b547afa4480a3a7123e86a01f03d0ace4
3
+ size 6241217904
model-00024-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c71d5046bd8bd53e3a8098bda7d8bca9940389f3e3a2bfb3698bfd638b6dec4
3
+ size 6241217904
model-00025-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d19b5d22919b528fd3bca507e06e18fe21de0e310b1a537d830bacb4372cb47
3
+ size 6241217904
model-00026-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfe07be1d92e30808d47cf25d5b9ea9b38e0ca82bbe710079fd59a3a3eb4dde0
3
+ size 6241217904
model-00027-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a3e0c627ce019c475ff60453d5cc4ba1cbef07ad83d78081a0bbcf2190aa6a3
3
+ size 6241217904
model-00028-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d625336dd7492247b793a1adc9c742f5c342802a8be49f91467a3702d5c07ce3
3
+ size 6241217904
model-00029-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9106678a97b1aac299cf0768a75e74947db9b6dffa761e9ce630ba86d2bc27f7
3
+ size 6241217904
model-00030-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:493beefdbd25a1012cbdb2505a3872e489a1ce49b2871d599dfadaf39834008b
3
+ size 6241217904
model-00031-of-00032.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fd0d4b4d88d6499d7a4ff6521875a9c816ffb497254b5a2cc93f118eaab7ce1
3
+ size 6241217904
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|startoftext|>",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": "<|endoftext|>",
5
+ "gmask_token": "[gMASK]",
6
+ "pad_token": "<|endoftext|>",
7
+ "mask_token": "<|mask|>"
8
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "bos_token": "<|startoftext|>",
5
+ "chat_template": "{% set thinking_option = 'off' %}\n{{- '<role>SYSTEM</role>' }}\n{%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n' }}\n{%- endif %}\n{%- if tools %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call>\\n\" }}\n{%- endif %}\n{{- 'detailed thinking ' + thinking_option + '<|role_end|>' }}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- 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>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if message.role == \"user\" %}\n {{- '<role>HUMAN</role>' + message.content + '<|role_end|>' }}\n {%- elif message.role == \"system\" and not loop.first %}\n {{- '<role>SYSTEM</role>' + message.content + '<|role_end|>' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if reasoning_content %}\n {{- '<role>ASSISTANT</role>' + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<role>ASSISTANT</role>' + content }}\n {%- endif %}\n {%- else %}\n {{- '<role>ASSISTANT</role>' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|role_end|>' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<role>OBSERVATION</role>' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|role_end|>' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<role>ASSISTANT</role>' }}\n{%- endif %}",
6
+ "clean_up_tokenization_spaces": false,
7
+ "cls_token": "[CLS]",
8
+ "eos_token": "<|endoftext|>",
9
+ "mask_token": "<|mask|>",
10
+ "fast_tokenizer": true,
11
+ "gmask_token": "[gMASK]",
12
+ "merges_file": null,
13
+ "model_max_length": 32768,
14
+ "pad_token": "<|endoftext|>",
15
+ "tokenizer_class": "PreTrainedTokenizerFast",
16
+ "trust_remote_code": true,
17
+ "vocab_file": null
18
+ }