Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,18 @@ from TTS.api import TTS
|
|
| 4 |
import tempfile
|
| 5 |
import librosa
|
| 6 |
import soundfile as sf
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Explicitly agree to Coqui TTS Terms of Service
|
| 9 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
| 10 |
|
| 11 |
# Initialize TTS model explicitly with weights_only=False
|
| 12 |
tts_model_name = "tts_models/multilingual/multi-dataset/xtts_v2"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
tts = TTS(model_name=tts_model_name, progress_bar=True, gpu=False)
|
| 14 |
|
| 15 |
def text_to_speech_clone(text, voice_sample):
|
|
|
|
| 4 |
import tempfile
|
| 5 |
import librosa
|
| 6 |
import soundfile as sf
|
| 7 |
+
from TTS.tts.configs.xtts_config import XttsConfig
|
| 8 |
+
from torch.serialization import add_safe_globals
|
| 9 |
|
| 10 |
# Explicitly agree to Coqui TTS Terms of Service
|
| 11 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
| 12 |
|
| 13 |
# Initialize TTS model explicitly with weights_only=False
|
| 14 |
tts_model_name = "tts_models/multilingual/multi-dataset/xtts_v2"
|
| 15 |
+
#tts = TTS(model_name=tts_model_name, progress_bar=True, gpu=False)
|
| 16 |
+
|
| 17 |
+
add_safe_globals([XttsConfig])
|
| 18 |
+
|
| 19 |
tts = TTS(model_name=tts_model_name, progress_bar=True, gpu=False)
|
| 20 |
|
| 21 |
def text_to_speech_clone(text, voice_sample):
|