Download nano_v3_reasoning_parser.py from geodesic-research/control-pretraining-30b-filtered-mini-2plus-base: direct link, hf CLI and curl.
- Browser
- Download file 798 Bytes
-
https://huggingface.co/geodesic-research/control-pretraining-30b-filtered-mini-2plus-base/resolve/main/nano_v3_reasoning_parser.py
- Command line
-
hf download hf://geodesic-research/control-pretraining-30b-filtered-mini-2plus-base/nano_v3_reasoning_parser.py
-
curl -L -o nano_v3_reasoning_parser.py https://huggingface.co/geodesic-research/control-pretraining-30b-filtered-mini-2plus-base/resolve/main/nano_v3_reasoning_parser.py
798 Bytes
| from vllm.reasoning.abs_reasoning_parsers import ReasoningParserManager | |
| from vllm.reasoning.deepseek_r1_reasoning_parser import DeepSeekR1ReasoningParser | |
| class NanoV3ReasoningParser(DeepSeekR1ReasoningParser): | |
| def extract_reasoning(self, model_output, request): | |
| reasoning_content, final_content = super().extract_reasoning( | |
| model_output, request | |
| ) | |
| if ( | |
| hasattr(request, "chat_template_kwargs") | |
| and request.chat_template_kwargs | |
| and request.chat_template_kwargs.get("enable_thinking") is False | |
| and final_content is None | |
| ): | |
| reasoning_content, final_content = final_content, reasoning_content | |
| return reasoning_content, final_content |