Repository navigation
fix: tolerate null metadata values and messages - #2171
Merged
Merged
Conversation
tdene
commented
Jul 28, 2026
|
|
||
| # Merge global config chat_template_kwargs with per-request overrides in metadata (e.g. per-sample reasoning on/off) | ||
| metadata_chat_template_kwargs_str = metadata.get("chat_template_kwargs", "{}") | ||
| metadata_chat_template_kwargs_str = metadata.get("chat_template_kwargs") or "{}" |
Contributor
Author
There was a problem hiding this comment.
This prevents a crash if the metadata is literally None.
In Python, dict.get("a", "b") will return None for the dict {"a": None}.
tdene
commented
Jul 28, 2026
| extra_body = deepcopy(self.config.extra_body) | ||
|
|
||
| metadata_extra_body_str = metadata.get("extra_body", "{}") | ||
| metadata_extra_body_str = metadata.get("extra_body") or "{}" |
Contributor
Author
There was a problem hiding this comment.
This prevents a crash if the metadata is literally None.
In Python, dict.get("a", "b") will return None for the dict {"a": None}.
Contributor
Author
|
/ok to test 2d45d8b |
ananthsub
previously approved these changes
Jul 28, 2026
tdene
enabled auto-merge (squash)
July 28, 2026 20:27
tdene
force-pushed
the
tde/fix_null_metadata
branch
3 times, most recently
from
July 29, 2026 19:16
2d45d8b to
1c2c522
Compare
ananthsub
approved these changes
Jul 30, 2026
Signed-off-by: Teodor-Dumitru Ene <[email protected]>
ananthsub
force-pushed
the
tde/fix_null_metadata
branch
from
July 30, 2026 14:08
1c2c522 to
085d59f
Compare
Contributor
Author
|
/ok to test 085d59f |
OlegSudakov
pushed a commit
to OlegSudakov/Gym
that referenced
this pull request
Aug 7, 2026
Follow-up to NVIDIA-NeMo#2139 and NVIDIA-NeMo#1180 Signed-off-by: Teodor-Dumitru Ene <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2139 and #1180