Update pmc_oa.py
Browse files
pmc_oa.py
CHANGED
@@ -110,9 +110,8 @@ class PMC_OA(datasets.GeneratorBasedBuilder):
|
|
110 |
def _generate_examples(self, filepath, image_dir):
|
111 |
"""Yields examples."""
|
112 |
logger.info("generating examples from = %s", filepath)
|
113 |
-
|
114 |
-
with open(filepath
|
115 |
-
reader = jsonlines.open(f)
|
116 |
for _id, obj in enumerate(reader):
|
117 |
if self.config.name == "pmc_oa_beta":
|
118 |
relative_image_path = obj['image']
|
|
|
110 |
def _generate_examples(self, filepath, image_dir):
|
111 |
"""Yields examples."""
|
112 |
logger.info("generating examples from = %s", filepath)
|
113 |
+
|
114 |
+
with jsonlines.open(filepath) as reader:
|
|
|
115 |
for _id, obj in enumerate(reader):
|
116 |
if self.config.name == "pmc_oa_beta":
|
117 |
relative_image_path = obj['image']
|