Text Generation
Transformers
Safetensors
PyTorch
nemotron_h
nvidia
nemotron-3
latent-moe
mtp
conversational
custom_code
Eval Results

Rescue whitespace-only content + add streaming reasoning promotion

#26
NVIDIA org

Brings this parser in line with the version that ships with the NVFP4 sibling (discussions #29 and #30 on nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4).

  1. Rescue whitespace-only final_content. When the model stops at the </think>\n boundary, the base DeepSeek R1 parser returns final_content="\n" (not None). The current rescue check only fires on final_content is None, so whitespace slips through and enable_thinking=False / force_nonempty_content=True users see a blank reply with the answer trapped in reasoning_content. The fix extends the check to whitespace-only strings.

  2. Streaming reasoning extraction with content promotion. Adds an __init__ that reads chat_template_kwargs to decide whether to promote reasoning into the content channel (enable_thinking=False or force_nonempty_content=True), and an extract_reasoning_streaming that mirrors the reasoning delta into the content channel while <think> is still open. Clients that only read the content field receive a non-null value on every delta, while clients that prefer reasoning_content still get the same data on the reasoning channel.

No behavior change for callers that don't pass these chat_template_kwargs.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment