Datasets:

Languages:
English
Multilinguality:
monolingual
Size Categories:
10M<n<100M
Language Creators:
found
Annotations Creators:
no-annotation
ArXiv:
License:
Peter Henderson commited on
Commit
4d9a2e7
1 Parent(s): bb14dcf

Try to make streaming compatible

Browse files
Files changed (1) hide show
  1. pile-of-law.py +1 -1
pile-of-law.py CHANGED
@@ -149,7 +149,7 @@ class PileOfLaw(datasets.GeneratorBasedBuilder):
149
  id_ = 0
150
  for filepath in filepaths:
151
  logger.info("generating examples from = %s", filepath)
152
- with xz.open(filepath, "rt", encoding="utf-8") as f:
153
  for line in f:
154
  if line:
155
  example = json.loads(line)
149
  id_ = 0
150
  for filepath in filepaths:
151
  logger.info("generating examples from = %s", filepath)
152
+ with xz.open(open(filepath, "rb"), "rt", encoding="utf-8") as f:
153
  for line in f:
154
  if line:
155
  example = json.loads(line)