[Bugfix][Frontend] Count reasoning tokens for Harmony, DeepSeek-V3 and Step3 parsers (#58626)

Signed-off-by: Samyabrata Maji <116789799+sammaji@users.noreply.github.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
Samyabrata Maji
2026-09-25 00:12:29 +00:00
committed by GitHub
co-authored by Flora Feng
parent b3a87b2d04
commit 064bc747ab
6 changed files with 136 additions and 3 deletions
+5
View File
@@ -121,3 +121,8 @@ class Step3ReasoningParser(ReasoningParser):
return []
else:
return input_ids[input_ids.index(self.think_end_token_id) + 1 :]
def count_reasoning_tokens(self, token_ids: Sequence[int]) -> int:
if self.think_end_token_id not in token_ids:
return len(token_ids)
return list(token_ids).index(self.think_end_token_id)