Zhangir Azerbayev commited on
Commit
d06970b
·
1 Parent(s): f3afa17

gotta be it now

Browse files
Files changed (1) hide show
  1. proof-pile.py +17 -8
proof-pile.py CHANGED
@@ -189,13 +189,22 @@ class ProofPile(datasets.GeneratorBasedBuilder):
189
  # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
190
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
191
  key = 0
192
- for name in data_files:
193
- with open(name, encoding="utf-8") as f:
194
- text = f.read()
195
- # Yields examples as (key, example) tuples
196
- yield key, {
197
- "config": self.config.name,
198
- "file": name,
199
- "text": text,
 
 
 
 
 
 
 
 
 
200
  }
201
  key += 1
 
189
  # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
190
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
191
  key = 0
192
+ if self.config.name in self.archived_configs:
193
+ for name, obj in data_files:
194
+ text = obj.read()
195
+ # Yields examples as (key, example) tuples
196
+ yield key, {
197
+ "config": self.config.name,
198
+ "file": name,
199
+ "text": text,
200
+ else:
201
+ for name in data_files:
202
+ with open(name, encoding="utf-8") as f:
203
+ text = f.read()
204
+ # Yields examples as (key, example) tuples
205
+ yield key, {
206
+ "config": self.config.name,
207
+ "file": name,
208
+ "text": text,
209
  }
210
  key += 1