fixing train test data abs paths
Browse files
large-sinhala-asr-dataset.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import string
|
3 |
import shutil
|
|
|
4 |
|
5 |
import datasets
|
6 |
from datasets.tasks import AutomaticSpeechRecognition
|
@@ -108,22 +109,22 @@ class LargeASR(datasets.GeneratorBasedBuilder):
|
|
108 |
for path in dl_paths:
|
109 |
shutil.copytree(path, dirname(path), dirs_exist_ok=True)
|
110 |
|
111 |
-
abs_path_to_train_data = dl_manager.download_and_extract(_TRAIN_DATA_URL)
|
112 |
-
abs_path_to_test_data = dl_manager.download_and_extract(_TEST_DATA_URL)
|
113 |
abs_path_to_clips = os.path.dirname(dl_paths[0])
|
114 |
|
115 |
return [
|
116 |
datasets.SplitGenerator(
|
117 |
name=datasets.Split.TRAIN,
|
118 |
gen_kwargs={
|
119 |
-
"filepath":
|
120 |
"path_to_clips": abs_path_to_clips,
|
121 |
},
|
122 |
),
|
123 |
datasets.SplitGenerator(
|
124 |
name=datasets.Split.TEST,
|
125 |
gen_kwargs={
|
126 |
-
"filepath":
|
127 |
"path_to_clips": abs_path_to_clips,
|
128 |
},
|
129 |
),
|
|
|
1 |
import os
|
2 |
import string
|
3 |
import shutil
|
4 |
+
import wget
|
5 |
|
6 |
import datasets
|
7 |
from datasets.tasks import AutomaticSpeechRecognition
|
|
|
109 |
for path in dl_paths:
|
110 |
shutil.copytree(path, dirname(path), dirs_exist_ok=True)
|
111 |
|
112 |
+
abs_path_to_train_data = os.path.abspath(wget.download(_TRAIN_DATA_URL)) # dl_manager.download_and_extract(_TRAIN_DATA_URL)
|
113 |
+
abs_path_to_test_data = os.path.abspath(wget.download(_TEST_DATA_URL)) # dl_manager.download_and_extract(_TEST_DATA_URL)
|
114 |
abs_path_to_clips = os.path.dirname(dl_paths[0])
|
115 |
|
116 |
return [
|
117 |
datasets.SplitGenerator(
|
118 |
name=datasets.Split.TRAIN,
|
119 |
gen_kwargs={
|
120 |
+
"filepath": abs_path_to_train_data,
|
121 |
"path_to_clips": abs_path_to_clips,
|
122 |
},
|
123 |
),
|
124 |
datasets.SplitGenerator(
|
125 |
name=datasets.Split.TEST,
|
126 |
gen_kwargs={
|
127 |
+
"filepath": abs_path_to_test_data,
|
128 |
"path_to_clips": abs_path_to_clips,
|
129 |
},
|
130 |
),
|