init
Browse files- download_audio.py +4 -2
download_audio.py
CHANGED
@@ -73,11 +73,13 @@ def process_dataset(url_metadata):
|
|
73 |
df_metadata = get_metadata(url_metadata)
|
74 |
print(f"load metadata: {url_metadata}, ({len(df_metadata)} rows)")
|
75 |
inputs = [(r, f"{r['direction']}.{r['side']}.{os.path.basename(r['url'])}") for _, r in df_metadata.iterrows()]
|
|
|
|
|
76 |
with Pool(n_pool) as pool:
|
77 |
-
pool.starmap(get_audio, tqdm(inputs, total=len(
|
78 |
|
79 |
|
80 |
if __name__ == '__main__':
|
81 |
process_dataset(url_metadata_s2s)
|
82 |
-
process_dataset(url_metadata_s2t)
|
83 |
|
|
|
73 |
df_metadata = get_metadata(url_metadata)
|
74 |
print(f"load metadata: {url_metadata}, ({len(df_metadata)} rows)")
|
75 |
inputs = [(r, f"{r['direction']}.{r['side']}.{os.path.basename(r['url'])}") for _, r in df_metadata.iterrows()]
|
76 |
+
inputs = [x for x in inputs if not os.path.exists(p_join(cache_dir_root, "audio", x[1]))]
|
77 |
+
print(f"{len(inputs)} urls to download")
|
78 |
with Pool(n_pool) as pool:
|
79 |
+
pool.starmap(get_audio, tqdm(inputs, total=len(inputs)))
|
80 |
|
81 |
|
82 |
if __name__ == '__main__':
|
83 |
process_dataset(url_metadata_s2s)
|
84 |
+
# process_dataset(url_metadata_s2t)
|
85 |
|