Update xtts.py
Browse files
xtts.py
CHANGED
@@ -39,18 +39,18 @@ def predict(text, sample=None, language="zh"):
|
|
39 |
global model
|
40 |
try:
|
41 |
if tts is None:
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
model_name="tts_models/multilingual/multi-dataset/xtts_v2"
|
47 |
logging.info(f"loading model {model_name} ...")
|
48 |
tts = TTS(
|
49 |
-
model_name,
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
progress_bar=
|
54 |
)
|
55 |
model=tts.synthesizer.tts_model
|
56 |
#hack to use cache
|
|
|
39 |
global model
|
40 |
try:
|
41 |
if tts is None:
|
42 |
+
model_dir=os.environ.get("MODEL_DIR")
|
43 |
+
model_path=model_dir
|
44 |
+
config_path=f'{model_dir}/config.json'
|
45 |
+
vocoder_config_path=f'{model_dir}/vocab.json'
|
46 |
model_name="tts_models/multilingual/multi-dataset/xtts_v2"
|
47 |
logging.info(f"loading model {model_name} ...")
|
48 |
tts = TTS(
|
49 |
+
# model_name,
|
50 |
+
model_path=model_path,
|
51 |
+
config_path=config_path,
|
52 |
+
vocoder_config_path=vocoder_config_path,
|
53 |
+
progress_bar=True
|
54 |
)
|
55 |
model=tts.synthesizer.tts_model
|
56 |
#hack to use cache
|