CoolFace
Apppublic

codemo/fish-speech-1

sourceHugging Facecc-by-nc-sa-4.0updated 2y agoView on Hugging Face
0likes
download_models.py56 linesDownload Raw Back to tools
1import os2 3from huggingface_hub import hf_hub_download4 5 6# Download7def check_and_download_files(repo_id, file_list, local_dir):8    os.makedirs(local_dir, exist_ok=True)9    for file in file_list:10        file_path = os.path.join(local_dir, file)11        if not os.path.exists(file_path):12            print(f"{file} 不存在,从 Hugging Face 仓库下载...")13            hf_hub_download(14                repo_id=repo_id,15                filename=file,16                resume_download=True,17                local_dir=local_dir,18                local_dir_use_symlinks=False,19            )20        else:21            print(f"{file} 已存在,跳过下载。")22 23 24# 1st25repo_id_1 = "fishaudio/fish-speech-1.4"26local_dir_1 = "./checkpoints/fish-speech-1.4"27files_1 = [28    "model.pth",29    "README.md",30    "special_tokens_map.json",31    "tokenizer_config.json",32    "tokenizer.json",33    "config.json",34    "firefly-gan-vq-fsq-8x1024-21hz-generator.pth",35]36 37# 3rd38repo_id_3 = "fishaudio/fish-speech-1"39local_dir_3 = "./"40files_3 = [41    "ffmpeg.exe",42    "ffprobe.exe",43]44 45# 4th46repo_id_4 = "SpicyqSama007/fish-speech-packed"47local_dir_4 = "./"48files_4 = [49    "asr-label-win-x64.exe",50]51 52check_and_download_files(repo_id_1, files_1, local_dir_1)53 54check_and_download_files(repo_id_3, files_3, local_dir_3)55check_and_download_files(repo_id_4, files_4, local_dir_4)56