Skip to content
Open
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/datasets/utils/_dill.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def save(self, obj, save_persistent_id=True):
obj = getattr(obj, "_torchdynamo_orig_callable", obj)
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)

def _batch_setitems(self, items):
def _batch_setitems(self, items, obj):
if self._legacy_no_dict_keys_sorting:
return super()._batch_setitems(items)
return super()._batch_setitems(items, obj)
# Ignore the order of keys in a dict
try:
# Faster, but fails for unorderable elements
Expand All @@ -80,7 +80,7 @@ def _batch_setitems(self, items):
from datasets.fingerprint import Hasher

items = sorted(items, key=lambda x: Hasher.hash(x[0]))
dill.Pickler._batch_setitems(self, items)
dill.Pickler._batch_setitems(self, items, obj)

def memoize(self, obj):
# Don't memoize strings since two identical strings can have different Python ids
Expand Down
Loading