Skip to content

Commit 19f76ee

Browse files
authored
[misc] refactor speculative config (vllm-project#25657)
Signed-off-by: zxw <1020938856@qq.com>
1 parent dd70437 commit 19f76ee

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

vllm/config/speculative.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,9 @@ def __post_init__(self):
209209

210210
if self.model is None and self.num_speculative_tokens is not None:
211211
# TODO(Shangming): Refactor mtp configuration logic when supporting
212-
# mtp acceleration for more models besides deepseek_v3
213-
if self.target_model_config and \
214-
(self.target_model_config.hf_text_config.model_type \
215-
== "deepseek_v3" or
216-
self.target_model_config.hf_text_config.model_type in
217-
("mimo","ernie4_5_moe", "qwen3_next")):
212+
if (self.target_model_config
213+
and self.target_model_config.hf_text_config.model_type
214+
in ("deepseek_v3", "mimo", "ernie4_5_moe", "qwen3_next")):
218215
# use the draft model from the same model:
219216
self.model = self.target_model_config.model
220217
# Align the quantization of draft model for cases such as
@@ -224,8 +221,9 @@ def __post_init__(self):
224221
elif self.method in ("ngram", "[ngram]"):
225222
self.model = "ngram"
226223
else:
227-
raise ValueError("num_speculative_tokens was provided without "
228-
"speculative model.")
224+
raise ValueError(
225+
"num_speculative_tokens was provided but without "
226+
"speculative model.")
229227

230228
# Automatically configure the method for ngram when "model" is used
231229
# instead of "method"

0 commit comments

Comments
 (0)