kiddothe2b commited on
Commit
52cc20b
1 Parent(s): a73e618

Update the_legal_pile_preprocessed.py

Browse files
Files changed (1) hide show
  1. the_legal_pile_preprocessed.py +8 -10
the_legal_pile_preprocessed.py CHANGED
@@ -146,14 +146,12 @@ class LegalPile(datasets.GeneratorBasedBuilder):
146
  for filepath in filepaths:
147
  logger.info("⏳ Generating examples from = %s", filepath)
148
  with xz.open(open(filepath, "rb"), "rt", encoding='utf-8') as f:
149
- header_line = True
150
  for row in f:
151
- # skip jsonl intro line
152
- if header_line:
153
- header_line = False
154
- continue
155
- data = json.loads(row)
156
- yield id_, {
157
- "text": data["text"]
158
- }
159
- id_ += 1
 
146
  for filepath in filepaths:
147
  logger.info("⏳ Generating examples from = %s", filepath)
148
  with xz.open(open(filepath, "rb"), "rt", encoding='utf-8') as f:
 
149
  for row in f:
150
+ try:
151
+ data = json.loads(row)
152
+ yield id_, {
153
+ "text": data["text"]
154
+ }
155
+ id_ += 1
156
+ except:
157
+ continue