mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-01-15 20:14:31 +08:00
Signed-off-by: Yan Lu <luyan@nvidia.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
29 lines
958 B
Python
29 lines
958 B
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
|
|
from vllm.reasoning.abs_reasoning_parsers import ReasoningParserManager
|
|
from vllm.reasoning.basic_parsers import BaseThinkingReasoningParser
|
|
|
|
|
|
@ReasoningParserManager.register_module("seed_oss")
|
|
class SeedOSSReasoningParser(BaseThinkingReasoningParser):
|
|
"""
|
|
Reasoning parser for SeedOSS model.
|
|
|
|
The SeedOSS model uses <seed:think>...</seed:think> tokens to
|
|
denote reasoning content text. This parser extracts
|
|
the reasoning content from the model output.
|
|
Similar to DeepSeek R1, it supports cases
|
|
where the model doesn't generate the start token.
|
|
"""
|
|
|
|
@property
|
|
def start_token(self) -> str:
|
|
"""The token that starts reasoning content."""
|
|
return "<seed:think>"
|
|
|
|
@property
|
|
def end_token(self) -> str:
|
|
"""The token that ends reasoning content."""
|
|
return "</seed:think>"
|