Update mscoco_jsonl_full.py
Browse files- mscoco_jsonl_full.py +8 -7
mscoco_jsonl_full.py
CHANGED
@@ -42,12 +42,6 @@ class ImageCaptionsEmbeddings(datasets.GeneratorBasedBuilder):
|
|
42 |
|
43 |
urls_to_download = self.config.data_urls
|
44 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
45 |
-
|
46 |
-
split_names = {
|
47 |
-
"train": datasets.Split.TRAIN,
|
48 |
-
"dev": datasets.Split.VALIDATION,
|
49 |
-
"test": datasets.Split.TEST,
|
50 |
-
}
|
51 |
|
52 |
return [
|
53 |
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
@@ -56,7 +50,14 @@ class ImageCaptionsEmbeddings(datasets.GeneratorBasedBuilder):
|
|
56 |
})
|
57 |
]
|
58 |
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
for data_file in data_files:
|
61 |
with open(data_file, "r") as input_file:
|
62 |
for line in input_file:
|
|
|
42 |
|
43 |
urls_to_download = self.config.data_urls
|
44 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
return [
|
47 |
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
|
|
50 |
})
|
51 |
]
|
52 |
|
53 |
+
|
54 |
+
return [
|
55 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": [downloaded_files["train"]]}),
|
56 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": [downloaded_files["dev"]]}),
|
57 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": [downloaded_files["test"]]}),
|
58 |
+
]
|
59 |
+
|
60 |
+
def _generate_examples(self, filepath):
|
61 |
for data_file in data_files:
|
62 |
with open(data_file, "r") as input_file:
|
63 |
for line in input_file:
|