Spaces:
Sleeping
Sleeping
File size: 2,466 Bytes
4451360 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# %%
import pathlib
from utils.urls import FILES_DICT
import gdown
# %%
FILES_DICT = {
# TACOTRON
"tacotron2_ar_mse.pth": {
"path": "pretrained/tacotron2_ar_mse.pth",
"url": "https://drive.google.com/file/d/1GCu-ZAcfJuT5qfzlKItcNqtuVNa7CNy9/view?usp=sharing",
"download": True,
},
"tacotron2_ar_adv.pth": {
"path": "pretrained/tacotron2_ar_adv.pth",
"url": "https://drive.google.com/file/d/1FusCFZIXSVCQ9Q6PLb91GIkEnhn_zWRS/view?usp=sharing",
"download": True,
},
# FASTPITCH
"fastpitch_ar_mse.pth": {
"path": "pretrained/fastpitch_ar_mse.pth",
"url": "https://drive.google.com/file/d/1sliRc62wjPTnPWBVQ95NDUgnCSH5E8M0/view?usp=sharing",
"download": True,
},
"fastpitch_ar_adv.pth": {
"path": "pretrained/fastpitch_ar_adv.pth",
"url": "https://drive.google.com/file/d/1-vZOhi9To_78-yRslC6sFLJBUjwgJT-D/view?usp=sharing",
"download": True,
},
"fastpitch_ar_ms.pth": {
"path": "pretrained/fastpitch_ar_ms.pth",
"url": "https://drive.google.com/file/d/18IYUSRXvLErVjaDORj_TKzUxs90l61Ja/view?usp=sharing",
"download": True,
},
# HIFIGAN
"hifigan-asc.pth": {
"path": "pretrained/hifigan-asc-v1/hifigan-asc.pth",
"url": "https://drive.google.com/file/d/1zSYYnJFS-gQox-IeI71hVY-fdPysxuFK/view?usp=sharing",
"download": True,
},
# DIACRITIZERS
"shakkelha_rnn_3_big_20.pth": {
"path": "pretrained/diacritizers/shakkelha_rnn_3_big_20.pth",
"url": "https://drive.google.com/file/d/1CbDjbuBr-798x88vjLGtMPSB2Y1KwD68/view?usp=sharing",
"download": True,
},
"shakkala_second_model6.pth": {
"path": "pretrained/diacritizers/shakkala_second_model6.pth",
"url": "https://drive.google.com/file/d/1hgMGqXLTc58Gq_bN7WpuBWscBxX-rXXd/view?usp=sharing",
"download": True,
},
}
# %%
root_dir = pathlib.Path(__file__).parent
for file_dict in FILES_DICT.values():
file_path = root_dir.joinpath(file_dict['path'])
if not file_path.parent.exists():
file_path.parent.mkdir(parents=True, exist_ok=True)
if file_path.exists():
print(file_dict['path'], "already exists!")
elif file_dict.get('download', True):
print("Downloading ", file_dict['path'], "...")
output_filepath = gdown.download(file_dict['url'], output=file_path.as_posix(), fuzzy=True)
|