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

Update the_legal_pile_preprocessed.py

Browse files
Files changed (1) hide show
  1. the_legal_pile_preprocessed.py +9 -8
the_legal_pile_preprocessed.py CHANGED
@@ -147,11 +147,12 @@ class LegalPile(datasets.GeneratorBasedBuilder):
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
 
 
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
+ if row:
151
+ try:
152
+ data = json.loads(row)
153
+ yield id_, {
154
+ "text": data["text"]
155
+ }
156
+ id_ += 1
157
+ except:
158
+ continue