From 656fd72976a86f4bc1887be228dac0ab71c56c71 Mon Sep 17 00:00:00 2001 From: shangmingc Date: Tue, 1 Apr 2025 17:26:22 +0800 Subject: [PATCH] [Misc] Fix speculative config repr string (#15860) Signed-off-by: Shangming Cai --- vllm/config.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vllm/config.py b/vllm/config.py index 96b6f84be2850..c82c9763ccdc7 100644 --- a/vllm/config.py +++ b/vllm/config.py @@ -2359,12 +2359,10 @@ class SpeculativeConfig: return self.num_speculative_tokens def __repr__(self) -> str: - if self.prompt_lookup_max is not None and self.prompt_lookup_max > 0: - draft_model = "ngram" - else: - draft_model = self.draft_model_config.model + method = self.method + model = None if method == "ngram" else self.draft_model_config.model num_spec_tokens = self.num_speculative_tokens - return f"SpeculativeConfig({draft_model=}, {num_spec_tokens=})" + return f"SpeculativeConfig({method=}, {model=}, {num_spec_tokens=})" @dataclass