seedoss_reasoning_parser.py 832 Bytes
Newer Older
1
2
3
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

4

5
6
7
8
9
10
11
from vllm.reasoning.basic_parsers import BaseThinkingReasoningParser


class SeedOSSReasoningParser(BaseThinkingReasoningParser):
    """
    Reasoning parser for SeedOSS model.

12
13
    The SeedOSS model uses <seed:think>...</seed:think> tokens to
    denote reasoning content text. This parser extracts
14
    the reasoning content from the model output.
15
    Similar to DeepSeek R1, it supports cases
16
17
18
19
20
21
22
23
24
25
26
27
    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>"