Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
5fdd10a
1
Parent(s):
aad8361
make dirs
Browse files- tools/download_files.py +9 -3
tools/download_files.py
CHANGED
@@ -56,7 +56,7 @@ def save_response_content(response, destination, chunk_size=32768):
|
|
56 |
if chunk: # 过滤掉保持连接的空白块
|
57 |
f.write(chunk)
|
58 |
|
59 |
-
def download_model_from_modelscope(
|
60 |
"""
|
61 |
从ModelScope下载模型(伪代码,需根据实际API实现)
|
62 |
Args:
|
@@ -65,7 +65,10 @@ def download_model_from_modelscope(model_id, destination):
|
|
65 |
"""
|
66 |
print(f"[ModelScope] Downloading models to {destination},model cache dir={hf_cache_dir}")
|
67 |
from modelscope import snapshot_download
|
68 |
-
os.makedirs(
|
|
|
|
|
|
|
69 |
snapshot_download("IndexTeam/IndexTTS-2", local_dir="checkpoints")
|
70 |
snapshot_download("amphion/MaskGCT", local_dir="checkpoints/hf_cache/models--amphion--MaskGCT")
|
71 |
snapshot_download("facebook/w2v-bert-2.0",local_dir="checkpoints/hf_cache/models--facebook--w2v-bert-2.0")
|
@@ -82,7 +85,10 @@ def download_model_from_huggingface(destination,hf_cache_dir):
|
|
82 |
"""
|
83 |
print(f"[HuggingFace] Downloading models to {destination},model cache dir={hf_cache_dir}")
|
84 |
from huggingface_hub import snapshot_download
|
85 |
-
os.makedirs(hf_cache_dir, exist_ok=True)
|
|
|
|
|
|
|
86 |
snapshot_download("IndexTeam/IndexTTS-2", local_dir=destination)
|
87 |
snapshot_download("amphion/MaskGCT", local_dir=os.path.join(hf_cache_dir,"models--amphion--MaskGCT"))
|
88 |
snapshot_download("facebook/w2v-bert-2.0",local_dir=os.path.join(hf_cache_dir,"models--facebook--w2v-bert-2.0"))
|
|
|
56 |
if chunk: # 过滤掉保持连接的空白块
|
57 |
f.write(chunk)
|
58 |
|
59 |
+
def download_model_from_modelscope(destination,hf_cache_dir):
|
60 |
"""
|
61 |
从ModelScope下载模型(伪代码,需根据实际API实现)
|
62 |
Args:
|
|
|
65 |
"""
|
66 |
print(f"[ModelScope] Downloading models to {destination},model cache dir={hf_cache_dir}")
|
67 |
from modelscope import snapshot_download
|
68 |
+
os.makedirs(os.path.join(hf_cache_dir, "models--amphion--MaskGCT"), exist_ok=True)
|
69 |
+
os.makedirs(os.path.join(hf_cache_dir, "models--facebook--w2v-bert-2.0"), exist_ok=True)
|
70 |
+
os.makedirs(os.path.join(hf_cache_dir, "models--nvidia--bigvgan_v2_22khz_80band_256x"), exist_ok=True)
|
71 |
+
os.makedirs(os.path.join(hf_cache_dir, "models--funasr--campplus"), exist_ok=True)
|
72 |
snapshot_download("IndexTeam/IndexTTS-2", local_dir="checkpoints")
|
73 |
snapshot_download("amphion/MaskGCT", local_dir="checkpoints/hf_cache/models--amphion--MaskGCT")
|
74 |
snapshot_download("facebook/w2v-bert-2.0",local_dir="checkpoints/hf_cache/models--facebook--w2v-bert-2.0")
|
|
|
85 |
"""
|
86 |
print(f"[HuggingFace] Downloading models to {destination},model cache dir={hf_cache_dir}")
|
87 |
from huggingface_hub import snapshot_download
|
88 |
+
os.makedirs(os.path.join(hf_cache_dir,"models--amphion--MaskGCT"), exist_ok=True)
|
89 |
+
os.makedirs(os.path.join(hf_cache_dir,"models--facebook--w2v-bert-2.0"), exist_ok=True)
|
90 |
+
os.makedirs(os.path.join(hf_cache_dir, "models--nvidia--bigvgan_v2_22khz_80band_256x"), exist_ok=True)
|
91 |
+
os.makedirs(os.path.join(hf_cache_dir,"models--funasr--campplus"), exist_ok=True)
|
92 |
snapshot_download("IndexTeam/IndexTTS-2", local_dir=destination)
|
93 |
snapshot_download("amphion/MaskGCT", local_dir=os.path.join(hf_cache_dir,"models--amphion--MaskGCT"))
|
94 |
snapshot_download("facebook/w2v-bert-2.0",local_dir=os.path.join(hf_cache_dir,"models--facebook--w2v-bert-2.0"))
|