Datasets:
yasumasaonoe
commited on
Update docci.py
Browse files
docci.py
CHANGED
@@ -107,7 +107,7 @@ class DOCCI(datasets.GeneratorBasedBuilder):
|
|
107 |
with open(data["descriptions"], "r") as f:
|
108 |
examples = [json.loads(l.strip()) for l in f]
|
109 |
|
110 |
-
for ex in
|
111 |
if split == "train":
|
112 |
if not (ex["split"] == "train" and ex['example_id'].startswith("train")):
|
113 |
continue
|
@@ -134,7 +134,7 @@ class DOCCI(datasets.GeneratorBasedBuilder):
|
|
134 |
yield _ex["example_id"], _ex
|
135 |
|
136 |
def _generate_examples_docci_aar(self, data, split):
|
137 |
-
image_files = glob.glob(data[
|
138 |
|
139 |
for image_path in image_files:
|
140 |
|
|
|
107 |
with open(data["descriptions"], "r") as f:
|
108 |
examples = [json.loads(l.strip()) for l in f]
|
109 |
|
110 |
+
for ex in examples:
|
111 |
if split == "train":
|
112 |
if not (ex["split"] == "train" and ex['example_id'].startswith("train")):
|
113 |
continue
|
|
|
134 |
yield _ex["example_id"], _ex
|
135 |
|
136 |
def _generate_examples_docci_aar(self, data, split):
|
137 |
+
image_files = glob.glob(data["images"])
|
138 |
|
139 |
for image_path in image_files:
|
140 |
|