feat(parser): resolve special-token suffix at runtime for compatibility (#29920)

This commit is contained in:
Xinyuan Tong
2026-07-05 00:13:46 +08:00
committed by GitHub
parent 763c6bf372
commit 854b46be99
10 changed files with 171 additions and 35 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class ReasoningTokenUsageMixin:
def init_reasoning_token_verifier(cls):
assert cls.reasoning_parser_name, "reasoning_parser_name must be set"
cls.tokenizer = get_tokenizer(cls.model)
parser = ReasoningParser(cls.reasoning_parser_name)
parser = ReasoningParser(cls.reasoning_parser_name, tokenizer=cls.tokenizer)
cls.think_end_token_id = cls.tokenizer.convert_tokens_to_ids(
parser.detector.think_end_token
)