Yassine
commited on
Commit
•
ab73426
1
Parent(s):
2629cd7
fix non streaming load
Browse files- commavq.py +6 -5
commavq.py
CHANGED
@@ -31,13 +31,14 @@ class CommaVQ(datasets.GeneratorBasedBuilder):
|
|
31 |
return [
|
32 |
datasets.SplitGenerator(
|
33 |
name=str(i),
|
34 |
-
gen_kwargs={"local_extracted_archive":local_extracted_archive, "files": dl_manager.iter_archive(downloaded_files[i])}
|
35 |
-
) for i
|
36 |
|
37 |
def _generate_examples(self, local_extracted_archive, files):
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
41 |
|
42 |
def _get_examples_iterable_for_split(self, split_generator):
|
43 |
for path in split_generator.gen_kwargs['files']:
|
|
|
31 |
return [
|
32 |
datasets.SplitGenerator(
|
33 |
name=str(i),
|
34 |
+
gen_kwargs={"local_extracted_archive":local_extracted_archive[i], "files": dl_manager.iter_archive(downloaded_files[i])}
|
35 |
+
) for i in range(len(downloaded_files))]
|
36 |
|
37 |
def _generate_examples(self, local_extracted_archive, files):
|
38 |
+
files = glob.glob(os.path.join(local_extracted_archive, '*.npy'))
|
39 |
+
for path in files:
|
40 |
+
file_name = os.path.basename(path)
|
41 |
+
yield file_name, {'path': path}
|
42 |
|
43 |
def _get_examples_iterable_for_split(self, split_generator):
|
44 |
for path in split_generator.gen_kwargs['files']:
|