Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import torchaudio
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
|
| 8 |
-
MODEL_DIR = "my_model"
|
| 9 |
OUTPUT_DIR = "outputs"
|
| 10 |
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
| 11 |
|
|
@@ -15,17 +15,10 @@ from huggingface_hub import hf_hub_download
|
|
| 15 |
# ------------------------
|
| 16 |
# Download model files from Hugging Face if not present
|
| 17 |
# ------------------------
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
config_file = hf_hub_download(repo_id=MODEL_REPO, filename="config.json", cache_dir=MODEL_DIR)
|
| 23 |
-
vocab_file = hf_hub_download(repo_id=MODEL_REPO, filename="vocab.json", cache_dir=MODEL_DIR)
|
| 24 |
-
model_file = hf_hub_download(repo_id=MODEL_REPO, filename="model.pth", cache_dir=MODEL_DIR)
|
| 25 |
-
else:
|
| 26 |
-
config_file = os.path.join(MODEL_DIR, "config.json")
|
| 27 |
-
vocab_file = os.path.join(MODEL_DIR, "vocab.json")
|
| 28 |
-
model_file = os.path.join(MODEL_DIR, "model.pth")
|
| 29 |
|
| 30 |
from TTS.tts.models.xtts import Xtts
|
| 31 |
from TTS.tts.configs.xtts_config import XttsConfig
|
|
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
|
| 8 |
+
# MODEL_DIR = "my_model"
|
| 9 |
OUTPUT_DIR = "outputs"
|
| 10 |
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
| 11 |
|
|
|
|
| 15 |
# ------------------------
|
| 16 |
# Download model files from Hugging Face if not present
|
| 17 |
# ------------------------
|
| 18 |
+
MODEL_DIR = "/tmp/my_model"
|
| 19 |
+
os.makedirs(MODEL_DIR, exist_ok=True)
|
| 20 |
+
for fname in ["config.json", "vocab.json", "model.pth"]:
|
| 21 |
+
hf_hub_download("MariaKaiser/EGTTS_finetuned", filename=fname, cache_dir=MODEL_DIR)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
from TTS.tts.models.xtts import Xtts
|
| 24 |
from TTS.tts.configs.xtts_config import XttsConfig
|