Conversation
Add _make_assistant_message helper to properly handle reasoning_content from models like gpt-oss that output <|channel|> tags. The chat template expects these in a 'thinking' field rather than embedded in 'content'. This fix is backwards compatible - the 'thinking' field is only added when reasoning_content is present in the generation output. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Stephen Ge <stepheng@nvidia.com>
The gpt-oss model outputs <|channel|> tags embedded in the content field, which causes apply_chat_template to fail. The chat template expects analysis/thinking content in a separate 'thinking' field. Added _parse_gpt_oss_output() to extract: - Analysis content (between <|channel|>analysis<|message|> and <|end|>) -> goes to 'thinking' field - Final content (after <|channel|>final<|message|>) -> goes to 'content' field Updated _make_assistant_message() to automatically parse gpt-oss format when reasoning_content is not provided by the server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Stephen Ge <stepheng@nvidia.com>
📝 WalkthroughWalkthroughThe changes introduce helper methods to parse GPT-OSS formatted outputs and construct standardized assistant messages with optional reasoning content, integrating reasoning handling throughout the data-point generation flow in the prover task. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
nemo_skills/inference/prover.py (1)
209-209: Remove redundantreimport.The
remodule is already imported at line 16, so this local import is unnecessary.- import re - # Check if the content contains gpt-oss channel tags
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
nemo_skills/inference/prover.py(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: pre-commit
- GitHub Check: unit-tests
🔇 Additional comments (3)
nemo_skills/inference/prover.py (3)
236-252: LGTM!The helper method is well-structured with clear documentation and appropriate fallback behavior for parsing GPT-OSS output when reasoning_content isn't provided.
302-306: LGTM!The integration correctly captures the optional
reasoning_contentfrom the generation and passes it to the new helper method.
316-329: LGTM, with a minor note on shared reference.The refactoring correctly uses the helper method. The distinction between
prompt_turn_list(code-only whenremove_cot) andfull_prompt_turn_list(full generation with reasoning) is preserved correctly.Note: Lines 327-329 share the same
assistant_msgdict reference in both lists. This is fine given current usage (append-only), but could cause subtle issues if these dicts are mutated elsewhere.
Signed-off-by: wasiahmad <wasiahmad@ucla.edu>
Signed-off-by: Cheng-Ping Hsieh <chsieh@nvidia.com>
Signed-off-by: dgitman <dgitman@nvidia.com>
update prover to work with gpt-oss format
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.