Skip to content

Commit f62f596

Browse files
fineguyThe TensorFlow Datasets Authors
authored andcommitted
Support datasets >= 3.0.0
PiperOrigin-RevId: 673748627
1 parent c1b13d1 commit f62f596

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

tensorflow_datasets/core/dataset_builders/huggingface_dataset_builder_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ def _generate_examples(self):
4747
'image': PIL_Image.new(mode='L', size=(4, 4)),
4848
}
4949

50-
def download_and_prepare(self, *args, **kwargs):
51-
# Disable downloads from GCS
52-
kwargs['try_from_hf_gcs'] = False
53-
super().download_and_prepare(*args, **kwargs)
54-
5550

5651
@pytest.fixture(name='load_dataset_builder')
5752
def mock_load_dataset_builder(tmp_path):

tensorflow_datasets/core/utils/huggingface_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from tensorflow_datasets.core import registered
2626
from tensorflow_datasets.core.utils import conversion_utils
2727
from tensorflow_datasets.core.utils.lazy_imports_utils import datasets as hf_datasets
28+
from tensorflow_datasets.core.utils.lazy_imports_utils import huggingface_hub
2829
from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow as tf
2930

3031

@@ -133,7 +134,7 @@ def to_huggingface_name(tfds_dataset_name: str) -> str:
133134
DatasetNotFoundError: If the TFDS dataset name doesn't correspond to any
134135
existing Huggingface dataset.
135136
"""
136-
for hf_dataset_name in hf_datasets.list_datasets():
137+
for hf_dataset_name in huggingface_hub.list_datasets():
137138
if (
138139
conversion_utils.to_tfds_name(hf_dataset_name)
139140
== tfds_dataset_name.lower()

tensorflow_datasets/core/utils/huggingface_utils_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515

1616
import datasets as hf_datasets
17+
import huggingface_hub
1718
import numpy as np
1819
import pytest
1920
from tensorflow_datasets.core import features as feature_lib
@@ -114,7 +115,7 @@ def _list_datasets(monkeypatch):
114115
def mock_list_datasets():
115116
return ['mnist', 'bigscience/P3', 'x', 'x/Y-z', 'fashion_mnist']
116117

117-
monkeypatch.setattr(hf_datasets, 'list_datasets', mock_list_datasets)
118+
monkeypatch.setattr(huggingface_hub, 'list_datasets', mock_list_datasets)
118119

119120

120121
def test_to_huggingface_name_raises(mock_list_datasets):

0 commit comments

Comments
 (0)