Skatinger commited on
Commit
10b06db
1 Parent(s): e6fbd6e

Update wikipedia-for-mask-filling.py

Browse files
Files changed (1) hide show
  1. wikipedia-for-mask-filling.py +15 -15
wikipedia-for-mask-filling.py CHANGED
@@ -117,18 +117,18 @@ class WikipediaForMaskFilling(datasets.GeneratorBasedBuilder):
117
  print(filepath)
118
  if filepath:
119
  logger.info("Generating examples from = %s", filepath)
120
- try:
121
- with xz.open(open(filepath,'rb'), 'rt', encoding='utf-8') as f:
122
- json_list = list(f)
123
-
124
- for json_str in json_list:
125
- example = json.loads(json_str)
126
- if example is not None and isinstance(example, dict):
127
- yield id_, {
128
- "texts": data["texts"],
129
- "masks": data["masks"]
130
- }
131
- id_ +=1
132
-
133
- except Exception:
134
- logger.exception("Error while processing file %s", filepath)
 
117
  print(filepath)
118
  if filepath:
119
  logger.info("Generating examples from = %s", filepath)
120
+ try:
121
+ with xz.open(open(filepath,'rb'), 'rt', encoding='utf-8') as f:
122
+ json_list = list(f)
123
+
124
+ for json_str in json_list:
125
+ example = json.loads(json_str)
126
+ if example is not None and isinstance(example, dict):
127
+ yield id_, {
128
+ "texts": data["texts"],
129
+ "masks": data["masks"]
130
+ }
131
+ id_ +=1
132
+
133
+ except Exception:
134
+ logger.exception("Error while processing file %s", filepath)