Datasets:

Languages:
English
ArXiv:
Tags:
math
Jyantkumar commited on
Commit
fa712a8
1 Parent(s): 901a927

Update proof-pile-2.py

Browse files
Files changed (1) hide show
  1. proof-pile-2.py +9 -0
proof-pile-2.py CHANGED
@@ -197,3 +197,12 @@ class ProofPile2(datasets.GeneratorBasedBuilder):
197
  instance["meta"] = dict()
198
  yield key, {"text": instance["text"], "meta": json.dumps(instance["meta"])}
199
  key += 1
 
 
 
 
 
 
 
 
 
 
197
  instance["meta"] = dict()
198
  yield key, {"text": instance["text"], "meta": json.dumps(instance["meta"])}
199
  key += 1
200
+ except:
201
+ with open(name, "r", encoding="utf-8") as f:
202
+ for x in f.readlines():
203
+ instance = json.loads(x)
204
+ if instance:
205
+ if "meta" not in instance:
206
+ instance["meta"] = dict()
207
+ yield key, {"text": instance["text"], "meta": json.dumps(instance["meta"])}
208
+ key += 1