Datasets:

Tasks:
Other
Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
Dask
License:
albertvillanova HF staff commited on
Commit
f53dd7a
1 Parent(s): ed99faa

Remove tf glob and pass list of files

Browse files
Files changed (1) hide show
  1. P3.py +5 -5
P3.py CHANGED
@@ -64,7 +64,7 @@ def load_cached_task(features_dict, tfrecord):
64
  feat: _feature_config(**desc) for feat, desc in features_dict.items()
65
  }
66
 
67
- ds = tf.data.TFRecordDataset(tf.io.gfile.glob([tfrecord])) # TODO -> handle multiple shards
68
  ds = ds.map(
69
  lambda pb: tf.io.parse_single_example(pb, feature_description),
70
  num_parallel_calls=tf.data.experimental.AUTOTUNE
@@ -158,7 +158,7 @@ class P3(datasets.GeneratorBasedBuilder):
158
  datasets.SplitGenerator(
159
  name=datasets.Split.TRAIN,
160
  gen_kwargs={
161
- "tfrecord": data_dir[split_name][0],
162
  }
163
  )
164
  )
@@ -168,7 +168,7 @@ class P3(datasets.GeneratorBasedBuilder):
168
  datasets.SplitGenerator(
169
  name=datasets.Split.VALIDATION,
170
  gen_kwargs={
171
- "tfrecord": data_dir[split_name][0],
172
  }
173
  )
174
  )
@@ -178,7 +178,7 @@ class P3(datasets.GeneratorBasedBuilder):
178
  datasets.SplitGenerator(
179
  name=datasets.Split.TEST,
180
  gen_kwargs={
181
- "tfrecord": data_dir[split_name][0],
182
  }
183
  )
184
  )
@@ -189,7 +189,7 @@ class P3(datasets.GeneratorBasedBuilder):
189
  datasets.SplitGenerator(
190
  name=datasets.Split(special_split_name),
191
  gen_kwargs={
192
- "tfrecord": data_dir[special_split_name][0],
193
  }
194
  )
195
  )
 
64
  feat: _feature_config(**desc) for feat, desc in features_dict.items()
65
  }
66
 
67
+ ds = tf.data.TFRecordDataset(tfrecord)
68
  ds = ds.map(
69
  lambda pb: tf.io.parse_single_example(pb, feature_description),
70
  num_parallel_calls=tf.data.experimental.AUTOTUNE
 
158
  datasets.SplitGenerator(
159
  name=datasets.Split.TRAIN,
160
  gen_kwargs={
161
+ "tfrecord": data_dir[split_name],
162
  }
163
  )
164
  )
 
168
  datasets.SplitGenerator(
169
  name=datasets.Split.VALIDATION,
170
  gen_kwargs={
171
+ "tfrecord": data_dir[split_name],
172
  }
173
  )
174
  )
 
178
  datasets.SplitGenerator(
179
  name=datasets.Split.TEST,
180
  gen_kwargs={
181
+ "tfrecord": data_dir[split_name],
182
  }
183
  )
184
  )
 
189
  datasets.SplitGenerator(
190
  name=datasets.Split(special_split_name),
191
  gen_kwargs={
192
+ "tfrecord": data_dir[special_split_name],
193
  }
194
  )
195
  )