Skip to content
Merged
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
5 changes: 1 addition & 4 deletions src/datasets/utils/py_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,8 @@ def dump(obj, file):
@contextlib.contextmanager
def _no_cache_fields(obj):
try:
import transformers as tr

if (
hasattr(tr, "PreTrainedTokenizerBase")
and isinstance(obj, tr.PreTrainedTokenizerBase)
"PreTrainedTokenizerBase" in [base_class.__name__ for base_class in type(obj).__mro__]
and hasattr(obj, "cache")
and isinstance(obj.cache, dict)
):
Expand Down