fix: make override DeepseekV2Model work (#14707)

This commit is contained in:
Yineng Zhang
2025-12-08 23:11:18 -08:00
committed by GitHub
parent 0f8bd55f3e
commit b626334475

View File

@@ -3202,7 +3202,6 @@ class DeepseekV2Model(nn.Module):
class DeepseekV2ForCausalLM(nn.Module):
# for quark model load
packed_modules_mapping = {}
model_cls = DeepseekV2Model
def __init__(
self,
@@ -3228,7 +3227,7 @@ class DeepseekV2ForCausalLM(nn.Module):
self.quant_config = quant_config
self.determine_num_fused_shared_experts()
self.use_nsa = is_deepseek_nsa(config)
self.model = self.model_cls(
self.model = DeepseekV2Model(
config, quant_config, prefix=add_prefix("model", prefix)
)
if self.pp_group.is_last_rank: