[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user