[Bugfix] [Reasoning] Add reasoning_start_str/reasoning_end_str properties to reasoning parsers (#40566)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2026-04-22 07:27:44 +00:00
committed by GitHub
parent 123674879e
commit a2bd09c960
5 changed files with 41 additions and 0 deletions
+8
View File
@@ -237,6 +237,14 @@ class Olmo3ReasoningParser(ReasoningParser):
think_start=self.think_start, think_end=self.think_end
)
@property
def reasoning_start_str(self) -> str:
return self.think_start
@property
def reasoning_end_str(self) -> str:
return self.think_end
def is_reasoning_end(self, input_ids: Sequence[int]) -> bool:
text = self.model_tokenizer.decode(input_ids)
return self.think_end in text