Commit
·
a73e618
1
Parent(s):
27aa183
Update the_legal_pile_preprocessed.py
Browse files
the_legal_pile_preprocessed.py
CHANGED
|
@@ -146,7 +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 |
for row in f:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
data = json.loads(row)
|
| 151 |
yield id_, {
|
| 152 |
"text": data["text"]
|
|
|
|
| 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"]
|