Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- chat_template.jinja +86 -0
- config.json +863 -0
- generation_config.json +13 -0
- glm47_moe_tool_parser_fixed.py +532 -0
- model-00001-of-00013.safetensors +3 -0
- model-00002-of-00013.safetensors +3 -0
- model-00003-of-00013.safetensors +3 -0
- model-00004-of-00013.safetensors +3 -0
- model-00005-of-00013.safetensors +3 -0
- model-00006-of-00013.safetensors +3 -0
- model-00007-of-00013.safetensors +3 -0
- model-00008-of-00013.safetensors +3 -0
- model-00009-of-00013.safetensors +3 -0
- model-00010-of-00013.safetensors +3 -0
- model-00011-of-00013.safetensors +3 -0
- model-00012-of-00013.safetensors +3 -0
- model-00013-of-00013.safetensors +3 -0
- model-mtp-layer78-pruned.safetensors +3 -0
- model.safetensors.index.json +0 -0
- reap_args.yaml +77 -0
- retained_experts.json +0 -0
- tokenizer.json +3 -0
- tokenizer_config.json +33 -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,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[gMASK]<sop>
|
| 2 |
+
{%- if tools -%}
|
| 3 |
+
<|system|>
|
| 4 |
+
# Tools
|
| 5 |
+
|
| 6 |
+
You may call one or more functions to assist with the user query.
|
| 7 |
+
|
| 8 |
+
You are provided with function signatures within <tools></tools> XML tags:
|
| 9 |
+
<tools>
|
| 10 |
+
{% for tool in tools %}
|
| 11 |
+
{{ tool | tojson(ensure_ascii=False) }}
|
| 12 |
+
{% endfor %}
|
| 13 |
+
</tools>
|
| 14 |
+
|
| 15 |
+
For each function call, output the function name and arguments within the following XML format:
|
| 16 |
+
<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}
|
| 17 |
+
{%- macro visible_text(content) -%}
|
| 18 |
+
{%- if content is string -%}
|
| 19 |
+
{{- content }}
|
| 20 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 21 |
+
{%- for item in content -%}
|
| 22 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 23 |
+
{{- item.text }}
|
| 24 |
+
{%- elif item is string -%}
|
| 25 |
+
{{- item }}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endfor -%}
|
| 28 |
+
{%- else -%}
|
| 29 |
+
{{- content }}
|
| 30 |
+
{%- endif -%}
|
| 31 |
+
{%- endmacro -%}
|
| 32 |
+
{%- set ns = namespace(last_user_index=-1) %}
|
| 33 |
+
{%- for m in messages %}
|
| 34 |
+
{%- if m.role == 'user' %}
|
| 35 |
+
{%- set ns.last_user_index = loop.index0 -%}
|
| 36 |
+
{%- endif %}
|
| 37 |
+
{%- endfor %}
|
| 38 |
+
{%- for m in messages -%}
|
| 39 |
+
{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
|
| 40 |
+
{%- elif m.role == 'assistant' -%}
|
| 41 |
+
<|assistant|>
|
| 42 |
+
{%- set reasoning_content = '' %}
|
| 43 |
+
{%- set content = visible_text(m.content) %}
|
| 44 |
+
{%- if m.reasoning_content is string %}
|
| 45 |
+
{%- set reasoning_content = m.reasoning_content %}
|
| 46 |
+
{%- else %}
|
| 47 |
+
{%- if '</think>' in content %}
|
| 48 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 49 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content -%}
|
| 53 |
+
{{ '<think>' + reasoning_content.strip() + '</think>'}}
|
| 54 |
+
{%- else -%}
|
| 55 |
+
{{ '</think>' }}
|
| 56 |
+
{%- endif -%}
|
| 57 |
+
{%- if content.strip() -%}
|
| 58 |
+
{{ content.strip() }}
|
| 59 |
+
{%- endif -%}
|
| 60 |
+
{% if m.tool_calls %}
|
| 61 |
+
{% for tc in m.tool_calls %}
|
| 62 |
+
{%- if tc.function %}
|
| 63 |
+
{%- set tc = tc.function %}
|
| 64 |
+
{%- endif %}
|
| 65 |
+
{{- '<tool_call>' + tc.name -}}
|
| 66 |
+
{% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}
|
| 67 |
+
{% endif %}
|
| 68 |
+
{%- elif m.role == 'tool' -%}
|
| 69 |
+
{%- if m.content is string -%}
|
| 70 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 71 |
+
{{- '<|observation|>' }}
|
| 72 |
+
{%- endif %}
|
| 73 |
+
{{- '<tool_response>' }}
|
| 74 |
+
{{- m.content }}
|
| 75 |
+
{{- '</tool_response>' }}
|
| 76 |
+
{%- else -%}
|
| 77 |
+
<|observation|>{% for tr in m.content %}
|
| 78 |
+
<tool_response>{{ tr.output if tr.output is defined else tr }}</tool_response>{% endfor -%}
|
| 79 |
+
{% endif -%}
|
| 80 |
+
{%- elif m.role == 'system' -%}
|
| 81 |
+
<|system|>{{ visible_text(m.content) }}
|
| 82 |
+
{%- endif -%}
|
| 83 |
+
{%- endfor -%}
|
| 84 |
+
{%- if add_generation_prompt -%}
|
| 85 |
+
<|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
|
| 86 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,863 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GlmMoeDsaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": [
|
| 10 |
+
154820,
|
| 11 |
+
154827,
|
| 12 |
+
154829
|
| 13 |
+
],
|
| 14 |
+
"ep_size": 1,
|
| 15 |
+
"first_k_dense_replace": 3,
|
| 16 |
+
"head_dim": 64,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 6144,
|
| 19 |
+
"index_head_dim": 128,
|
| 20 |
+
"index_n_heads": 32,
|
| 21 |
+
"index_topk": 2048,
|
| 22 |
+
"indexer_rope_interleave": true,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 12288,
|
| 25 |
+
"kv_lora_rank": 512,
|
| 26 |
+
"max_position_embeddings": 202752,
|
| 27 |
+
"mlp_layer_types": [
|
| 28 |
+
"dense",
|
| 29 |
+
"dense",
|
| 30 |
+
"dense",
|
| 31 |
+
"sparse",
|
| 32 |
+
"sparse",
|
| 33 |
+
"sparse",
|
| 34 |
+
"sparse",
|
| 35 |
+
"sparse",
|
| 36 |
+
"sparse",
|
| 37 |
+
"sparse",
|
| 38 |
+
"sparse",
|
| 39 |
+
"sparse",
|
| 40 |
+
"sparse",
|
| 41 |
+
"sparse",
|
| 42 |
+
"sparse",
|
| 43 |
+
"sparse",
|
| 44 |
+
"sparse",
|
| 45 |
+
"sparse",
|
| 46 |
+
"sparse",
|
| 47 |
+
"sparse",
|
| 48 |
+
"sparse",
|
| 49 |
+
"sparse",
|
| 50 |
+
"sparse",
|
| 51 |
+
"sparse",
|
| 52 |
+
"sparse",
|
| 53 |
+
"sparse",
|
| 54 |
+
"sparse",
|
| 55 |
+
"sparse",
|
| 56 |
+
"sparse",
|
| 57 |
+
"sparse",
|
| 58 |
+
"sparse",
|
| 59 |
+
"sparse",
|
| 60 |
+
"sparse",
|
| 61 |
+
"sparse",
|
| 62 |
+
"sparse",
|
| 63 |
+
"sparse",
|
| 64 |
+
"sparse",
|
| 65 |
+
"sparse",
|
| 66 |
+
"sparse",
|
| 67 |
+
"sparse",
|
| 68 |
+
"sparse",
|
| 69 |
+
"sparse",
|
| 70 |
+
"sparse",
|
| 71 |
+
"sparse",
|
| 72 |
+
"sparse",
|
| 73 |
+
"sparse",
|
| 74 |
+
"sparse",
|
| 75 |
+
"sparse",
|
| 76 |
+
"sparse",
|
| 77 |
+
"sparse",
|
| 78 |
+
"sparse",
|
| 79 |
+
"sparse",
|
| 80 |
+
"sparse",
|
| 81 |
+
"sparse",
|
| 82 |
+
"sparse",
|
| 83 |
+
"sparse",
|
| 84 |
+
"sparse",
|
| 85 |
+
"sparse",
|
| 86 |
+
"sparse",
|
| 87 |
+
"sparse",
|
| 88 |
+
"sparse",
|
| 89 |
+
"sparse",
|
| 90 |
+
"sparse",
|
| 91 |
+
"sparse",
|
| 92 |
+
"sparse",
|
| 93 |
+
"sparse",
|
| 94 |
+
"sparse",
|
| 95 |
+
"sparse",
|
| 96 |
+
"sparse",
|
| 97 |
+
"sparse",
|
| 98 |
+
"sparse",
|
| 99 |
+
"sparse",
|
| 100 |
+
"sparse",
|
| 101 |
+
"sparse",
|
| 102 |
+
"sparse",
|
| 103 |
+
"sparse",
|
| 104 |
+
"sparse",
|
| 105 |
+
"sparse"
|
| 106 |
+
],
|
| 107 |
+
"model_type": "glm_moe_dsa",
|
| 108 |
+
"moe_intermediate_size": 2048,
|
| 109 |
+
"moe_layer_freq": 1,
|
| 110 |
+
"n_group": 1,
|
| 111 |
+
"n_routed_experts": 205,
|
| 112 |
+
"n_shared_experts": 1,
|
| 113 |
+
"norm_topk_prob": true,
|
| 114 |
+
"num_attention_heads": 64,
|
| 115 |
+
"num_experts_per_tok": 8,
|
| 116 |
+
"num_hidden_layers": 78,
|
| 117 |
+
"num_key_value_heads": 64,
|
| 118 |
+
"num_nextn_predict_layers": 1,
|
| 119 |
+
"pad_token_id": 154820,
|
| 120 |
+
"pretraining_tp": 1,
|
| 121 |
+
"q_lora_rank": 2048,
|
| 122 |
+
"qk_head_dim": 256,
|
| 123 |
+
"qk_nope_head_dim": 192,
|
| 124 |
+
"qk_rope_head_dim": 64,
|
| 125 |
+
"quantization_config": {
|
| 126 |
+
"activation_scheme": "dynamic",
|
| 127 |
+
"dequantize": false,
|
| 128 |
+
"modules_to_not_convert": [
|
| 129 |
+
"lm_head",
|
| 130 |
+
"model.embed_tokens",
|
| 131 |
+
"model.layers.0.input_layernorm",
|
| 132 |
+
"model.layers.0.post_attention_layernorm",
|
| 133 |
+
"model.layers.0.self_attn.indexer.k_norm",
|
| 134 |
+
"model.layers.0.self_attn.indexer.k_norm.bias",
|
| 135 |
+
"model.layers.0.self_attn.indexers_proj",
|
| 136 |
+
"model.layers.0.self_attn.kv_a_layernorm",
|
| 137 |
+
"model.layers.0.self_attn.q_a_layernorm",
|
| 138 |
+
"model.layers.1.input_layernorm",
|
| 139 |
+
"model.layers.1.post_attention_layernorm",
|
| 140 |
+
"model.layers.1.self_attn.indexer.k_norm",
|
| 141 |
+
"model.layers.1.self_attn.indexer.k_norm.bias",
|
| 142 |
+
"model.layers.1.self_attn.indexers_proj",
|
| 143 |
+
"model.layers.1.self_attn.kv_a_layernorm",
|
| 144 |
+
"model.layers.1.self_attn.q_a_layernorm",
|
| 145 |
+
"model.layers.2.input_layernorm",
|
| 146 |
+
"model.layers.2.post_attention_layernorm",
|
| 147 |
+
"model.layers.2.self_attn.indexer.k_norm",
|
| 148 |
+
"model.layers.2.self_attn.indexer.k_norm.bias",
|
| 149 |
+
"model.layers.2.self_attn.indexers_proj",
|
| 150 |
+
"model.layers.2.self_attn.kv_a_layernorm",
|
| 151 |
+
"model.layers.2.self_attn.q_a_layernorm",
|
| 152 |
+
"model.layers.3.input_layernorm",
|
| 153 |
+
"model.layers.3.mlp.gate",
|
| 154 |
+
"model.layers.3.mlp.gate.e_score_correction_bias",
|
| 155 |
+
"model.layers.3.post_attention_layernorm",
|
| 156 |
+
"model.layers.3.self_attn.indexer.k_norm",
|
| 157 |
+
"model.layers.3.self_attn.indexer.k_norm.bias",
|
| 158 |
+
"model.layers.3.self_attn.indexers_proj",
|
| 159 |
+
"model.layers.3.self_attn.kv_a_layernorm",
|
| 160 |
+
"model.layers.3.self_attn.q_a_layernorm",
|
| 161 |
+
"model.layers.4.input_layernorm",
|
| 162 |
+
"model.layers.4.mlp.gate",
|
| 163 |
+
"model.layers.4.mlp.gate.e_score_correction_bias",
|
| 164 |
+
"model.layers.4.post_attention_layernorm",
|
| 165 |
+
"model.layers.4.self_attn.indexer.k_norm",
|
| 166 |
+
"model.layers.4.self_attn.indexer.k_norm.bias",
|
| 167 |
+
"model.layers.4.self_attn.indexers_proj",
|
| 168 |
+
"model.layers.4.self_attn.kv_a_layernorm",
|
| 169 |
+
"model.layers.4.self_attn.q_a_layernorm",
|
| 170 |
+
"model.layers.5.input_layernorm",
|
| 171 |
+
"model.layers.5.mlp.gate",
|
| 172 |
+
"model.layers.5.mlp.gate.e_score_correction_bias",
|
| 173 |
+
"model.layers.5.post_attention_layernorm",
|
| 174 |
+
"model.layers.5.self_attn.indexer.k_norm",
|
| 175 |
+
"model.layers.5.self_attn.indexer.k_norm.bias",
|
| 176 |
+
"model.layers.5.self_attn.indexers_proj",
|
| 177 |
+
"model.layers.5.self_attn.kv_a_layernorm",
|
| 178 |
+
"model.layers.5.self_attn.q_a_layernorm",
|
| 179 |
+
"model.layers.6.input_layernorm",
|
| 180 |
+
"model.layers.6.mlp.gate",
|
| 181 |
+
"model.layers.6.mlp.gate.e_score_correction_bias",
|
| 182 |
+
"model.layers.6.post_attention_layernorm",
|
| 183 |
+
"model.layers.6.self_attn.indexer.k_norm",
|
| 184 |
+
"model.layers.6.self_attn.indexer.k_norm.bias",
|
| 185 |
+
"model.layers.6.self_attn.indexers_proj",
|
| 186 |
+
"model.layers.6.self_attn.kv_a_layernorm",
|
| 187 |
+
"model.layers.6.self_attn.q_a_layernorm",
|
| 188 |
+
"model.layers.7.input_layernorm",
|
| 189 |
+
"model.layers.7.mlp.gate",
|
| 190 |
+
"model.layers.7.mlp.gate.e_score_correction_bias",
|
| 191 |
+
"model.layers.7.post_attention_layernorm",
|
| 192 |
+
"model.layers.7.self_attn.indexer.k_norm",
|
| 193 |
+
"model.layers.7.self_attn.indexer.k_norm.bias",
|
| 194 |
+
"model.layers.7.self_attn.indexers_proj",
|
| 195 |
+
"model.layers.7.self_attn.kv_a_layernorm",
|
| 196 |
+
"model.layers.7.self_attn.q_a_layernorm",
|
| 197 |
+
"model.layers.8.input_layernorm",
|
| 198 |
+
"model.layers.8.mlp.gate",
|
| 199 |
+
"model.layers.8.mlp.gate.e_score_correction_bias",
|
| 200 |
+
"model.layers.8.post_attention_layernorm",
|
| 201 |
+
"model.layers.8.self_attn.indexer.k_norm",
|
| 202 |
+
"model.layers.8.self_attn.indexer.k_norm.bias",
|
| 203 |
+
"model.layers.8.self_attn.indexers_proj",
|
| 204 |
+
"model.layers.8.self_attn.kv_a_layernorm",
|
| 205 |
+
"model.layers.8.self_attn.q_a_layernorm",
|
| 206 |
+
"model.layers.9.input_layernorm",
|
| 207 |
+
"model.layers.9.mlp.gate",
|
| 208 |
+
"model.layers.9.mlp.gate.e_score_correction_bias",
|
| 209 |
+
"model.layers.9.post_attention_layernorm",
|
| 210 |
+
"model.layers.9.self_attn.indexer.k_norm",
|
| 211 |
+
"model.layers.9.self_attn.indexer.k_norm.bias",
|
| 212 |
+
"model.layers.9.self_attn.indexers_proj",
|
| 213 |
+
"model.layers.9.self_attn.kv_a_layernorm",
|
| 214 |
+
"model.layers.9.self_attn.q_a_layernorm",
|
| 215 |
+
"model.layers.10.input_layernorm",
|
| 216 |
+
"model.layers.10.mlp.gate",
|
| 217 |
+
"model.layers.10.mlp.gate.e_score_correction_bias",
|
| 218 |
+
"model.layers.10.post_attention_layernorm",
|
| 219 |
+
"model.layers.10.self_attn.indexer.k_norm",
|
| 220 |
+
"model.layers.10.self_attn.indexer.k_norm.bias",
|
| 221 |
+
"model.layers.10.self_attn.indexers_proj",
|
| 222 |
+
"model.layers.10.self_attn.kv_a_layernorm",
|
| 223 |
+
"model.layers.10.self_attn.q_a_layernorm",
|
| 224 |
+
"model.layers.11.input_layernorm",
|
| 225 |
+
"model.layers.11.mlp.gate",
|
| 226 |
+
"model.layers.11.mlp.gate.e_score_correction_bias",
|
| 227 |
+
"model.layers.11.post_attention_layernorm",
|
| 228 |
+
"model.layers.11.self_attn.indexer.k_norm",
|
| 229 |
+
"model.layers.11.self_attn.indexer.k_norm.bias",
|
| 230 |
+
"model.layers.11.self_attn.indexers_proj",
|
| 231 |
+
"model.layers.11.self_attn.kv_a_layernorm",
|
| 232 |
+
"model.layers.11.self_attn.q_a_layernorm",
|
| 233 |
+
"model.layers.12.input_layernorm",
|
| 234 |
+
"model.layers.12.mlp.gate",
|
| 235 |
+
"model.layers.12.mlp.gate.e_score_correction_bias",
|
| 236 |
+
"model.layers.12.post_attention_layernorm",
|
| 237 |
+
"model.layers.12.self_attn.indexer.k_norm",
|
| 238 |
+
"model.layers.12.self_attn.indexer.k_norm.bias",
|
| 239 |
+
"model.layers.12.self_attn.indexers_proj",
|
| 240 |
+
"model.layers.12.self_attn.kv_a_layernorm",
|
| 241 |
+
"model.layers.12.self_attn.q_a_layernorm",
|
| 242 |
+
"model.layers.13.input_layernorm",
|
| 243 |
+
"model.layers.13.mlp.gate",
|
| 244 |
+
"model.layers.13.mlp.gate.e_score_correction_bias",
|
| 245 |
+
"model.layers.13.post_attention_layernorm",
|
| 246 |
+
"model.layers.13.self_attn.indexer.k_norm",
|
| 247 |
+
"model.layers.13.self_attn.indexer.k_norm.bias",
|
| 248 |
+
"model.layers.13.self_attn.indexers_proj",
|
| 249 |
+
"model.layers.13.self_attn.kv_a_layernorm",
|
| 250 |
+
"model.layers.13.self_attn.q_a_layernorm",
|
| 251 |
+
"model.layers.14.input_layernorm",
|
| 252 |
+
"model.layers.14.mlp.gate",
|
| 253 |
+
"model.layers.14.mlp.gate.e_score_correction_bias",
|
| 254 |
+
"model.layers.14.post_attention_layernorm",
|
| 255 |
+
"model.layers.14.self_attn.indexer.k_norm",
|
| 256 |
+
"model.layers.14.self_attn.indexer.k_norm.bias",
|
| 257 |
+
"model.layers.14.self_attn.indexers_proj",
|
| 258 |
+
"model.layers.14.self_attn.kv_a_layernorm",
|
| 259 |
+
"model.layers.14.self_attn.q_a_layernorm",
|
| 260 |
+
"model.layers.15.input_layernorm",
|
| 261 |
+
"model.layers.15.mlp.gate",
|
| 262 |
+
"model.layers.15.mlp.gate.e_score_correction_bias",
|
| 263 |
+
"model.layers.15.post_attention_layernorm",
|
| 264 |
+
"model.layers.15.self_attn.indexer.k_norm",
|
| 265 |
+
"model.layers.15.self_attn.indexer.k_norm.bias",
|
| 266 |
+
"model.layers.15.self_attn.indexers_proj",
|
| 267 |
+
"model.layers.15.self_attn.kv_a_layernorm",
|
| 268 |
+
"model.layers.15.self_attn.q_a_layernorm",
|
| 269 |
+
"model.layers.16.input_layernorm",
|
| 270 |
+
"model.layers.16.mlp.gate",
|
| 271 |
+
"model.layers.16.mlp.gate.e_score_correction_bias",
|
| 272 |
+
"model.layers.16.post_attention_layernorm",
|
| 273 |
+
"model.layers.16.self_attn.indexer.k_norm",
|
| 274 |
+
"model.layers.16.self_attn.indexer.k_norm.bias",
|
| 275 |
+
"model.layers.16.self_attn.indexers_proj",
|
| 276 |
+
"model.layers.16.self_attn.kv_a_layernorm",
|
| 277 |
+
"model.layers.16.self_attn.q_a_layernorm",
|
| 278 |
+
"model.layers.17.input_layernorm",
|
| 279 |
+
"model.layers.17.mlp.gate",
|
| 280 |
+
"model.layers.17.mlp.gate.e_score_correction_bias",
|
| 281 |
+
"model.layers.17.post_attention_layernorm",
|
| 282 |
+
"model.layers.17.self_attn.indexer.k_norm",
|
| 283 |
+
"model.layers.17.self_attn.indexer.k_norm.bias",
|
| 284 |
+
"model.layers.17.self_attn.indexers_proj",
|
| 285 |
+
"model.layers.17.self_attn.kv_a_layernorm",
|
| 286 |
+
"model.layers.17.self_attn.q_a_layernorm",
|
| 287 |
+
"model.layers.18.input_layernorm",
|
| 288 |
+
"model.layers.18.mlp.gate",
|
| 289 |
+
"model.layers.18.mlp.gate.e_score_correction_bias",
|
| 290 |
+
"model.layers.18.post_attention_layernorm",
|
| 291 |
+
"model.layers.18.self_attn.indexer.k_norm",
|
| 292 |
+
"model.layers.18.self_attn.indexer.k_norm.bias",
|
| 293 |
+
"model.layers.18.self_attn.indexers_proj",
|
| 294 |
+
"model.layers.18.self_attn.kv_a_layernorm",
|
| 295 |
+
"model.layers.18.self_attn.q_a_layernorm",
|
| 296 |
+
"model.layers.19.input_layernorm",
|
| 297 |
+
"model.layers.19.mlp.gate",
|
| 298 |
+
"model.layers.19.mlp.gate.e_score_correction_bias",
|
| 299 |
+
"model.layers.19.post_attention_layernorm",
|
| 300 |
+
"model.layers.19.self_attn.indexer.k_norm",
|
| 301 |
+
"model.layers.19.self_attn.indexer.k_norm.bias",
|
| 302 |
+
"model.layers.19.self_attn.indexers_proj",
|
| 303 |
+
"model.layers.19.self_attn.kv_a_layernorm",
|
| 304 |
+
"model.layers.19.self_attn.q_a_layernorm",
|
| 305 |
+
"model.layers.20.input_layernorm",
|
| 306 |
+
"model.layers.20.mlp.gate",
|
| 307 |
+
"model.layers.20.mlp.gate.e_score_correction_bias",
|
| 308 |
+
"model.layers.20.post_attention_layernorm",
|
| 309 |
+
"model.layers.20.self_attn.indexer.k_norm",
|
| 310 |
+
"model.layers.20.self_attn.indexer.k_norm.bias",
|
| 311 |
+
"model.layers.20.self_attn.indexers_proj",
|
| 312 |
+
"model.layers.20.self_attn.kv_a_layernorm",
|
| 313 |
+
"model.layers.20.self_attn.q_a_layernorm",
|
| 314 |
+
"model.layers.21.input_layernorm",
|
| 315 |
+
"model.layers.21.mlp.gate",
|
| 316 |
+
"model.layers.21.mlp.gate.e_score_correction_bias",
|
| 317 |
+
"model.layers.21.post_attention_layernorm",
|
| 318 |
+
"model.layers.21.self_attn.indexer.k_norm",
|
| 319 |
+
"model.layers.21.self_attn.indexer.k_norm.bias",
|
| 320 |
+
"model.layers.21.self_attn.indexers_proj",
|
| 321 |
+
"model.layers.21.self_attn.kv_a_layernorm",
|
| 322 |
+
"model.layers.21.self_attn.q_a_layernorm",
|
| 323 |
+
"model.layers.22.input_layernorm",
|
| 324 |
+
"model.layers.22.mlp.gate",
|
| 325 |
+
"model.layers.22.mlp.gate.e_score_correction_bias",
|
| 326 |
+
"model.layers.22.post_attention_layernorm",
|
| 327 |
+
"model.layers.22.self_attn.indexer.k_norm",
|
| 328 |
+
"model.layers.22.self_attn.indexer.k_norm.bias",
|
| 329 |
+
"model.layers.22.self_attn.indexers_proj",
|
| 330 |
+
"model.layers.22.self_attn.kv_a_layernorm",
|
| 331 |
+
"model.layers.22.self_attn.q_a_layernorm",
|
| 332 |
+
"model.layers.23.input_layernorm",
|
| 333 |
+
"model.layers.23.mlp.gate",
|
| 334 |
+
"model.layers.23.mlp.gate.e_score_correction_bias",
|
| 335 |
+
"model.layers.23.post_attention_layernorm",
|
| 336 |
+
"model.layers.23.self_attn.indexer.k_norm",
|
| 337 |
+
"model.layers.23.self_attn.indexer.k_norm.bias",
|
| 338 |
+
"model.layers.23.self_attn.indexers_proj",
|
| 339 |
+
"model.layers.23.self_attn.kv_a_layernorm",
|
| 340 |
+
"model.layers.23.self_attn.q_a_layernorm",
|
| 341 |
+
"model.layers.24.input_layernorm",
|
| 342 |
+
"model.layers.24.mlp.gate",
|
| 343 |
+
"model.layers.24.mlp.gate.e_score_correction_bias",
|
| 344 |
+
"model.layers.24.post_attention_layernorm",
|
| 345 |
+
"model.layers.24.self_attn.indexer.k_norm",
|
| 346 |
+
"model.layers.24.self_attn.indexer.k_norm.bias",
|
| 347 |
+
"model.layers.24.self_attn.indexers_proj",
|
| 348 |
+
"model.layers.24.self_attn.kv_a_layernorm",
|
| 349 |
+
"model.layers.24.self_attn.q_a_layernorm",
|
| 350 |
+
"model.layers.25.input_layernorm",
|
| 351 |
+
"model.layers.25.mlp.gate",
|
| 352 |
+
"model.layers.25.mlp.gate.e_score_correction_bias",
|
| 353 |
+
"model.layers.25.post_attention_layernorm",
|
| 354 |
+
"model.layers.25.self_attn.indexer.k_norm",
|
| 355 |
+
"model.layers.25.self_attn.indexer.k_norm.bias",
|
| 356 |
+
"model.layers.25.self_attn.indexers_proj",
|
| 357 |
+
"model.layers.25.self_attn.kv_a_layernorm",
|
| 358 |
+
"model.layers.25.self_attn.q_a_layernorm",
|
| 359 |
+
"model.layers.26.input_layernorm",
|
| 360 |
+
"model.layers.26.mlp.gate",
|
| 361 |
+
"model.layers.26.mlp.gate.e_score_correction_bias",
|
| 362 |
+
"model.layers.26.post_attention_layernorm",
|
| 363 |
+
"model.layers.26.self_attn.indexer.k_norm",
|
| 364 |
+
"model.layers.26.self_attn.indexer.k_norm.bias",
|
| 365 |
+
"model.layers.26.self_attn.indexers_proj",
|
| 366 |
+
"model.layers.26.self_attn.kv_a_layernorm",
|
| 367 |
+
"model.layers.26.self_attn.q_a_layernorm",
|
| 368 |
+
"model.layers.27.input_layernorm",
|
| 369 |
+
"model.layers.27.mlp.gate",
|
| 370 |
+
"model.layers.27.mlp.gate.e_score_correction_bias",
|
| 371 |
+
"model.layers.27.post_attention_layernorm",
|
| 372 |
+
"model.layers.27.self_attn.indexer.k_norm",
|
| 373 |
+
"model.layers.27.self_attn.indexer.k_norm.bias",
|
| 374 |
+
"model.layers.27.self_attn.indexers_proj",
|
| 375 |
+
"model.layers.27.self_attn.kv_a_layernorm",
|
| 376 |
+
"model.layers.27.self_attn.q_a_layernorm",
|
| 377 |
+
"model.layers.28.input_layernorm",
|
| 378 |
+
"model.layers.28.mlp.gate",
|
| 379 |
+
"model.layers.28.mlp.gate.e_score_correction_bias",
|
| 380 |
+
"model.layers.28.post_attention_layernorm",
|
| 381 |
+
"model.layers.28.self_attn.indexer.k_norm",
|
| 382 |
+
"model.layers.28.self_attn.indexer.k_norm.bias",
|
| 383 |
+
"model.layers.28.self_attn.indexers_proj",
|
| 384 |
+
"model.layers.28.self_attn.kv_a_layernorm",
|
| 385 |
+
"model.layers.28.self_attn.q_a_layernorm",
|
| 386 |
+
"model.layers.29.input_layernorm",
|
| 387 |
+
"model.layers.29.mlp.gate",
|
| 388 |
+
"model.layers.29.mlp.gate.e_score_correction_bias",
|
| 389 |
+
"model.layers.29.post_attention_layernorm",
|
| 390 |
+
"model.layers.29.self_attn.indexer.k_norm",
|
| 391 |
+
"model.layers.29.self_attn.indexer.k_norm.bias",
|
| 392 |
+
"model.layers.29.self_attn.indexers_proj",
|
| 393 |
+
"model.layers.29.self_attn.kv_a_layernorm",
|
| 394 |
+
"model.layers.29.self_attn.q_a_layernorm",
|
| 395 |
+
"model.layers.30.input_layernorm",
|
| 396 |
+
"model.layers.30.mlp.gate",
|
| 397 |
+
"model.layers.30.mlp.gate.e_score_correction_bias",
|
| 398 |
+
"model.layers.30.post_attention_layernorm",
|
| 399 |
+
"model.layers.30.self_attn.indexer.k_norm",
|
| 400 |
+
"model.layers.30.self_attn.indexer.k_norm.bias",
|
| 401 |
+
"model.layers.30.self_attn.indexers_proj",
|
| 402 |
+
"model.layers.30.self_attn.kv_a_layernorm",
|
| 403 |
+
"model.layers.30.self_attn.q_a_layernorm",
|
| 404 |
+
"model.layers.31.input_layernorm",
|
| 405 |
+
"model.layers.31.mlp.gate",
|
| 406 |
+
"model.layers.31.mlp.gate.e_score_correction_bias",
|
| 407 |
+
"model.layers.31.post_attention_layernorm",
|
| 408 |
+
"model.layers.31.self_attn.indexer.k_norm",
|
| 409 |
+
"model.layers.31.self_attn.indexer.k_norm.bias",
|
| 410 |
+
"model.layers.31.self_attn.indexers_proj",
|
| 411 |
+
"model.layers.31.self_attn.kv_a_layernorm",
|
| 412 |
+
"model.layers.31.self_attn.q_a_layernorm",
|
| 413 |
+
"model.layers.32.input_layernorm",
|
| 414 |
+
"model.layers.32.mlp.gate",
|
| 415 |
+
"model.layers.32.mlp.gate.e_score_correction_bias",
|
| 416 |
+
"model.layers.32.post_attention_layernorm",
|
| 417 |
+
"model.layers.32.self_attn.indexer.k_norm",
|
| 418 |
+
"model.layers.32.self_attn.indexer.k_norm.bias",
|
| 419 |
+
"model.layers.32.self_attn.indexers_proj",
|
| 420 |
+
"model.layers.32.self_attn.kv_a_layernorm",
|
| 421 |
+
"model.layers.32.self_attn.q_a_layernorm",
|
| 422 |
+
"model.layers.33.input_layernorm",
|
| 423 |
+
"model.layers.33.mlp.gate",
|
| 424 |
+
"model.layers.33.mlp.gate.e_score_correction_bias",
|
| 425 |
+
"model.layers.33.post_attention_layernorm",
|
| 426 |
+
"model.layers.33.self_attn.indexer.k_norm",
|
| 427 |
+
"model.layers.33.self_attn.indexer.k_norm.bias",
|
| 428 |
+
"model.layers.33.self_attn.indexers_proj",
|
| 429 |
+
"model.layers.33.self_attn.kv_a_layernorm",
|
| 430 |
+
"model.layers.33.self_attn.q_a_layernorm",
|
| 431 |
+
"model.layers.34.input_layernorm",
|
| 432 |
+
"model.layers.34.mlp.gate",
|
| 433 |
+
"model.layers.34.mlp.gate.e_score_correction_bias",
|
| 434 |
+
"model.layers.34.post_attention_layernorm",
|
| 435 |
+
"model.layers.34.self_attn.indexer.k_norm",
|
| 436 |
+
"model.layers.34.self_attn.indexer.k_norm.bias",
|
| 437 |
+
"model.layers.34.self_attn.indexers_proj",
|
| 438 |
+
"model.layers.34.self_attn.kv_a_layernorm",
|
| 439 |
+
"model.layers.34.self_attn.q_a_layernorm",
|
| 440 |
+
"model.layers.35.input_layernorm",
|
| 441 |
+
"model.layers.35.mlp.gate",
|
| 442 |
+
"model.layers.35.mlp.gate.e_score_correction_bias",
|
| 443 |
+
"model.layers.35.post_attention_layernorm",
|
| 444 |
+
"model.layers.35.self_attn.indexer.k_norm",
|
| 445 |
+
"model.layers.35.self_attn.indexer.k_norm.bias",
|
| 446 |
+
"model.layers.35.self_attn.indexers_proj",
|
| 447 |
+
"model.layers.35.self_attn.kv_a_layernorm",
|
| 448 |
+
"model.layers.35.self_attn.q_a_layernorm",
|
| 449 |
+
"model.layers.36.input_layernorm",
|
| 450 |
+
"model.layers.36.mlp.gate",
|
| 451 |
+
"model.layers.36.mlp.gate.e_score_correction_bias",
|
| 452 |
+
"model.layers.36.post_attention_layernorm",
|
| 453 |
+
"model.layers.36.self_attn.indexer.k_norm",
|
| 454 |
+
"model.layers.36.self_attn.indexer.k_norm.bias",
|
| 455 |
+
"model.layers.36.self_attn.indexers_proj",
|
| 456 |
+
"model.layers.36.self_attn.kv_a_layernorm",
|
| 457 |
+
"model.layers.36.self_attn.q_a_layernorm",
|
| 458 |
+
"model.layers.37.input_layernorm",
|
| 459 |
+
"model.layers.37.mlp.gate",
|
| 460 |
+
"model.layers.37.mlp.gate.e_score_correction_bias",
|
| 461 |
+
"model.layers.37.post_attention_layernorm",
|
| 462 |
+
"model.layers.37.self_attn.indexer.k_norm",
|
| 463 |
+
"model.layers.37.self_attn.indexer.k_norm.bias",
|
| 464 |
+
"model.layers.37.self_attn.indexers_proj",
|
| 465 |
+
"model.layers.37.self_attn.kv_a_layernorm",
|
| 466 |
+
"model.layers.37.self_attn.q_a_layernorm",
|
| 467 |
+
"model.layers.38.input_layernorm",
|
| 468 |
+
"model.layers.38.mlp.gate",
|
| 469 |
+
"model.layers.38.mlp.gate.e_score_correction_bias",
|
| 470 |
+
"model.layers.38.post_attention_layernorm",
|
| 471 |
+
"model.layers.38.self_attn.indexer.k_norm",
|
| 472 |
+
"model.layers.38.self_attn.indexer.k_norm.bias",
|
| 473 |
+
"model.layers.38.self_attn.indexers_proj",
|
| 474 |
+
"model.layers.38.self_attn.kv_a_layernorm",
|
| 475 |
+
"model.layers.38.self_attn.q_a_layernorm",
|
| 476 |
+
"model.layers.39.input_layernorm",
|
| 477 |
+
"model.layers.39.mlp.gate",
|
| 478 |
+
"model.layers.39.mlp.gate.e_score_correction_bias",
|
| 479 |
+
"model.layers.39.post_attention_layernorm",
|
| 480 |
+
"model.layers.39.self_attn.indexer.k_norm",
|
| 481 |
+
"model.layers.39.self_attn.indexer.k_norm.bias",
|
| 482 |
+
"model.layers.39.self_attn.indexers_proj",
|
| 483 |
+
"model.layers.39.self_attn.kv_a_layernorm",
|
| 484 |
+
"model.layers.39.self_attn.q_a_layernorm",
|
| 485 |
+
"model.layers.40.input_layernorm",
|
| 486 |
+
"model.layers.40.mlp.gate",
|
| 487 |
+
"model.layers.40.mlp.gate.e_score_correction_bias",
|
| 488 |
+
"model.layers.40.post_attention_layernorm",
|
| 489 |
+
"model.layers.40.self_attn.indexer.k_norm",
|
| 490 |
+
"model.layers.40.self_attn.indexer.k_norm.bias",
|
| 491 |
+
"model.layers.40.self_attn.indexers_proj",
|
| 492 |
+
"model.layers.40.self_attn.kv_a_layernorm",
|
| 493 |
+
"model.layers.40.self_attn.q_a_layernorm",
|
| 494 |
+
"model.layers.41.input_layernorm",
|
| 495 |
+
"model.layers.41.mlp.gate",
|
| 496 |
+
"model.layers.41.mlp.gate.e_score_correction_bias",
|
| 497 |
+
"model.layers.41.post_attention_layernorm",
|
| 498 |
+
"model.layers.41.self_attn.indexer.k_norm",
|
| 499 |
+
"model.layers.41.self_attn.indexer.k_norm.bias",
|
| 500 |
+
"model.layers.41.self_attn.indexers_proj",
|
| 501 |
+
"model.layers.41.self_attn.kv_a_layernorm",
|
| 502 |
+
"model.layers.41.self_attn.q_a_layernorm",
|
| 503 |
+
"model.layers.42.input_layernorm",
|
| 504 |
+
"model.layers.42.mlp.gate",
|
| 505 |
+
"model.layers.42.mlp.gate.e_score_correction_bias",
|
| 506 |
+
"model.layers.42.post_attention_layernorm",
|
| 507 |
+
"model.layers.42.self_attn.indexer.k_norm",
|
| 508 |
+
"model.layers.42.self_attn.indexer.k_norm.bias",
|
| 509 |
+
"model.layers.42.self_attn.indexers_proj",
|
| 510 |
+
"model.layers.42.self_attn.kv_a_layernorm",
|
| 511 |
+
"model.layers.42.self_attn.q_a_layernorm",
|
| 512 |
+
"model.layers.43.input_layernorm",
|
| 513 |
+
"model.layers.43.mlp.gate",
|
| 514 |
+
"model.layers.43.mlp.gate.e_score_correction_bias",
|
| 515 |
+
"model.layers.43.post_attention_layernorm",
|
| 516 |
+
"model.layers.43.self_attn.indexer.k_norm",
|
| 517 |
+
"model.layers.43.self_attn.indexer.k_norm.bias",
|
| 518 |
+
"model.layers.43.self_attn.indexers_proj",
|
| 519 |
+
"model.layers.43.self_attn.kv_a_layernorm",
|
| 520 |
+
"model.layers.43.self_attn.q_a_layernorm",
|
| 521 |
+
"model.layers.44.input_layernorm",
|
| 522 |
+
"model.layers.44.mlp.gate",
|
| 523 |
+
"model.layers.44.mlp.gate.e_score_correction_bias",
|
| 524 |
+
"model.layers.44.post_attention_layernorm",
|
| 525 |
+
"model.layers.44.self_attn.indexer.k_norm",
|
| 526 |
+
"model.layers.44.self_attn.indexer.k_norm.bias",
|
| 527 |
+
"model.layers.44.self_attn.indexers_proj",
|
| 528 |
+
"model.layers.44.self_attn.kv_a_layernorm",
|
| 529 |
+
"model.layers.44.self_attn.q_a_layernorm",
|
| 530 |
+
"model.layers.45.input_layernorm",
|
| 531 |
+
"model.layers.45.mlp.gate",
|
| 532 |
+
"model.layers.45.mlp.gate.e_score_correction_bias",
|
| 533 |
+
"model.layers.45.post_attention_layernorm",
|
| 534 |
+
"model.layers.45.self_attn.indexer.k_norm",
|
| 535 |
+
"model.layers.45.self_attn.indexer.k_norm.bias",
|
| 536 |
+
"model.layers.45.self_attn.indexers_proj",
|
| 537 |
+
"model.layers.45.self_attn.kv_a_layernorm",
|
| 538 |
+
"model.layers.45.self_attn.q_a_layernorm",
|
| 539 |
+
"model.layers.46.input_layernorm",
|
| 540 |
+
"model.layers.46.mlp.gate",
|
| 541 |
+
"model.layers.46.mlp.gate.e_score_correction_bias",
|
| 542 |
+
"model.layers.46.post_attention_layernorm",
|
| 543 |
+
"model.layers.46.self_attn.indexer.k_norm",
|
| 544 |
+
"model.layers.46.self_attn.indexer.k_norm.bias",
|
| 545 |
+
"model.layers.46.self_attn.indexers_proj",
|
| 546 |
+
"model.layers.46.self_attn.kv_a_layernorm",
|
| 547 |
+
"model.layers.46.self_attn.q_a_layernorm",
|
| 548 |
+
"model.layers.47.input_layernorm",
|
| 549 |
+
"model.layers.47.mlp.gate",
|
| 550 |
+
"model.layers.47.mlp.gate.e_score_correction_bias",
|
| 551 |
+
"model.layers.47.post_attention_layernorm",
|
| 552 |
+
"model.layers.47.self_attn.indexer.k_norm",
|
| 553 |
+
"model.layers.47.self_attn.indexer.k_norm.bias",
|
| 554 |
+
"model.layers.47.self_attn.indexers_proj",
|
| 555 |
+
"model.layers.47.self_attn.kv_a_layernorm",
|
| 556 |
+
"model.layers.47.self_attn.q_a_layernorm",
|
| 557 |
+
"model.layers.48.input_layernorm",
|
| 558 |
+
"model.layers.48.mlp.gate",
|
| 559 |
+
"model.layers.48.mlp.gate.e_score_correction_bias",
|
| 560 |
+
"model.layers.48.post_attention_layernorm",
|
| 561 |
+
"model.layers.48.self_attn.indexer.k_norm",
|
| 562 |
+
"model.layers.48.self_attn.indexer.k_norm.bias",
|
| 563 |
+
"model.layers.48.self_attn.indexers_proj",
|
| 564 |
+
"model.layers.48.self_attn.kv_a_layernorm",
|
| 565 |
+
"model.layers.48.self_attn.q_a_layernorm",
|
| 566 |
+
"model.layers.49.input_layernorm",
|
| 567 |
+
"model.layers.49.mlp.gate",
|
| 568 |
+
"model.layers.49.mlp.gate.e_score_correction_bias",
|
| 569 |
+
"model.layers.49.post_attention_layernorm",
|
| 570 |
+
"model.layers.49.self_attn.indexer.k_norm",
|
| 571 |
+
"model.layers.49.self_attn.indexer.k_norm.bias",
|
| 572 |
+
"model.layers.49.self_attn.indexers_proj",
|
| 573 |
+
"model.layers.49.self_attn.kv_a_layernorm",
|
| 574 |
+
"model.layers.49.self_attn.q_a_layernorm",
|
| 575 |
+
"model.layers.50.input_layernorm",
|
| 576 |
+
"model.layers.50.mlp.gate",
|
| 577 |
+
"model.layers.50.mlp.gate.e_score_correction_bias",
|
| 578 |
+
"model.layers.50.post_attention_layernorm",
|
| 579 |
+
"model.layers.50.self_attn.indexer.k_norm",
|
| 580 |
+
"model.layers.50.self_attn.indexer.k_norm.bias",
|
| 581 |
+
"model.layers.50.self_attn.indexers_proj",
|
| 582 |
+
"model.layers.50.self_attn.kv_a_layernorm",
|
| 583 |
+
"model.layers.50.self_attn.q_a_layernorm",
|
| 584 |
+
"model.layers.51.input_layernorm",
|
| 585 |
+
"model.layers.51.mlp.gate",
|
| 586 |
+
"model.layers.51.mlp.gate.e_score_correction_bias",
|
| 587 |
+
"model.layers.51.post_attention_layernorm",
|
| 588 |
+
"model.layers.51.self_attn.indexer.k_norm",
|
| 589 |
+
"model.layers.51.self_attn.indexer.k_norm.bias",
|
| 590 |
+
"model.layers.51.self_attn.indexers_proj",
|
| 591 |
+
"model.layers.51.self_attn.kv_a_layernorm",
|
| 592 |
+
"model.layers.51.self_attn.q_a_layernorm",
|
| 593 |
+
"model.layers.52.input_layernorm",
|
| 594 |
+
"model.layers.52.mlp.gate",
|
| 595 |
+
"model.layers.52.mlp.gate.e_score_correction_bias",
|
| 596 |
+
"model.layers.52.post_attention_layernorm",
|
| 597 |
+
"model.layers.52.self_attn.indexer.k_norm",
|
| 598 |
+
"model.layers.52.self_attn.indexer.k_norm.bias",
|
| 599 |
+
"model.layers.52.self_attn.indexers_proj",
|
| 600 |
+
"model.layers.52.self_attn.kv_a_layernorm",
|
| 601 |
+
"model.layers.52.self_attn.q_a_layernorm",
|
| 602 |
+
"model.layers.53.input_layernorm",
|
| 603 |
+
"model.layers.53.mlp.gate",
|
| 604 |
+
"model.layers.53.mlp.gate.e_score_correction_bias",
|
| 605 |
+
"model.layers.53.post_attention_layernorm",
|
| 606 |
+
"model.layers.53.self_attn.indexer.k_norm",
|
| 607 |
+
"model.layers.53.self_attn.indexer.k_norm.bias",
|
| 608 |
+
"model.layers.53.self_attn.indexers_proj",
|
| 609 |
+
"model.layers.53.self_attn.kv_a_layernorm",
|
| 610 |
+
"model.layers.53.self_attn.q_a_layernorm",
|
| 611 |
+
"model.layers.54.input_layernorm",
|
| 612 |
+
"model.layers.54.mlp.gate",
|
| 613 |
+
"model.layers.54.mlp.gate.e_score_correction_bias",
|
| 614 |
+
"model.layers.54.post_attention_layernorm",
|
| 615 |
+
"model.layers.54.self_attn.indexer.k_norm",
|
| 616 |
+
"model.layers.54.self_attn.indexer.k_norm.bias",
|
| 617 |
+
"model.layers.54.self_attn.indexers_proj",
|
| 618 |
+
"model.layers.54.self_attn.kv_a_layernorm",
|
| 619 |
+
"model.layers.54.self_attn.q_a_layernorm",
|
| 620 |
+
"model.layers.55.input_layernorm",
|
| 621 |
+
"model.layers.55.mlp.gate",
|
| 622 |
+
"model.layers.55.mlp.gate.e_score_correction_bias",
|
| 623 |
+
"model.layers.55.post_attention_layernorm",
|
| 624 |
+
"model.layers.55.self_attn.indexer.k_norm",
|
| 625 |
+
"model.layers.55.self_attn.indexer.k_norm.bias",
|
| 626 |
+
"model.layers.55.self_attn.indexers_proj",
|
| 627 |
+
"model.layers.55.self_attn.kv_a_layernorm",
|
| 628 |
+
"model.layers.55.self_attn.q_a_layernorm",
|
| 629 |
+
"model.layers.56.input_layernorm",
|
| 630 |
+
"model.layers.56.mlp.gate",
|
| 631 |
+
"model.layers.56.mlp.gate.e_score_correction_bias",
|
| 632 |
+
"model.layers.56.post_attention_layernorm",
|
| 633 |
+
"model.layers.56.self_attn.indexer.k_norm",
|
| 634 |
+
"model.layers.56.self_attn.indexer.k_norm.bias",
|
| 635 |
+
"model.layers.56.self_attn.indexers_proj",
|
| 636 |
+
"model.layers.56.self_attn.kv_a_layernorm",
|
| 637 |
+
"model.layers.56.self_attn.q_a_layernorm",
|
| 638 |
+
"model.layers.57.input_layernorm",
|
| 639 |
+
"model.layers.57.mlp.gate",
|
| 640 |
+
"model.layers.57.mlp.gate.e_score_correction_bias",
|
| 641 |
+
"model.layers.57.post_attention_layernorm",
|
| 642 |
+
"model.layers.57.self_attn.indexer.k_norm",
|
| 643 |
+
"model.layers.57.self_attn.indexer.k_norm.bias",
|
| 644 |
+
"model.layers.57.self_attn.indexers_proj",
|
| 645 |
+
"model.layers.57.self_attn.kv_a_layernorm",
|
| 646 |
+
"model.layers.57.self_attn.q_a_layernorm",
|
| 647 |
+
"model.layers.58.input_layernorm",
|
| 648 |
+
"model.layers.58.mlp.gate",
|
| 649 |
+
"model.layers.58.mlp.gate.e_score_correction_bias",
|
| 650 |
+
"model.layers.58.post_attention_layernorm",
|
| 651 |
+
"model.layers.58.self_attn.indexer.k_norm",
|
| 652 |
+
"model.layers.58.self_attn.indexer.k_norm.bias",
|
| 653 |
+
"model.layers.58.self_attn.indexers_proj",
|
| 654 |
+
"model.layers.58.self_attn.kv_a_layernorm",
|
| 655 |
+
"model.layers.58.self_attn.q_a_layernorm",
|
| 656 |
+
"model.layers.59.input_layernorm",
|
| 657 |
+
"model.layers.59.mlp.gate",
|
| 658 |
+
"model.layers.59.mlp.gate.e_score_correction_bias",
|
| 659 |
+
"model.layers.59.post_attention_layernorm",
|
| 660 |
+
"model.layers.59.self_attn.indexer.k_norm",
|
| 661 |
+
"model.layers.59.self_attn.indexer.k_norm.bias",
|
| 662 |
+
"model.layers.59.self_attn.indexers_proj",
|
| 663 |
+
"model.layers.59.self_attn.kv_a_layernorm",
|
| 664 |
+
"model.layers.59.self_attn.q_a_layernorm",
|
| 665 |
+
"model.layers.60.input_layernorm",
|
| 666 |
+
"model.layers.60.mlp.gate",
|
| 667 |
+
"model.layers.60.mlp.gate.e_score_correction_bias",
|
| 668 |
+
"model.layers.60.post_attention_layernorm",
|
| 669 |
+
"model.layers.60.self_attn.indexer.k_norm",
|
| 670 |
+
"model.layers.60.self_attn.indexer.k_norm.bias",
|
| 671 |
+
"model.layers.60.self_attn.indexers_proj",
|
| 672 |
+
"model.layers.60.self_attn.kv_a_layernorm",
|
| 673 |
+
"model.layers.60.self_attn.q_a_layernorm",
|
| 674 |
+
"model.layers.61.input_layernorm",
|
| 675 |
+
"model.layers.61.mlp.gate",
|
| 676 |
+
"model.layers.61.mlp.gate.e_score_correction_bias",
|
| 677 |
+
"model.layers.61.post_attention_layernorm",
|
| 678 |
+
"model.layers.61.self_attn.indexer.k_norm",
|
| 679 |
+
"model.layers.61.self_attn.indexer.k_norm.bias",
|
| 680 |
+
"model.layers.61.self_attn.indexers_proj",
|
| 681 |
+
"model.layers.61.self_attn.kv_a_layernorm",
|
| 682 |
+
"model.layers.61.self_attn.q_a_layernorm",
|
| 683 |
+
"model.layers.62.input_layernorm",
|
| 684 |
+
"model.layers.62.mlp.gate",
|
| 685 |
+
"model.layers.62.mlp.gate.e_score_correction_bias",
|
| 686 |
+
"model.layers.62.post_attention_layernorm",
|
| 687 |
+
"model.layers.62.self_attn.indexer.k_norm",
|
| 688 |
+
"model.layers.62.self_attn.indexer.k_norm.bias",
|
| 689 |
+
"model.layers.62.self_attn.indexers_proj",
|
| 690 |
+
"model.layers.62.self_attn.kv_a_layernorm",
|
| 691 |
+
"model.layers.62.self_attn.q_a_layernorm",
|
| 692 |
+
"model.layers.63.input_layernorm",
|
| 693 |
+
"model.layers.63.mlp.gate",
|
| 694 |
+
"model.layers.63.mlp.gate.e_score_correction_bias",
|
| 695 |
+
"model.layers.63.post_attention_layernorm",
|
| 696 |
+
"model.layers.63.self_attn.indexer.k_norm",
|
| 697 |
+
"model.layers.63.self_attn.indexer.k_norm.bias",
|
| 698 |
+
"model.layers.63.self_attn.indexers_proj",
|
| 699 |
+
"model.layers.63.self_attn.kv_a_layernorm",
|
| 700 |
+
"model.layers.63.self_attn.q_a_layernorm",
|
| 701 |
+
"model.layers.64.input_layernorm",
|
| 702 |
+
"model.layers.64.mlp.gate",
|
| 703 |
+
"model.layers.64.mlp.gate.e_score_correction_bias",
|
| 704 |
+
"model.layers.64.post_attention_layernorm",
|
| 705 |
+
"model.layers.64.self_attn.indexer.k_norm",
|
| 706 |
+
"model.layers.64.self_attn.indexer.k_norm.bias",
|
| 707 |
+
"model.layers.64.self_attn.indexers_proj",
|
| 708 |
+
"model.layers.64.self_attn.kv_a_layernorm",
|
| 709 |
+
"model.layers.64.self_attn.q_a_layernorm",
|
| 710 |
+
"model.layers.65.input_layernorm",
|
| 711 |
+
"model.layers.65.mlp.gate",
|
| 712 |
+
"model.layers.65.mlp.gate.e_score_correction_bias",
|
| 713 |
+
"model.layers.65.post_attention_layernorm",
|
| 714 |
+
"model.layers.65.self_attn.indexer.k_norm",
|
| 715 |
+
"model.layers.65.self_attn.indexer.k_norm.bias",
|
| 716 |
+
"model.layers.65.self_attn.indexers_proj",
|
| 717 |
+
"model.layers.65.self_attn.kv_a_layernorm",
|
| 718 |
+
"model.layers.65.self_attn.q_a_layernorm",
|
| 719 |
+
"model.layers.66.input_layernorm",
|
| 720 |
+
"model.layers.66.mlp.gate",
|
| 721 |
+
"model.layers.66.mlp.gate.e_score_correction_bias",
|
| 722 |
+
"model.layers.66.post_attention_layernorm",
|
| 723 |
+
"model.layers.66.self_attn.indexer.k_norm",
|
| 724 |
+
"model.layers.66.self_attn.indexer.k_norm.bias",
|
| 725 |
+
"model.layers.66.self_attn.indexers_proj",
|
| 726 |
+
"model.layers.66.self_attn.kv_a_layernorm",
|
| 727 |
+
"model.layers.66.self_attn.q_a_layernorm",
|
| 728 |
+
"model.layers.67.input_layernorm",
|
| 729 |
+
"model.layers.67.mlp.gate",
|
| 730 |
+
"model.layers.67.mlp.gate.e_score_correction_bias",
|
| 731 |
+
"model.layers.67.post_attention_layernorm",
|
| 732 |
+
"model.layers.67.self_attn.indexer.k_norm",
|
| 733 |
+
"model.layers.67.self_attn.indexer.k_norm.bias",
|
| 734 |
+
"model.layers.67.self_attn.indexers_proj",
|
| 735 |
+
"model.layers.67.self_attn.kv_a_layernorm",
|
| 736 |
+
"model.layers.67.self_attn.q_a_layernorm",
|
| 737 |
+
"model.layers.68.input_layernorm",
|
| 738 |
+
"model.layers.68.mlp.gate",
|
| 739 |
+
"model.layers.68.mlp.gate.e_score_correction_bias",
|
| 740 |
+
"model.layers.68.post_attention_layernorm",
|
| 741 |
+
"model.layers.68.self_attn.indexer.k_norm",
|
| 742 |
+
"model.layers.68.self_attn.indexer.k_norm.bias",
|
| 743 |
+
"model.layers.68.self_attn.indexers_proj",
|
| 744 |
+
"model.layers.68.self_attn.kv_a_layernorm",
|
| 745 |
+
"model.layers.68.self_attn.q_a_layernorm",
|
| 746 |
+
"model.layers.69.input_layernorm",
|
| 747 |
+
"model.layers.69.mlp.gate",
|
| 748 |
+
"model.layers.69.mlp.gate.e_score_correction_bias",
|
| 749 |
+
"model.layers.69.post_attention_layernorm",
|
| 750 |
+
"model.layers.69.self_attn.indexer.k_norm",
|
| 751 |
+
"model.layers.69.self_attn.indexer.k_norm.bias",
|
| 752 |
+
"model.layers.69.self_attn.indexers_proj",
|
| 753 |
+
"model.layers.69.self_attn.kv_a_layernorm",
|
| 754 |
+
"model.layers.69.self_attn.q_a_layernorm",
|
| 755 |
+
"model.layers.70.input_layernorm",
|
| 756 |
+
"model.layers.70.mlp.gate",
|
| 757 |
+
"model.layers.70.mlp.gate.e_score_correction_bias",
|
| 758 |
+
"model.layers.70.post_attention_layernorm",
|
| 759 |
+
"model.layers.70.self_attn.indexer.k_norm",
|
| 760 |
+
"model.layers.70.self_attn.indexer.k_norm.bias",
|
| 761 |
+
"model.layers.70.self_attn.indexers_proj",
|
| 762 |
+
"model.layers.70.self_attn.kv_a_layernorm",
|
| 763 |
+
"model.layers.70.self_attn.q_a_layernorm",
|
| 764 |
+
"model.layers.71.input_layernorm",
|
| 765 |
+
"model.layers.71.mlp.gate",
|
| 766 |
+
"model.layers.71.mlp.gate.e_score_correction_bias",
|
| 767 |
+
"model.layers.71.post_attention_layernorm",
|
| 768 |
+
"model.layers.71.self_attn.indexer.k_norm",
|
| 769 |
+
"model.layers.71.self_attn.indexer.k_norm.bias",
|
| 770 |
+
"model.layers.71.self_attn.indexers_proj",
|
| 771 |
+
"model.layers.71.self_attn.kv_a_layernorm",
|
| 772 |
+
"model.layers.71.self_attn.q_a_layernorm",
|
| 773 |
+
"model.layers.72.input_layernorm",
|
| 774 |
+
"model.layers.72.mlp.gate",
|
| 775 |
+
"model.layers.72.mlp.gate.e_score_correction_bias",
|
| 776 |
+
"model.layers.72.post_attention_layernorm",
|
| 777 |
+
"model.layers.72.self_attn.indexer.k_norm",
|
| 778 |
+
"model.layers.72.self_attn.indexer.k_norm.bias",
|
| 779 |
+
"model.layers.72.self_attn.indexers_proj",
|
| 780 |
+
"model.layers.72.self_attn.kv_a_layernorm",
|
| 781 |
+
"model.layers.72.self_attn.q_a_layernorm",
|
| 782 |
+
"model.layers.73.input_layernorm",
|
| 783 |
+
"model.layers.73.mlp.gate",
|
| 784 |
+
"model.layers.73.mlp.gate.e_score_correction_bias",
|
| 785 |
+
"model.layers.73.post_attention_layernorm",
|
| 786 |
+
"model.layers.73.self_attn.indexer.k_norm",
|
| 787 |
+
"model.layers.73.self_attn.indexer.k_norm.bias",
|
| 788 |
+
"model.layers.73.self_attn.indexers_proj",
|
| 789 |
+
"model.layers.73.self_attn.kv_a_layernorm",
|
| 790 |
+
"model.layers.73.self_attn.q_a_layernorm",
|
| 791 |
+
"model.layers.74.input_layernorm",
|
| 792 |
+
"model.layers.74.mlp.gate",
|
| 793 |
+
"model.layers.74.mlp.gate.e_score_correction_bias",
|
| 794 |
+
"model.layers.74.post_attention_layernorm",
|
| 795 |
+
"model.layers.74.self_attn.indexer.k_norm",
|
| 796 |
+
"model.layers.74.self_attn.indexer.k_norm.bias",
|
| 797 |
+
"model.layers.74.self_attn.indexers_proj",
|
| 798 |
+
"model.layers.74.self_attn.kv_a_layernorm",
|
| 799 |
+
"model.layers.74.self_attn.q_a_layernorm",
|
| 800 |
+
"model.layers.75.input_layernorm",
|
| 801 |
+
"model.layers.75.mlp.gate",
|
| 802 |
+
"model.layers.75.mlp.gate.e_score_correction_bias",
|
| 803 |
+
"model.layers.75.post_attention_layernorm",
|
| 804 |
+
"model.layers.75.self_attn.indexer.k_norm",
|
| 805 |
+
"model.layers.75.self_attn.indexer.k_norm.bias",
|
| 806 |
+
"model.layers.75.self_attn.indexers_proj",
|
| 807 |
+
"model.layers.75.self_attn.kv_a_layernorm",
|
| 808 |
+
"model.layers.75.self_attn.q_a_layernorm",
|
| 809 |
+
"model.layers.76.input_layernorm",
|
| 810 |
+
"model.layers.76.mlp.gate",
|
| 811 |
+
"model.layers.76.mlp.gate.e_score_correction_bias",
|
| 812 |
+
"model.layers.76.post_attention_layernorm",
|
| 813 |
+
"model.layers.76.self_attn.indexer.k_norm",
|
| 814 |
+
"model.layers.76.self_attn.indexer.k_norm.bias",
|
| 815 |
+
"model.layers.76.self_attn.indexers_proj",
|
| 816 |
+
"model.layers.76.self_attn.kv_a_layernorm",
|
| 817 |
+
"model.layers.76.self_attn.q_a_layernorm",
|
| 818 |
+
"model.layers.77.input_layernorm",
|
| 819 |
+
"model.layers.77.mlp.gate",
|
| 820 |
+
"model.layers.77.mlp.gate.e_score_correction_bias",
|
| 821 |
+
"model.layers.77.post_attention_layernorm",
|
| 822 |
+
"model.layers.77.self_attn.indexer.k_norm",
|
| 823 |
+
"model.layers.77.self_attn.indexer.k_norm.bias",
|
| 824 |
+
"model.layers.77.self_attn.indexers_proj",
|
| 825 |
+
"model.layers.77.self_attn.kv_a_layernorm",
|
| 826 |
+
"model.layers.77.self_attn.q_a_layernorm",
|
| 827 |
+
"model.layers.78.eh_proj",
|
| 828 |
+
"model.layers.78.enorm",
|
| 829 |
+
"model.layers.78.hnorm",
|
| 830 |
+
"model.layers.78.input_layernorm",
|
| 831 |
+
"model.layers.78.mlp.gate",
|
| 832 |
+
"model.layers.78.mlp.gate.e_score_correction_bias",
|
| 833 |
+
"model.layers.78.post_attention_layernorm",
|
| 834 |
+
"model.layers.78.self_attn.indexer.k_norm",
|
| 835 |
+
"model.layers.78.self_attn.indexer.k_norm.bias",
|
| 836 |
+
"model.layers.78.self_attn.indexers_proj",
|
| 837 |
+
"model.layers.78.self_attn.kv_a_layernorm",
|
| 838 |
+
"model.layers.78.self_attn.q_a_layernorm",
|
| 839 |
+
"model.layers.78.shared_head.norm",
|
| 840 |
+
"model.norm"
|
| 841 |
+
],
|
| 842 |
+
"quant_method": "fp8",
|
| 843 |
+
"weight_block_size": [
|
| 844 |
+
128,
|
| 845 |
+
128
|
| 846 |
+
]
|
| 847 |
+
},
|
| 848 |
+
"rms_norm_eps": 1e-05,
|
| 849 |
+
"rope_interleave": true,
|
| 850 |
+
"rope_parameters": {
|
| 851 |
+
"rope_theta": 1000000,
|
| 852 |
+
"rope_type": "default"
|
| 853 |
+
},
|
| 854 |
+
"routed_scaling_factor": 2.5,
|
| 855 |
+
"scoring_func": "sigmoid",
|
| 856 |
+
"tie_word_embeddings": false,
|
| 857 |
+
"topk_group": 1,
|
| 858 |
+
"topk_method": "noaux_tc",
|
| 859 |
+
"transformers_version": "5.3.0",
|
| 860 |
+
"use_cache": true,
|
| 861 |
+
"v_head_dim": 256,
|
| 862 |
+
"vocab_size": 154880
|
| 863 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
154820,
|
| 6 |
+
154827,
|
| 7 |
+
154829
|
| 8 |
+
],
|
| 9 |
+
"pad_token_id": 154820,
|
| 10 |
+
"temperature": 1.0,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
+
"transformers_version": "5.3.0"
|
| 13 |
+
}
|
glm47_moe_tool_parser_fixed.py
ADDED
|
@@ -0,0 +1,532 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 2 |
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
| 3 |
+
"""
|
| 4 |
+
GLM-4 Tool Call Parser with incremental string streaming support.
|
| 5 |
+
|
| 6 |
+
This parser fixes the streaming issue reported in Issue #32829 where long string
|
| 7 |
+
parameters (e.g., file content with 4000+ characters of code) are buffered until
|
| 8 |
+
complete, causing multi-second delays before the user sees any content.
|
| 9 |
+
|
| 10 |
+
The fix streams string values incrementally as they arrive, providing a true
|
| 11 |
+
streaming experience for long content.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
import ast
|
| 15 |
+
import json
|
| 16 |
+
from collections.abc import Sequence
|
| 17 |
+
from typing import Any
|
| 18 |
+
|
| 19 |
+
import regex as re
|
| 20 |
+
|
| 21 |
+
from vllm.entrypoints.chat_utils import make_tool_call_id
|
| 22 |
+
from vllm.entrypoints.openai.chat_completion.protocol import (
|
| 23 |
+
ChatCompletionRequest,
|
| 24 |
+
ChatCompletionToolsParam,
|
| 25 |
+
)
|
| 26 |
+
from vllm.entrypoints.openai.engine.protocol import (
|
| 27 |
+
DeltaFunctionCall,
|
| 28 |
+
DeltaMessage,
|
| 29 |
+
DeltaToolCall,
|
| 30 |
+
ExtractedToolCallInformation,
|
| 31 |
+
FunctionCall,
|
| 32 |
+
ToolCall,
|
| 33 |
+
)
|
| 34 |
+
from vllm.logger import init_logger
|
| 35 |
+
from vllm.tokenizers import TokenizerLike
|
| 36 |
+
from vllm.tool_parsers.abstract_tool_parser import (
|
| 37 |
+
ToolParser,
|
| 38 |
+
ToolParserManager,
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
logger = init_logger(__name__)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
@ToolParserManager.register_module("glm47_fixed")
|
| 45 |
+
class Glm47MoeModelToolParser(ToolParser):
|
| 46 |
+
"""Tool parser for GLM-4 models with incremental string streaming.
|
| 47 |
+
|
| 48 |
+
This parser emits tool-call deltas incrementally as arguments arrive.
|
| 49 |
+
For string-type parameters, content is streamed character-by-character
|
| 50 |
+
rather than waiting for the complete </arg_value> tag.
|
| 51 |
+
"""
|
| 52 |
+
|
| 53 |
+
def __init__(self, tokenizer: TokenizerLike):
|
| 54 |
+
super().__init__(tokenizer)
|
| 55 |
+
# Stateful streaming fields
|
| 56 |
+
self.current_tool_name_sent: bool = False
|
| 57 |
+
self.prev_tool_call_arr: list[dict[str, Any]] = []
|
| 58 |
+
self.current_tool_id: int = -1
|
| 59 |
+
self.streamed_args_for_tool: list[str] = []
|
| 60 |
+
|
| 61 |
+
self.tool_call_start_token: str = "<tool_call>"
|
| 62 |
+
self.tool_call_end_token: str = "</tool_call>"
|
| 63 |
+
self.arg_key_start: str = "<arg_key>"
|
| 64 |
+
self.arg_key_end: str = "</arg_key>"
|
| 65 |
+
self.arg_val_start: str = "<arg_value>"
|
| 66 |
+
self.arg_val_end: str = "</arg_value>"
|
| 67 |
+
|
| 68 |
+
self.tool_calls_start_token = self.tool_call_start_token
|
| 69 |
+
|
| 70 |
+
self.func_call_regex = re.compile(r"<tool_call>.*?</tool_call>", re.DOTALL)
|
| 71 |
+
|
| 72 |
+
# GLM-4.7 format: <tool_call>func_name[<arg_key>...]*</tool_call>
|
| 73 |
+
# The function name can be followed by a newline, whitespace, or
|
| 74 |
+
# directly by <arg_key> tags (no separator). The arg section is
|
| 75 |
+
# optional so that zero-argument calls are supported.
|
| 76 |
+
self.func_detail_regex = re.compile(
|
| 77 |
+
r"<tool_call>\s*(\S+?)\s*(<arg_key>.*)?</tool_call>", re.DOTALL
|
| 78 |
+
)
|
| 79 |
+
self.func_arg_regex = re.compile(
|
| 80 |
+
r"<arg_key>(.*?)</arg_key>\s*<arg_value>(.*?)</arg_value>",
|
| 81 |
+
re.DOTALL,
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
if not self.model_tokenizer:
|
| 85 |
+
raise ValueError(
|
| 86 |
+
"The model tokenizer must be passed to the ToolParser "
|
| 87 |
+
"constructor during construction."
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
self.tool_call_start_token_id = self.vocab.get(self.tool_call_start_token)
|
| 91 |
+
self.tool_call_end_token_id = self.vocab.get(self.tool_call_end_token)
|
| 92 |
+
self._buffer: str = ""
|
| 93 |
+
|
| 94 |
+
# Streaming state for incremental tool-call streaming
|
| 95 |
+
self._in_tool_call: bool = False
|
| 96 |
+
self._current_tool_name: str | None = None
|
| 97 |
+
self._pending_key: str | None = None
|
| 98 |
+
self._streaming_string_value: bool = False
|
| 99 |
+
self._tool_call_ids: list[str] = []
|
| 100 |
+
self._args_started: list[bool] = []
|
| 101 |
+
self._args_closed: list[bool] = []
|
| 102 |
+
self._seen_keys: list[set[str]] = []
|
| 103 |
+
|
| 104 |
+
@staticmethod
|
| 105 |
+
def _deserialize(value: str) -> Any:
|
| 106 |
+
try:
|
| 107 |
+
return json.loads(value)
|
| 108 |
+
except json.JSONDecodeError:
|
| 109 |
+
pass
|
| 110 |
+
|
| 111 |
+
try:
|
| 112 |
+
return ast.literal_eval(value)
|
| 113 |
+
except (ValueError, SyntaxError):
|
| 114 |
+
pass
|
| 115 |
+
|
| 116 |
+
return value
|
| 117 |
+
|
| 118 |
+
@staticmethod
|
| 119 |
+
def _json_escape_string_content(s: str) -> str:
|
| 120 |
+
"""JSON-escape string content for incremental streaming.
|
| 121 |
+
|
| 122 |
+
This escapes the content that goes INSIDE a JSON string (between quotes),
|
| 123 |
+
not including the surrounding quotes themselves.
|
| 124 |
+
"""
|
| 125 |
+
if not s:
|
| 126 |
+
return ""
|
| 127 |
+
return json.dumps(s, ensure_ascii=False)[1:-1]
|
| 128 |
+
|
| 129 |
+
@staticmethod
|
| 130 |
+
def _is_string_type(
|
| 131 |
+
tool_name: str,
|
| 132 |
+
arg_name: str,
|
| 133 |
+
tools: list[ChatCompletionToolsParam] | None,
|
| 134 |
+
) -> bool:
|
| 135 |
+
if tools is None:
|
| 136 |
+
return False
|
| 137 |
+
for tool in tools:
|
| 138 |
+
if tool.function.name != tool_name:
|
| 139 |
+
continue
|
| 140 |
+
if tool.function.parameters is None:
|
| 141 |
+
return False
|
| 142 |
+
arg_type = (
|
| 143 |
+
tool.function.parameters.get("properties", {})
|
| 144 |
+
.get(arg_name, {})
|
| 145 |
+
.get("type", None)
|
| 146 |
+
)
|
| 147 |
+
return arg_type == "string"
|
| 148 |
+
logger.debug("No tool named '%s'.", tool_name)
|
| 149 |
+
return False
|
| 150 |
+
|
| 151 |
+
@staticmethod
|
| 152 |
+
def _tools_enabled(request: ChatCompletionRequest) -> bool:
|
| 153 |
+
"""Return whether tool parsing should be applied for this request."""
|
| 154 |
+
try:
|
| 155 |
+
tools = getattr(request, "tools", None)
|
| 156 |
+
tool_choice = getattr(request, "tool_choice", None)
|
| 157 |
+
return bool(tools) and tool_choice != "none"
|
| 158 |
+
except Exception:
|
| 159 |
+
logger.exception("Failed to determine if tools are enabled.")
|
| 160 |
+
return False
|
| 161 |
+
|
| 162 |
+
def adjust_request(self, request: ChatCompletionRequest) -> ChatCompletionRequest:
|
| 163 |
+
"""Adjust request parameters for tool call token handling."""
|
| 164 |
+
request = super().adjust_request(request)
|
| 165 |
+
if request.tools and request.tool_choice != "none":
|
| 166 |
+
# Ensure tool call tokens (<tool_call>, </tool_call>) are not skipped
|
| 167 |
+
# during decoding. Even though they are not marked as special tokens,
|
| 168 |
+
# setting skip_special_tokens=False ensures proper handling in
|
| 169 |
+
# transformers 5.x where decoding behavior may have changed.
|
| 170 |
+
request.skip_special_tokens = False
|
| 171 |
+
return request
|
| 172 |
+
|
| 173 |
+
def extract_tool_calls(
|
| 174 |
+
self,
|
| 175 |
+
model_output: str,
|
| 176 |
+
request: ChatCompletionRequest,
|
| 177 |
+
) -> ExtractedToolCallInformation:
|
| 178 |
+
matched_tool_calls = self.func_call_regex.findall(model_output)
|
| 179 |
+
logger.debug("model_output: %s", model_output)
|
| 180 |
+
try:
|
| 181 |
+
tool_calls: list[ToolCall] = []
|
| 182 |
+
for match in matched_tool_calls:
|
| 183 |
+
tc_detail = self.func_detail_regex.search(match)
|
| 184 |
+
if not tc_detail:
|
| 185 |
+
logger.warning(
|
| 186 |
+
"Failed to parse tool call details from: %s",
|
| 187 |
+
match,
|
| 188 |
+
)
|
| 189 |
+
continue
|
| 190 |
+
tc_name = tc_detail.group(1).strip()
|
| 191 |
+
tc_args = tc_detail.group(2)
|
| 192 |
+
pairs = self.func_arg_regex.findall(tc_args) if tc_args else []
|
| 193 |
+
arg_dct: dict[str, Any] = {}
|
| 194 |
+
for key, value in pairs:
|
| 195 |
+
arg_key = key.strip()
|
| 196 |
+
arg_val = value.strip()
|
| 197 |
+
if not self._is_string_type(tc_name, arg_key, request.tools):
|
| 198 |
+
arg_val = self._deserialize(arg_val)
|
| 199 |
+
logger.debug("arg_key = %s, arg_val = %s", arg_key, arg_val)
|
| 200 |
+
arg_dct[arg_key] = arg_val
|
| 201 |
+
tool_calls.append(
|
| 202 |
+
ToolCall(
|
| 203 |
+
type="function",
|
| 204 |
+
function=FunctionCall(
|
| 205 |
+
name=tc_name,
|
| 206 |
+
arguments=json.dumps(arg_dct, ensure_ascii=False),
|
| 207 |
+
),
|
| 208 |
+
)
|
| 209 |
+
)
|
| 210 |
+
except Exception:
|
| 211 |
+
logger.exception("Failed to extract tool call spec")
|
| 212 |
+
return ExtractedToolCallInformation(
|
| 213 |
+
tools_called=False, tool_calls=[], content=model_output
|
| 214 |
+
)
|
| 215 |
+
else:
|
| 216 |
+
if len(tool_calls) > 0:
|
| 217 |
+
content: str | None = model_output[
|
| 218 |
+
: model_output.find(self.tool_calls_start_token)
|
| 219 |
+
]
|
| 220 |
+
# Normalize empty/whitespace-only content to None
|
| 221 |
+
if not content or not content.strip():
|
| 222 |
+
content = None
|
| 223 |
+
return ExtractedToolCallInformation(
|
| 224 |
+
tools_called=True, tool_calls=tool_calls, content=content
|
| 225 |
+
)
|
| 226 |
+
return ExtractedToolCallInformation(
|
| 227 |
+
tools_called=False, tool_calls=[], content=model_output
|
| 228 |
+
)
|
| 229 |
+
|
| 230 |
+
def extract_tool_calls_streaming(
|
| 231 |
+
self,
|
| 232 |
+
previous_text: str,
|
| 233 |
+
current_text: str,
|
| 234 |
+
delta_text: str,
|
| 235 |
+
previous_token_ids: Sequence[int],
|
| 236 |
+
current_token_ids: Sequence[int],
|
| 237 |
+
delta_token_ids: Sequence[int],
|
| 238 |
+
request: ChatCompletionRequest,
|
| 239 |
+
) -> DeltaMessage | None:
|
| 240 |
+
if not self._tools_enabled(request):
|
| 241 |
+
return DeltaMessage(content=delta_text) if delta_text else None
|
| 242 |
+
|
| 243 |
+
self._buffer += delta_text
|
| 244 |
+
|
| 245 |
+
while True:
|
| 246 |
+
if not self._in_tool_call:
|
| 247 |
+
start_idx = self._buffer.find(self.tool_call_start_token)
|
| 248 |
+
if start_idx == -1:
|
| 249 |
+
# Check for partial start token at end of buffer
|
| 250 |
+
for i in range(1, len(self.tool_call_start_token)):
|
| 251 |
+
if self._buffer.endswith(self.tool_call_start_token[:i]):
|
| 252 |
+
out = self._buffer[:-i]
|
| 253 |
+
self._buffer = self._buffer[-i:]
|
| 254 |
+
return DeltaMessage(content=out) if out else None
|
| 255 |
+
out = self._buffer
|
| 256 |
+
self._buffer = ""
|
| 257 |
+
return DeltaMessage(content=out) if out else None
|
| 258 |
+
|
| 259 |
+
if start_idx > 0:
|
| 260 |
+
out = self._buffer[:start_idx]
|
| 261 |
+
self._buffer = self._buffer[start_idx:]
|
| 262 |
+
return DeltaMessage(content=out) if out else None
|
| 263 |
+
|
| 264 |
+
self._buffer = self._buffer[len(self.tool_call_start_token) :]
|
| 265 |
+
self._begin_tool_call()
|
| 266 |
+
continue
|
| 267 |
+
|
| 268 |
+
# Parse tool name first
|
| 269 |
+
if not self.current_tool_name_sent:
|
| 270 |
+
nl = self._buffer.find("\n")
|
| 271 |
+
ak = self._buffer.find(self.arg_key_start)
|
| 272 |
+
end = self._buffer.find(self.tool_call_end_token)
|
| 273 |
+
candidates = [i for i in [nl, ak, end] if i != -1]
|
| 274 |
+
if not candidates:
|
| 275 |
+
return None
|
| 276 |
+
cut = min(candidates)
|
| 277 |
+
tool_name = self._buffer[:cut].strip()
|
| 278 |
+
if tool_name == "" and cut == end:
|
| 279 |
+
# Handle empty tool call like `<tool_call></tool_call>`.
|
| 280 |
+
# Consume the tokens and reset state to avoid infinite loop.
|
| 281 |
+
self._buffer = self._buffer[end + len(self.tool_call_end_token) :]
|
| 282 |
+
self._finish_tool_call()
|
| 283 |
+
self._revert_last_tool_call_state()
|
| 284 |
+
continue
|
| 285 |
+
|
| 286 |
+
if cut == nl:
|
| 287 |
+
self._buffer = self._buffer[nl + 1 :]
|
| 288 |
+
else:
|
| 289 |
+
self._buffer = self._buffer[cut:]
|
| 290 |
+
|
| 291 |
+
self._current_tool_name = tool_name
|
| 292 |
+
self.current_tool_name_sent = True
|
| 293 |
+
return self._emit_tool_name_delta(tool_name)
|
| 294 |
+
|
| 295 |
+
assert self._current_tool_name is not None
|
| 296 |
+
|
| 297 |
+
# Handle incremental string value streaming
|
| 298 |
+
if self._streaming_string_value:
|
| 299 |
+
val_end = self._buffer.find(self.arg_val_end)
|
| 300 |
+
if val_end != -1:
|
| 301 |
+
raw_content = self._buffer[:val_end]
|
| 302 |
+
self._buffer = self._buffer[val_end + len(self.arg_val_end) :]
|
| 303 |
+
self._streaming_string_value = False
|
| 304 |
+
self._pending_key = None
|
| 305 |
+
|
| 306 |
+
escaped = self._json_escape_string_content(raw_content)
|
| 307 |
+
frag = escaped + '"'
|
| 308 |
+
self.streamed_args_for_tool[self.current_tool_id] += frag
|
| 309 |
+
return self._emit_tool_args_delta(frag)
|
| 310 |
+
else:
|
| 311 |
+
# Check for partial </arg_value> at end
|
| 312 |
+
safe_len = len(self._buffer)
|
| 313 |
+
for i in range(1, len(self.arg_val_end)):
|
| 314 |
+
if self._buffer.endswith(self.arg_val_end[:i]):
|
| 315 |
+
safe_len = len(self._buffer) - i
|
| 316 |
+
break
|
| 317 |
+
|
| 318 |
+
if safe_len > 0:
|
| 319 |
+
to_emit = self._buffer[:safe_len]
|
| 320 |
+
self._buffer = self._buffer[safe_len:]
|
| 321 |
+
escaped = self._json_escape_string_content(to_emit)
|
| 322 |
+
if escaped:
|
| 323 |
+
self.streamed_args_for_tool[self.current_tool_id] += escaped
|
| 324 |
+
return self._emit_tool_args_delta(escaped)
|
| 325 |
+
return None
|
| 326 |
+
|
| 327 |
+
# If we have a pending key, parse its value
|
| 328 |
+
if self._pending_key is not None:
|
| 329 |
+
val_pos = self._buffer.find(self.arg_val_start)
|
| 330 |
+
if val_pos == -1:
|
| 331 |
+
return None
|
| 332 |
+
if val_pos > 0:
|
| 333 |
+
self._buffer = self._buffer[val_pos:]
|
| 334 |
+
|
| 335 |
+
key = (self._pending_key or "").strip()
|
| 336 |
+
|
| 337 |
+
is_string = self._is_string_type(
|
| 338 |
+
self._current_tool_name, key, request.tools
|
| 339 |
+
)
|
| 340 |
+
|
| 341 |
+
if is_string:
|
| 342 |
+
# String type: stream incrementally
|
| 343 |
+
self._buffer = self._buffer[len(self.arg_val_start) :]
|
| 344 |
+
|
| 345 |
+
if key in self._seen_keys[self.current_tool_id]:
|
| 346 |
+
self._pending_key = None
|
| 347 |
+
continue
|
| 348 |
+
|
| 349 |
+
self._seen_keys[self.current_tool_id].add(key)
|
| 350 |
+
key_json = json.dumps(key, ensure_ascii=False)
|
| 351 |
+
|
| 352 |
+
if not self._args_started[self.current_tool_id]:
|
| 353 |
+
frag = "{" + key_json + ': "'
|
| 354 |
+
self._args_started[self.current_tool_id] = True
|
| 355 |
+
else:
|
| 356 |
+
frag = ", " + key_json + ': "'
|
| 357 |
+
|
| 358 |
+
self.streamed_args_for_tool[self.current_tool_id] += frag
|
| 359 |
+
self._streaming_string_value = True
|
| 360 |
+
return self._emit_tool_args_delta(frag)
|
| 361 |
+
else:
|
| 362 |
+
# Non-string type: wait for complete value
|
| 363 |
+
val_end = self._buffer.find(self.arg_val_end)
|
| 364 |
+
if val_end == -1:
|
| 365 |
+
return None
|
| 366 |
+
|
| 367 |
+
raw_val = self._buffer[len(self.arg_val_start) : val_end].strip()
|
| 368 |
+
self._buffer = self._buffer[val_end + len(self.arg_val_end) :]
|
| 369 |
+
self._pending_key = None
|
| 370 |
+
|
| 371 |
+
frag_or_none = self._append_arg_fragment(key=key, raw_val=raw_val)
|
| 372 |
+
if frag_or_none:
|
| 373 |
+
return self._emit_tool_args_delta(frag_or_none)
|
| 374 |
+
continue
|
| 375 |
+
|
| 376 |
+
# Parse next arg or close
|
| 377 |
+
end_pos = self._buffer.find(self.tool_call_end_token)
|
| 378 |
+
key_pos = self._buffer.find(self.arg_key_start)
|
| 379 |
+
if end_pos != -1 and (key_pos == -1 or end_pos < key_pos):
|
| 380 |
+
self._buffer = self._buffer[end_pos + len(self.tool_call_end_token) :]
|
| 381 |
+
frag_or_none = self._close_args_if_needed()
|
| 382 |
+
# Finalize prev_tool_call_arr with complete parsed arguments
|
| 383 |
+
if self._current_tool_name:
|
| 384 |
+
try:
|
| 385 |
+
full_args_str = self.streamed_args_for_tool[
|
| 386 |
+
self.current_tool_id
|
| 387 |
+
]
|
| 388 |
+
json.loads(full_args_str)
|
| 389 |
+
self.prev_tool_call_arr[self.current_tool_id] = {
|
| 390 |
+
"name": self._current_tool_name,
|
| 391 |
+
"arguments": full_args_str,
|
| 392 |
+
}
|
| 393 |
+
except (json.JSONDecodeError, IndexError) as e:
|
| 394 |
+
logger.warning(
|
| 395 |
+
"Failed to finalize tool call state for tool %d: %s",
|
| 396 |
+
self.current_tool_id,
|
| 397 |
+
e,
|
| 398 |
+
)
|
| 399 |
+
self._finish_tool_call()
|
| 400 |
+
return (
|
| 401 |
+
self._emit_tool_args_delta(frag_or_none) if frag_or_none else None
|
| 402 |
+
)
|
| 403 |
+
|
| 404 |
+
if key_pos == -1:
|
| 405 |
+
return None
|
| 406 |
+
if key_pos > 0:
|
| 407 |
+
self._buffer = self._buffer[key_pos:]
|
| 408 |
+
key_end = self._buffer.find(self.arg_key_end)
|
| 409 |
+
if key_end == -1:
|
| 410 |
+
return None
|
| 411 |
+
key = self._buffer[len(self.arg_key_start) : key_end]
|
| 412 |
+
self._buffer = self._buffer[key_end + len(self.arg_key_end) :]
|
| 413 |
+
self._pending_key = key
|
| 414 |
+
continue
|
| 415 |
+
|
| 416 |
+
def _ensure_tool_state(self) -> None:
|
| 417 |
+
while len(self._tool_call_ids) <= self.current_tool_id:
|
| 418 |
+
self._tool_call_ids.append(
|
| 419 |
+
make_tool_call_id(id_type="random", func_name=None, idx=None)
|
| 420 |
+
)
|
| 421 |
+
while len(self.streamed_args_for_tool) <= self.current_tool_id:
|
| 422 |
+
self.streamed_args_for_tool.append("")
|
| 423 |
+
while len(self.prev_tool_call_arr) <= self.current_tool_id:
|
| 424 |
+
self.prev_tool_call_arr.append({})
|
| 425 |
+
while len(self._args_started) <= self.current_tool_id:
|
| 426 |
+
self._args_started.append(False)
|
| 427 |
+
while len(self._args_closed) <= self.current_tool_id:
|
| 428 |
+
self._args_closed.append(False)
|
| 429 |
+
while len(self._seen_keys) <= self.current_tool_id:
|
| 430 |
+
self._seen_keys.append(set())
|
| 431 |
+
|
| 432 |
+
def _begin_tool_call(self) -> None:
|
| 433 |
+
if self.current_tool_id == -1:
|
| 434 |
+
self.current_tool_id = 0
|
| 435 |
+
else:
|
| 436 |
+
self.current_tool_id += 1
|
| 437 |
+
self._ensure_tool_state()
|
| 438 |
+
self.current_tool_name_sent = False
|
| 439 |
+
self._current_tool_name = None
|
| 440 |
+
self._pending_key = None
|
| 441 |
+
self._streaming_string_value = False
|
| 442 |
+
self._in_tool_call = True
|
| 443 |
+
|
| 444 |
+
def _finish_tool_call(self) -> None:
|
| 445 |
+
self._in_tool_call = False
|
| 446 |
+
self._current_tool_name = None
|
| 447 |
+
self._pending_key = None
|
| 448 |
+
self._streaming_string_value = False
|
| 449 |
+
|
| 450 |
+
def _revert_last_tool_call_state(self) -> None:
|
| 451 |
+
"""Revert the state allocation for the last tool call."""
|
| 452 |
+
if self.current_tool_id < 0:
|
| 453 |
+
return
|
| 454 |
+
self._tool_call_ids.pop()
|
| 455 |
+
self.streamed_args_for_tool.pop()
|
| 456 |
+
self.prev_tool_call_arr.pop()
|
| 457 |
+
self._args_started.pop()
|
| 458 |
+
self._args_closed.pop()
|
| 459 |
+
self._seen_keys.pop()
|
| 460 |
+
self.current_tool_id -= 1
|
| 461 |
+
|
| 462 |
+
def _emit_tool_name_delta(self, tool_name: str) -> DeltaMessage:
|
| 463 |
+
self.prev_tool_call_arr[self.current_tool_id] = {
|
| 464 |
+
"name": self._current_tool_name,
|
| 465 |
+
"arguments": {},
|
| 466 |
+
}
|
| 467 |
+
return DeltaMessage(
|
| 468 |
+
tool_calls=[
|
| 469 |
+
DeltaToolCall(
|
| 470 |
+
index=self.current_tool_id,
|
| 471 |
+
id=self._tool_call_ids[self.current_tool_id],
|
| 472 |
+
type="function",
|
| 473 |
+
function=DeltaFunctionCall(
|
| 474 |
+
name=tool_name,
|
| 475 |
+
arguments="",
|
| 476 |
+
).model_dump(exclude_none=True),
|
| 477 |
+
)
|
| 478 |
+
]
|
| 479 |
+
)
|
| 480 |
+
|
| 481 |
+
def _emit_tool_args_delta(self, fragment: str) -> DeltaMessage:
|
| 482 |
+
return DeltaMessage(
|
| 483 |
+
tool_calls=[
|
| 484 |
+
DeltaToolCall(
|
| 485 |
+
index=self.current_tool_id,
|
| 486 |
+
function=DeltaFunctionCall(arguments=fragment).model_dump(
|
| 487 |
+
exclude_none=True
|
| 488 |
+
),
|
| 489 |
+
)
|
| 490 |
+
]
|
| 491 |
+
)
|
| 492 |
+
|
| 493 |
+
def _append_arg_fragment(
|
| 494 |
+
self,
|
| 495 |
+
*,
|
| 496 |
+
key: str,
|
| 497 |
+
raw_val: str,
|
| 498 |
+
) -> str | None:
|
| 499 |
+
key = key.strip()
|
| 500 |
+
if not key:
|
| 501 |
+
return None
|
| 502 |
+
if key in self._seen_keys[self.current_tool_id]:
|
| 503 |
+
return None
|
| 504 |
+
|
| 505 |
+
# This function is only called for non-string types (already checked
|
| 506 |
+
# by _is_string_type in the caller), so we always deserialize.
|
| 507 |
+
val_obj: Any = self._deserialize(raw_val)
|
| 508 |
+
|
| 509 |
+
key_json = json.dumps(key, ensure_ascii=False)
|
| 510 |
+
val_json = json.dumps(val_obj, ensure_ascii=False)
|
| 511 |
+
|
| 512 |
+
if not self._args_started[self.current_tool_id]:
|
| 513 |
+
fragment = "{" + key_json + ": " + val_json
|
| 514 |
+
self._args_started[self.current_tool_id] = True
|
| 515 |
+
else:
|
| 516 |
+
fragment = "," + key_json + ": " + val_json
|
| 517 |
+
|
| 518 |
+
self._seen_keys[self.current_tool_id].add(key)
|
| 519 |
+
self.streamed_args_for_tool[self.current_tool_id] += fragment
|
| 520 |
+
return fragment
|
| 521 |
+
|
| 522 |
+
def _close_args_if_needed(self) -> str | None:
|
| 523 |
+
if self._args_closed[self.current_tool_id]:
|
| 524 |
+
return None
|
| 525 |
+
self._args_closed[self.current_tool_id] = True
|
| 526 |
+
if not self._args_started[self.current_tool_id]:
|
| 527 |
+
fragment = "{}"
|
| 528 |
+
self.streamed_args_for_tool[self.current_tool_id] = fragment
|
| 529 |
+
else:
|
| 530 |
+
fragment = "}"
|
| 531 |
+
self.streamed_args_for_tool[self.current_tool_id] += fragment
|
| 532 |
+
return fragment
|
model-00001-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d67f736c2d433b523a825f857ad90cca0b81511b2f0e9de91144218f98c0132
|
| 3 |
+
size 47367547764
|
model-00002-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e2ae8a76210e0f3a6c74fc5cd7e7a8834730f8fb457b5da46da1ce585ef362a
|
| 3 |
+
size 47732873272
|
model-00003-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cae935a4bbb5a5077a4b5203aadc02b650d876511f5bf1a251e357d8abc122a4
|
| 3 |
+
size 47732875376
|
model-00004-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da6231e47371a3e3856ce4700c4b8958dfd319b43500a5621bd5db1004574407
|
| 3 |
+
size 47732875376
|
model-00005-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81b2e096ff8ef8b0c907ab0dace47cb57b0a3be5df1556a9ceb2b22f2d766b9a
|
| 3 |
+
size 47732875376
|
model-00006-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e12b005d6cf44cf749ee2ba598a87f9d96aedf65041672d47d6635e06b4cd1c
|
| 3 |
+
size 47732875376
|
model-00007-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e33ecd6d3871528a51adbc78fd1a2221d79d45166205e4be50b724a9d46edc98
|
| 3 |
+
size 47732875376
|
model-00008-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2c26a2c5d5a5335facbaefe87ad8897d1a17e7fdaf295946d8f3c2938f958f97
|
| 3 |
+
size 47732875376
|
model-00009-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44321b7925cc2ae93abbe9e1044036d035fbf682a340b589a8360b8260cfce0b
|
| 3 |
+
size 47732875376
|
model-00010-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0c33581cf145e50971e0cbc38f4c6f89959bd75dac96770ee09048f08e3a44a
|
| 3 |
+
size 47732875376
|
model-00011-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41d25cd7ab407104d523a333b452f3c8315f13fb6fe0a710c09e1a5b26e964fa
|
| 3 |
+
size 47732875376
|
model-00012-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35bfdddae8ee0e9b1b5ddf8def3fed5b30ab1347152c637e56c43b32ba81f843
|
| 3 |
+
size 47732875376
|
model-00013-of-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec56df6455404445f651ae0cdec399820be3e3fc094caa566ced0fbb8072e9d2
|
| 3 |
+
size 29241735984
|
model-mtp-layer78-pruned.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c615ce6c859e9803d0338078a5e390a56758131372292646f58bf281d1bf0be7
|
| 3 |
+
size 8106509596
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
reap_args.yaml
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cluster_args:
|
| 2 |
+
cluster_description: null
|
| 3 |
+
cluster_method: agglomerative
|
| 4 |
+
compression_ratio: 0.2
|
| 5 |
+
expert_sim: ttm
|
| 6 |
+
frequency_penalty: true
|
| 7 |
+
linkage_method: average
|
| 8 |
+
max_cluster_size: null
|
| 9 |
+
multi_layer: null
|
| 10 |
+
num_clusters: null
|
| 11 |
+
singleton_outlier_experts: false
|
| 12 |
+
singleton_super_experts: false
|
| 13 |
+
softmax_temperature: null
|
| 14 |
+
ds_args:
|
| 15 |
+
dataset_config_name: null
|
| 16 |
+
dataset_name: theblackcat102/evol-codealpaca-v1:128,Salesforce/xlam-function-calling-60k:128,open-r1/Mixture-of-Thoughts[code]:128,open-r1/Mixture-of-Thoughts[math]:128,open-r1/Mixture-of-Thoughts[science]:128,SWE-bench/SWE-smith-trajectories(tool):128
|
| 17 |
+
dataset_test_split: test
|
| 18 |
+
shuffle: true
|
| 19 |
+
split: train
|
| 20 |
+
eval_args:
|
| 21 |
+
evalplus_tasks:
|
| 22 |
+
- mbpp
|
| 23 |
+
- humaneval
|
| 24 |
+
greedy: true
|
| 25 |
+
lm_eval_tasks:
|
| 26 |
+
- winogrande
|
| 27 |
+
- arc_challenge
|
| 28 |
+
- arc_easy
|
| 29 |
+
- boolq
|
| 30 |
+
- hellaswag
|
| 31 |
+
- mmlu
|
| 32 |
+
- openbookqa
|
| 33 |
+
- rte
|
| 34 |
+
min_p: 0.0
|
| 35 |
+
parallel_tasks: 32
|
| 36 |
+
results_dir: null
|
| 37 |
+
run_evalplus: true
|
| 38 |
+
run_livecodebench: true
|
| 39 |
+
run_lm_eval: true
|
| 40 |
+
run_math: false
|
| 41 |
+
run_wildbench: false
|
| 42 |
+
server_log_file_name: pruning-cli-0.log
|
| 43 |
+
temperature: 0.7
|
| 44 |
+
top_k: 20
|
| 45 |
+
top_p: 0.8
|
| 46 |
+
use_server: true
|
| 47 |
+
vllm_port: 8000
|
| 48 |
+
model_args:
|
| 49 |
+
model_name: /models/GLM-5-FP8
|
| 50 |
+
num_experts_per_tok_override: null
|
| 51 |
+
obs_args:
|
| 52 |
+
batch_size: 1
|
| 53 |
+
distance_measure: cosine
|
| 54 |
+
model_max_length: 2048
|
| 55 |
+
output_file_name: observations_2_cosine-seed_42.pt
|
| 56 |
+
overwrite_observations: false
|
| 57 |
+
record_pruning_metrics_only: true
|
| 58 |
+
renormalize_router_weights: true
|
| 59 |
+
return_vllm_tokens_prompt: false
|
| 60 |
+
samples_per_category: 2
|
| 61 |
+
select_only_categories: null
|
| 62 |
+
split_by_category: false
|
| 63 |
+
truncate: false
|
| 64 |
+
prune_args:
|
| 65 |
+
n_experts_to_prune: null
|
| 66 |
+
overwrite_pruned_model: false
|
| 67 |
+
perserve_outliers: false
|
| 68 |
+
perserve_super_experts: false
|
| 69 |
+
prune_method: reap
|
| 70 |
+
reap_args:
|
| 71 |
+
debug: false
|
| 72 |
+
do_eval: false
|
| 73 |
+
plot_clusters: true
|
| 74 |
+
profile: false
|
| 75 |
+
run_observer_only: false
|
| 76 |
+
seed: 42
|
| 77 |
+
smoke_test: true
|
retained_experts.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:19e773648cb4e65de8660ea6365e10acca112d42a854923df93db4a6f333a82d
|
| 3 |
+
size 20217442
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": false,
|
| 4 |
+
"do_lower_case": false,
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|endoftext|>",
|
| 8 |
+
"[MASK]",
|
| 9 |
+
"[gMASK]",
|
| 10 |
+
"[sMASK]",
|
| 11 |
+
"<sop>",
|
| 12 |
+
"<eop>",
|
| 13 |
+
"<|system|>",
|
| 14 |
+
"<|user|>",
|
| 15 |
+
"<|assistant|>",
|
| 16 |
+
"<|observation|>",
|
| 17 |
+
"<|begin_of_image|>",
|
| 18 |
+
"<|end_of_image|>",
|
| 19 |
+
"<|begin_of_video|>",
|
| 20 |
+
"<|end_of_video|>",
|
| 21 |
+
"<|begin_of_audio|>",
|
| 22 |
+
"<|end_of_audio|>",
|
| 23 |
+
"<|begin_of_transcription|>",
|
| 24 |
+
"<|end_of_transcription|>"
|
| 25 |
+
],
|
| 26 |
+
"is_local": true,
|
| 27 |
+
"model_max_length": 202752,
|
| 28 |
+
"model_specific_special_tokens": {},
|
| 29 |
+
"pad_token": "<|endoftext|>",
|
| 30 |
+
"padding_side": "left",
|
| 31 |
+
"remove_space": false,
|
| 32 |
+
"tokenizer_class": "TokenizersBackend"
|
| 33 |
+
}
|