Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions renderers/nemotron3.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,16 @@ def emit_text_segments(
content = self._render_content(msg.get("content"))
msg_orig_idx = orig_idx(i)

if role == "system":
if i != 0:
raise ValueError("System message must be at the beginning.")
if role == "system" and i == 0:
continue # Already handled above

elif role == "user":
elif role in ("user", "system"):
# The template renders a later system message through the
# user branch, under its own role header.
emit_special(
self._im_start, msg_orig_idx, is_sampled=False, is_content=False
)
user_segments: list[tuple[str, bool]] = [("user\n", False)]
user_segments: list[tuple[str, bool]] = [(f"{role}\n", False)]
if content:
user_segments.append((content, True))
# Reasoning-effort hint rides on the LAST user message only,
Expand Down
8 changes: 7 additions & 1 deletion tests/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,13 @@ def _call(city: str, *, id: str | None = None) -> dict:
{"role": "system", "content": "Late instruction"},
{"role": "user", "content": "B"},
],
only_renderers={"laguna-xs-2.1", "laguna-s-2.1"},
only_renderers={
"laguna-xs-2.1",
"laguna-s-2.1",
"nemotron-3",
"nemotron-3-ultra",
"nemotron-3.5",
},
),
_scenario(
"tool-declare-message",
Expand Down
Loading