kiddothe2b
commited on
Commit
•
52cc20b
1
Parent(s):
a73e618
Update the_legal_pile_preprocessed.py
Browse files
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 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
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
|
|