Merge branch 'main' of https://huggingface.co/datasets/jamescalam/unsplash-image-text into main
Browse files- unsplash-image-text.py +2 -8
unsplash-image-text.py
CHANGED
|
@@ -27,13 +27,7 @@ _URL = "https://unsplash.com/data/lite/latest"
|
|
| 27 |
|
| 28 |
URL_JSON = "https://huggingface.co/datasets/jamescalam/unsplash-image-text/raw/main/url.json"
|
| 29 |
|
| 30 |
-
_IMAGE_TGZ = [
|
| 31 |
-
'images_0.tgz',
|
| 32 |
-
'images_1.tgz',
|
| 33 |
-
'images_2.tgz',
|
| 34 |
-
'images_3.tgz',
|
| 35 |
-
'images_4.tgz'
|
| 36 |
-
]
|
| 37 |
|
| 38 |
_COLS = [
|
| 39 |
'photo_id',
|
|
@@ -71,7 +65,7 @@ class Unsplash(datasets.GeneratorBasedBuilder):
|
|
| 71 |
|
| 72 |
def _split_generators(self, dl_manager):
|
| 73 |
new_url = dl_manager.download_and_extract(_URL)
|
| 74 |
-
tgz_urls = [f"{_REPO}/resolve/main/{file}" for file in _IMAGE_TGZ]
|
| 75 |
images_path = dl_manager.download_and_extract(tgz_urls)
|
| 76 |
# remove extra files
|
| 77 |
for file in os.listdir(new_url):
|
|
|
|
| 27 |
|
| 28 |
URL_JSON = "https://huggingface.co/datasets/jamescalam/unsplash-image-text/raw/main/url.json"
|
| 29 |
|
| 30 |
+
_IMAGE_TGZ = [f"images_{i}.tgz" for i in range(250)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
_COLS = [
|
| 33 |
'photo_id',
|
|
|
|
| 65 |
|
| 66 |
def _split_generators(self, dl_manager):
|
| 67 |
new_url = dl_manager.download_and_extract(_URL)
|
| 68 |
+
tgz_urls = [f"{_REPO}/resolve/main/images/{file}" for file in _IMAGE_TGZ]
|
| 69 |
images_path = dl_manager.download_and_extract(tgz_urls)
|
| 70 |
# remove extra files
|
| 71 |
for file in os.listdir(new_url):
|