fix spec dec request level metrics (#13754)

Co-authored-by: Liangsheng Yin <lsyincs@gmail.com>
This commit is contained in:
Vedant V Jhaveri
2025-11-27 01:09:21 +08:00
committed by GitHub
co-authored by Liangsheng Yin
parent 262c3c1fde
commit 9dab534b35
3 changed files with 13 additions and 4 deletions
@@ -185,6 +185,10 @@ class NgramVerifyInput(SpecInput):
)
raise e
req.spec_verify_ct += 1
req.spec_accepted_tokens += (
sum(1 for idx in accept_index_row if idx != -1) - 1
)
if has_finished:
self.accept_length = (self.accept_index != -1).sum(dim=1) - 1
self.accept_index = self.accept_index[self.accept_index != -1]