Auto set draft model path for MTP (#5793)

This commit is contained in:
Ke Bao
2025-04-30 07:25:40 +08:00
committed by GitHub
parent 9419e75d60
commit dd408ee481
6 changed files with 115 additions and 287 deletions

View File

@@ -47,6 +47,7 @@ class ModelConfig:
dtype: str = "auto",
quantization: Optional[str] = None,
override_config_file: Optional[str] = None,
is_draft_model: bool = False,
) -> None:
self.model_path = model_path
@@ -85,6 +86,12 @@ class ModelConfig:
else:
enable_multimodal = True
if (
is_draft_model
and self.hf_config.architectures[0] == "DeepseekV3ForCausalLM"
):
self.hf_config.architectures[0] = "DeepseekV3ForCausalLMNextN"
# Check model type
self.is_generation = is_generation_model(
self.hf_config.architectures, is_embedding