Update images-targz.py
Browse files- images-targz.py +3 -3
images-targz.py
CHANGED
|
@@ -39,8 +39,8 @@ class ImagesTrial(datasets.GeneratorBasedBuilder):
|
|
| 39 |
features=datasets.Features(
|
| 40 |
# Option to use any Apache arrow feature other than "string"
|
| 41 |
{
|
| 42 |
-
"text": datasets.Value("string"),
|
| 43 |
"image": datasets.Image(),
|
|
|
|
| 44 |
# "prompt": datasets.Value("string"), (optional)
|
| 45 |
}
|
| 46 |
),
|
|
@@ -53,7 +53,7 @@ class ImagesTrial(datasets.GeneratorBasedBuilder):
|
|
| 53 |
)
|
| 54 |
|
| 55 |
def _split_generators(self, dl_manager):
|
| 56 |
-
#download manager - hf utility
|
| 57 |
path = dl_manager.download_and_extract(_URL)
|
| 58 |
image_iters = dl_manager.iter_archive(path)
|
| 59 |
|
|
@@ -73,8 +73,8 @@ class ImagesTrial(datasets.GeneratorBasedBuilder):
|
|
| 73 |
for filepath, image in images:
|
| 74 |
yield idx, {
|
| 75 |
"image": {"path":filepath, "bytes":image.read()},
|
|
|
|
| 76 |
#Option to map text
|
| 77 |
-
|
| 78 |
# "text": descriptions[idx],
|
| 79 |
}
|
| 80 |
idx +=1
|
|
|
|
| 39 |
features=datasets.Features(
|
| 40 |
# Option to use any Apache arrow feature other than "string"
|
| 41 |
{
|
|
|
|
| 42 |
"image": datasets.Image(),
|
| 43 |
+
"text": datasets.Value("string"),
|
| 44 |
# "prompt": datasets.Value("string"), (optional)
|
| 45 |
}
|
| 46 |
),
|
|
|
|
| 53 |
)
|
| 54 |
|
| 55 |
def _split_generators(self, dl_manager):
|
| 56 |
+
# download manager - hf utility
|
| 57 |
path = dl_manager.download_and_extract(_URL)
|
| 58 |
image_iters = dl_manager.iter_archive(path)
|
| 59 |
|
|
|
|
| 73 |
for filepath, image in images:
|
| 74 |
yield idx, {
|
| 75 |
"image": {"path":filepath, "bytes":image.read()},
|
| 76 |
+
|
| 77 |
#Option to map text
|
|
|
|
| 78 |
# "text": descriptions[idx],
|
| 79 |
}
|
| 80 |
idx +=1
|