Skip to content

[Feture] Add reasoning-parser#107

Open
jiahe7ay wants to merge 2 commits intosgl-project:mainfrom
jiahe7ay:main
Open

[Feture] Add reasoning-parser#107
jiahe7ay wants to merge 2 commits intosgl-project:mainfrom
jiahe7ay:main

Conversation

@jiahe7ay
Copy link
Contributor

This PR introduces a parser for separating reasoning content from the actual generated content. By adding the --reasoning-parser flag at startup, the system can automatically extract reasoning_content and content fields in both streaming and non-streaming modes. The argument following --reasoning-parser specifies the model type (e.g., qwen3); if left blank, the system will automatically infer the model type from hf_config. Additionally, a test script has been added to the test folder to verify that the streaming output correctly separates these two fields when the flag is enabled. Please refer to the image below for the actual effect.

Furthermore, omitting the --reasoning-parser flag will have no impact on existing functionality, ensuring that generation continues to work as expected.

image image

update reasong_parse
update args
@jiahe7ay
Copy link
Contributor Author

@DarkSharpness please review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant