Fix uncacheable dataset.map calls #940
Open
rotemtzaban wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Open
Fix uncacheable dataset.map calls #940rotemtzaban wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
rotemtzaban wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
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.
Description
Datasets loaded via Environment weren't using the huggingface cache, because the caching hash is consistent on locally defined functions.
Made the utility functions into module level functions
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
Low Risk
Small, localized changes to dataset preprocessing; main risk is subtle differences in
example_idgeneration or prompt message structure affecting downstream consumers.Overview
Fixes HuggingFace
Dataset.mapcaching inEnvironmentdataset formatting by moving prompt-building helpers into module-level functions (stable hashing) and reusing them when creating/prepending system prompts.Updates
_ensure_example_idto usedataset.map(..., with_indices=True, **map_kwargs)(instead ofadd_column) and threadsmap_kwargsthrough the dataset formatting pipeline so caller-provided map settings are consistently applied.Written by Cursor Bugbot for commit 1679cdf. This will update automatically on new commits. Configure here.