Text Generation
Transformers
Safetensors
PyTorch
nemotron_h
nvidia
nemotron-3
latent-moe
mtp
conversational
custom_code
8-bit precision
modelopt
Chris-Alexiuk avskliar-nvidia commited on
Commit
4f0cf9d
·
1 Parent(s): 3efc779

Fix: rescue whitespace-only final_content (e.g. "\n"), not just None (#29)

Browse files

- Fix: rescue whitespace-only final_content (e.g. "\n"), not just None (0ae40c7de53db9c6e22a2062c99aa45c527d2ff5)


Co-authored-by: Andrii Skliar <avskliar-nvidia@users.noreply.huggingface.co>

Files changed (1) hide show
  1. super_v3_reasoning_parser.py +1 -1
super_v3_reasoning_parser.py CHANGED
@@ -15,7 +15,7 @@ class SuperV3ReasoningParser(DeepSeekR1ReasoningParser):
15
  request.chat_template_kwargs.get("enable_thinking") is False
16
  or request.chat_template_kwargs.get("force_nonempty_content") is True
17
  )
18
- and final_content is None
19
  ):
20
  """
21
  The original `deepseek_r1` reasoning parser this inherits from will automatically put everything in the reasoning content when it cannot parse out reasoning. This was fine for the DeepSeek R1 model that was not intended to be used without reasoning.
 
15
  request.chat_template_kwargs.get("enable_thinking") is False
16
  or request.chat_template_kwargs.get("force_nonempty_content") is True
17
  )
18
+ and (final_content is None or not final_content.strip())
19
  ):
20
  """
21
  The original `deepseek_r1` reasoning parser this inherits from will automatically put everything in the reasoning content when it cannot parse out reasoning. This was fine for the DeepSeek R1 model that was not intended to be used without reasoning.