Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
aad8361
1
Parent(s):
506ecd3
make dirs
Browse files- tools/download_files.py +2 -0
- webui.py +2 -17
tools/download_files.py
CHANGED
@@ -65,6 +65,7 @@ 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 |
snapshot_download("IndexTeam/IndexTTS-2", local_dir="checkpoints")
|
69 |
snapshot_download("amphion/MaskGCT", local_dir="checkpoints/hf_cache/models--amphion--MaskGCT")
|
70 |
snapshot_download("facebook/w2v-bert-2.0",local_dir="checkpoints/hf_cache/models--facebook--w2v-bert-2.0")
|
@@ -81,6 +82,7 @@ def download_model_from_huggingface(destination,hf_cache_dir):
|
|
81 |
"""
|
82 |
print(f"[HuggingFace] Downloading models to {destination},model cache dir={hf_cache_dir}")
|
83 |
from huggingface_hub import snapshot_download
|
|
|
84 |
snapshot_download("IndexTeam/IndexTTS-2", local_dir=destination)
|
85 |
snapshot_download("amphion/MaskGCT", local_dir=os.path.join(hf_cache_dir,"models--amphion--MaskGCT"))
|
86 |
snapshot_download("facebook/w2v-bert-2.0",local_dir=os.path.join(hf_cache_dir,"models--facebook--w2v-bert-2.0"))
|
|
|
65 |
"""
|
66 |
print(f"[ModelScope] Downloading models to {destination},model cache dir={hf_cache_dir}")
|
67 |
from modelscope import snapshot_download
|
68 |
+
os.makedirs(destination, exist_ok=True)
|
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 |
"""
|
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"))
|
webui.py
CHANGED
@@ -26,23 +26,8 @@ parser.add_argument("--is_fp16", action="store_true", default=False, help="Fp16
|
|
26 |
cmd_args = parser.parse_args()
|
27 |
|
28 |
from tools.download_files import download_model_from_huggingface
|
29 |
-
download_model_from_huggingface(
|
30 |
-
|
31 |
-
if not os.path.exists(cmd_args.model_dir):
|
32 |
-
print(f"Model directory {cmd_args.model_dir} does not exist. Please download the model first.")
|
33 |
-
sys.exit(1)
|
34 |
-
|
35 |
-
for file in [
|
36 |
-
"bpe.model",
|
37 |
-
"gpt.pth",
|
38 |
-
"config.yaml",
|
39 |
-
"s2mel.pth",
|
40 |
-
"wav2vec2bert_stats.pt"
|
41 |
-
]:
|
42 |
-
file_path = os.path.join(cmd_args.model_dir, file)
|
43 |
-
if not os.path.exists(file_path):
|
44 |
-
print(f"Required file {file_path} does not exist. Please download it.")
|
45 |
-
sys.exit(1)
|
46 |
|
47 |
import gradio as gr
|
48 |
from indextts import infer
|
|
|
26 |
cmd_args = parser.parse_args()
|
27 |
|
28 |
from tools.download_files import download_model_from_huggingface
|
29 |
+
download_model_from_huggingface(os.path.join(current_dir,"checkpoints"),
|
30 |
+
os.path.join(current_dir, "checkpoints","hf_cache"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
import gradio as gr
|
33 |
from indextts import infer
|