diff --git a/python/sglang/srt/speculative/ngram_worker.py b/python/sglang/srt/speculative/ngram_worker.py index c896d6d0a..82aa4a187 100644 --- a/python/sglang/srt/speculative/ngram_worker.py +++ b/python/sglang/srt/speculative/ngram_worker.py @@ -328,8 +328,9 @@ class NGRAMWorker: ) req.time_stats.set_spec_verify_end_time(accepted_tokens=accepted) - # Store accept_lens for per-request metrics - accept_lens = verify_input.num_accepted_drafts + # Store accept_lens (with bonus) for per-request metrics; downstream + # subtracts 1 to recover drafts-only counts. + accept_lens = verify_input.num_accepted_tokens if batch.return_logprob: add_output_logprobs_for_spec_v1(batch, verify_input, logits_output) self._update_ngram_corpus(batch)