fix(data): serialize extra_info as JSON string in verl postprocessing#603
Open
bingshao333 wants to merge 1 commit into
Open
fix(data): serialize extra_info as JSON string in verl postprocessing#603bingshao333 wants to merge 1 commit into
bingshao333 wants to merge 1 commit into
Conversation
When saving datasets to parquet via apply_verl_postprocessing, the extra_info field was stored as a Python dict. However, parquet serializes nested dicts as JSON strings. When verl's rl_dataset.py reads the parquet file, it needs to json.loads() the extra_info field to access its contents. This fix explicitly serializes extra_info using json.dumps() so that the data format is consistent and verl can correctly parse it with json.loads(). Fixes rllm-org#364
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Changes the extra_info field in verl postprocessing output from a raw dict to a JSON-serialized string.
Changes:
- Serializes
entryviajson.dumps(..., default=str)instead of passing the dict directly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "ground_truth": None, | ||
| }, | ||
| "extra_info": entry, | ||
| "extra_info": json.dumps(entry, default=str), |
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.
Fixes #364.\n\nThis PR serializes
extra_infowithjson.dumps(..., default=str)during Verl postprocessing.\n\nPreviously,extra_infowas stored as a Python dict when generating the_verl.parquetcompanion dataset. Explicitly serializing it keeps the data format consistent with Verl's expected JSON-string handling inverl.utils.dataset.rl_dataset.py.