filter by num_hidden_layers (#7056)

This commit is contained in:
pansicheng
2025-06-13 15:53:09 +08:00
committed by GitHub
parent da47621ccc
commit 2f4ec752bc

View File

@@ -1786,8 +1786,7 @@ class DeepseekV2ForCausalLM(nn.Module):
for name in weight_names:
if "kv_b_proj" in name:
layer_id = int(name.split(".")[2])
# filter the nextn layer.
if layer_id != self.config.num_hidden_layers:
if layer_id < self.config.num_hidden_layers:
layer_ids.add(layer_id)
for layer_id in layer_ids: