vllm.reasoning.hunyuan_a13b_reasoning_parser
¶
Classes:
-
HunyuanA13BReasoningParser–Reasoning parser for Hunyuan A13B Model.
HunyuanA13BReasoningParser
¶
Bases: ReasoningParser
Reasoning parser for Hunyuan A13B Model.
HunyuanReasoningParser
This class implements a reasoning parser specifically designed
for the Hunyuan A13B Model. It is responsible for parsing and
extracting structured reasoning and answer segments from model
outputs that follow a specific pattern.
Key Features:
- For non-stream output , Recognizes and extracts reasoning ("think")
and answer ("answer") sections from text using regular expressions.
- For stream process, it requires a token id sequences to change the
reasoning state and other state so it maintains internal state to
manage parsing across multiple token.
think start: "<think>
": [14023, 771, 397]
think ends: "
Methods:
-
extract_reasoning–Extract the reasoning content & content sections, respectively.
-
extract_reasoning_streaming–Extract content using token ID sequence state machine.
extract_reasoning(model_output, request)
¶
Extract the reasoning content & content sections, respectively. If the sequence doesn't match what we expect, i.e., the model generates something else, all content is considered non-reasoning content.
Parameters:
-
(model_output¶str) –Output of the model to be parsed.
-
(request¶ChatCompletionRequest) –Request being processed.
Returns:
extract_reasoning_streaming(previous_text, current_text, delta_text, previous_token_ids, current_token_ids, delta_token_ids)
¶
Extract content using token ID sequence state machine.