Skip to content

Commit de384a4

Browse files
authored
Fix issue with transformers library huggingface
Transformers library in the last versions verify if datasets contains a _spec_ to check if it is available
1 parent 55c4c54 commit de384a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorflow_datasets/core/community/huggingface_wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from typing import Iterator, NamedTuple, Optional, Union
2828
from unittest import mock
2929

30+
from importlib.machinery import ModuleSpec
3031
from etils import epath
3132
from tensorflow_datasets.core import dataset_builder
3233
from tensorflow_datasets.core import dataset_info
@@ -248,7 +249,7 @@ class _MockedHFDatasets(types.ModuleType):
248249

249250
def __init__(self):
250251
super().__init__('datasets')
251-
252+
self.__spec__ = ModuleSpec('datasets', None)
252253
# pylint: disable=invalid-name
253254

254255
Version = Version

0 commit comments

Comments
 (0)