[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:
co-authored by
Flora Feng
parent
b3a87b2d04
commit
064bc747ab
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user