brady777 commited on
Commit
c874cc4
·
verified ·
1 Parent(s): 92a5f5b

Restore 54 KV-shared tensors (layers 24-41) in model.safetensors; stock-schema config.json (root + merged)

Browse files
Files changed (5) hide show
  1. README.md +26 -0
  2. config.json +3 -25
  3. merged/config.json +3 -25
  4. merged/model.safetensors +2 -2
  5. model.safetensors +2 -2
README.md CHANGED
@@ -142,3 +142,29 @@ fixed function-calling instruction block to the caller's system message, and
142
  when a generation terminates inside the thought channel with an empty answer it
143
  attempts to recover a bracket-format tool-call list from the raw text before
144
  returning an empty answer. Both behaviors are in the script, unabridged.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  when a generation terminates inside the thought channel with an empty answer it
143
  attempts to recover a bracket-format tool-call list from the raw text before
144
  returning an empty answer. Both behaviors are in the script, unabridged.
145
+
146
+ ---
147
+
148
+ ### 2026-08 weight-file fix
149
+
150
+ Earlier revisions of this repository shipped a `model.safetensors` missing 54
151
+ tensors relative to the base model: `k_proj`, `v_proj`, and `k_norm` weights
152
+ for language-model layers 24–41 (2076 keys instead of 2130). These layers use
153
+ shared KV projections (`num_kv_shared_layers: 18`), and the export path
154
+ (transformers 5.15.0 `save_pretrained`) silently omitted their parameters.
155
+ Some engines tolerated the omission; vLLM 0.25.1 correctly refused to load
156
+ the checkpoint.
157
+
158
+ The current revision restores all 2130 tensors. The 54 restored tensors are
159
+ byte-exact copies from `google/gemma-4-E4B-it` — this is provably lossless:
160
+ the fine-tuning adapter contains no LoRA entries for k/v projections at or
161
+ above layer 24, and every one of the 2076 retained tensors is either
162
+ bit-identical to the base or accounted for by an adapter-targeted module.
163
+ `config.json` now matches the base model's schema so the checkpoint loads
164
+ under both current and older transformers versions.
165
+
166
+ Verification: the fixed checkpoint serves under vLLM 0.25.1, and greedy
167
+ decoding logprobs match an independently reconstructed base+adapter merge at
168
+ the same numerical floor measured between two servings of the unmodified base
169
+ model (top-1 agreement 99.6% vs a 98.8% same-model cross-engine control; max
170
+ chosen-token logprob difference 0.166 vs 0.126 control).
config.json CHANGED
@@ -66,6 +66,7 @@
66
  "eos_token_id": 1,
67
  "expert_intermediate_size": null,
68
  "final_logit_softcapping": 30.0,
 
69
  "head_dim": 256,
70
  "hidden_activation": "gelu_pytorch_tanh",
71
  "hidden_size": 2560,
@@ -118,36 +119,13 @@
118
  ],
119
  "max_position_embeddings": 131072,
120
  "model_type": "gemma4_text",
121
- "moe_intermediate_size": null,
122
  "num_attention_heads": 8,
123
  "num_experts": null,
 
124
  "num_hidden_layers": 42,
125
  "num_key_value_heads": 2,
126
  "num_kv_shared_layers": 18,
127
  "pad_token_id": 0,
128
- "per_layer_config": {
129
- "05": {
130
- "head_dim": 512
131
- },
132
- "11": {
133
- "head_dim": 512
134
- },
135
- "17": {
136
- "head_dim": 512
137
- },
138
- "23": {
139
- "head_dim": 512
140
- },
141
- "29": {
142
- "head_dim": 512
143
- },
144
- "35": {
145
- "head_dim": 512
146
- },
147
- "41": {
148
- "head_dim": 512
149
- }
150
- },
151
  "rms_norm_eps": 1e-06,
152
  "rope_parameters": {
153
  "full_attention": {
@@ -170,7 +148,7 @@
170
  "vocab_size_per_layer_input": 262144
171
  },
172
  "tie_word_embeddings": true,
173
- "transformers_version": "5.15.0",
174
  "video_token_id": 258884,
175
  "vision_config": {
176
  "_name_or_path": "",
 
66
  "eos_token_id": 1,
67
  "expert_intermediate_size": null,
68
  "final_logit_softcapping": 30.0,
69
+ "global_head_dim": 512,
70
  "head_dim": 256,
71
  "hidden_activation": "gelu_pytorch_tanh",
72
  "hidden_size": 2560,
 
119
  ],
120
  "max_position_embeddings": 131072,
121
  "model_type": "gemma4_text",
 
122
  "num_attention_heads": 8,
123
  "num_experts": null,
124
+ "num_global_key_value_heads": null,
125
  "num_hidden_layers": 42,
126
  "num_key_value_heads": 2,
127
  "num_kv_shared_layers": 18,
128
  "pad_token_id": 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  "rms_norm_eps": 1e-06,
130
  "rope_parameters": {
131
  "full_attention": {
 
148
  "vocab_size_per_layer_input": 262144
149
  },
150
  "tie_word_embeddings": true,
151
+ "transformers_version": "5.5.0.dev0",
152
  "video_token_id": 258884,
153
  "vision_config": {
154
  "_name_or_path": "",
merged/config.json CHANGED
@@ -66,6 +66,7 @@
66
  "eos_token_id": 1,
67
  "expert_intermediate_size": null,
68
  "final_logit_softcapping": 30.0,
 
69
  "head_dim": 256,
70
  "hidden_activation": "gelu_pytorch_tanh",
71
  "hidden_size": 2560,
@@ -118,36 +119,13 @@
118
  ],
119
  "max_position_embeddings": 131072,
120
  "model_type": "gemma4_text",
121
- "moe_intermediate_size": null,
122
  "num_attention_heads": 8,
123
  "num_experts": null,
 
124
  "num_hidden_layers": 42,
125
  "num_key_value_heads": 2,
126
  "num_kv_shared_layers": 18,
127
  "pad_token_id": 0,
128
- "per_layer_config": {
129
- "05": {
130
- "head_dim": 512
131
- },
132
- "11": {
133
- "head_dim": 512
134
- },
135
- "17": {
136
- "head_dim": 512
137
- },
138
- "23": {
139
- "head_dim": 512
140
- },
141
- "29": {
142
- "head_dim": 512
143
- },
144
- "35": {
145
- "head_dim": 512
146
- },
147
- "41": {
148
- "head_dim": 512
149
- }
150
- },
151
  "rms_norm_eps": 1e-06,
152
  "rope_parameters": {
153
  "full_attention": {
@@ -170,7 +148,7 @@
170
  "vocab_size_per_layer_input": 262144
171
  },
172
  "tie_word_embeddings": true,
173
- "transformers_version": "5.15.0",
174
  "video_token_id": 258884,
175
  "vision_config": {
176
  "_name_or_path": "",
 
66
  "eos_token_id": 1,
67
  "expert_intermediate_size": null,
68
  "final_logit_softcapping": 30.0,
69
+ "global_head_dim": 512,
70
  "head_dim": 256,
71
  "hidden_activation": "gelu_pytorch_tanh",
72
  "hidden_size": 2560,
 
119
  ],
120
  "max_position_embeddings": 131072,
121
  "model_type": "gemma4_text",
 
122
  "num_attention_heads": 8,
123
  "num_experts": null,
124
+ "num_global_key_value_heads": null,
125
  "num_hidden_layers": 42,
126
  "num_key_value_heads": 2,
127
  "num_kv_shared_layers": 18,
128
  "pad_token_id": 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  "rms_norm_eps": 1e-06,
130
  "rope_parameters": {
131
  "full_attention": {
 
148
  "vocab_size_per_layer_input": 262144
149
  },
150
  "tie_word_embeddings": true,
151
+ "transformers_version": "5.5.0.dev0",
152
  "video_token_id": 258884,
153
  "vision_config": {
154
  "_name_or_path": "",
merged/model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4399a604e0f72d9785060b3dcce47fad44986da0e8dfd82ef17db116dad9ba51
3
- size 15882477500
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85ba6e826cae2cb4978659417dda0840e738a6adc0bba8a7dfd9b43499947faf
3
+ size 15992595884
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4399a604e0f72d9785060b3dcce47fad44986da0e8dfd82ef17db116dad9ba51
3
- size 15882477500
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85ba6e826cae2cb4978659417dda0840e738a6adc0bba8a7dfd9b43499947faf
3
+ size 15992595884