CoolFace
Apppublic

Codecooker/rvcapi

sourceHugging Facegpl-3.0updated 3y agoView on Hugging Face
2likes
download_models.py32 linesDownload Raw Back to src
1from pathlib import Path2import requests3 4MDX_DOWNLOAD_LINK = 'https://github.com/TRvlvr/model_repo/releases/download/all_public_uvr_models/'5RVC_DOWNLOAD_LINK = 'https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/'6 7BASE_DIR = Path(__file__).resolve().parent.parent8mdxnet_models_dir = BASE_DIR / 'mdxnet_models'9rvc_models_dir = BASE_DIR / 'rvc_models'10 11 12def dl_model(link, model_name, dir_name):13    with requests.get(f'{link}{model_name}') as r:14        r.raise_for_status()15        with open(dir_name / model_name, 'wb') as f:16            for chunk in r.iter_content(chunk_size=8192):17                f.write(chunk)18 19 20if __name__ == '__main__':21    mdx_model_names = ['UVR-MDX-NET-Voc_FT.onnx', 'UVR_MDXNET_KARA_2.onnx', 'Reverb_HQ_By_FoxJoy.onnx']22    for model in mdx_model_names:23        print(f'Downloading {model}...')24        dl_model(MDX_DOWNLOAD_LINK, model, mdxnet_models_dir)25 26    rvc_model_names = ['hubert_base.pt', 'rmvpe.pt']27    for model in rvc_model_names:28        print(f'Downloading {model}...')29        dl_model(RVC_DOWNLOAD_LINK, model, rvc_models_dir)30 31    print('All models downloaded!')32