Update multi-model-plant-genome-corpus.py
Browse files
multi-model-plant-genome-corpus.py
CHANGED
@@ -77,10 +77,13 @@ class PlantMultiSpeciesGenomes(datasets.GeneratorBasedBuilder):
|
|
77 |
)
|
78 |
|
79 |
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
84 |
return [
|
85 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"files": genome_files, "chunk_length": self.config.chunk_length})
|
86 |
]
|
|
|
77 |
)
|
78 |
|
79 |
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
80 |
+
filepaths_txt = dl_manager.download('plant_genome_file_names.txt')
|
81 |
+
|
82 |
+
with open(filepaths_txt, 'r') as f:
|
83 |
+
filepaths = [os.path.join("plant_genomes", filepath.rstrip()) for filepath in f]
|
84 |
+
|
85 |
+
genome_files = dl_manager.download_and_extract(filepaths)
|
86 |
+
|
87 |
return [
|
88 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"files": genome_files, "chunk_length": self.config.chunk_length})
|
89 |
]
|