Spaces:
Sleeping
Sleeping
Commit
·
bf76ebe
1
Parent(s):
862eecb
Update tts.py
Browse files
tts.py
CHANGED
@@ -17,7 +17,10 @@ def generate_speech(text, speaker_voice_map, output_file):
|
|
17 |
combined_audio = AudioSegment.empty()
|
18 |
temp_files = []
|
19 |
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
for line in text.split("\n"):
|
23 |
if not line.strip():
|
|
|
17 |
combined_audio = AudioSegment.empty()
|
18 |
temp_files = []
|
19 |
|
20 |
+
if torch.cuda.is_available():
|
21 |
+
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to("cuda")
|
22 |
+
else:
|
23 |
+
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
|
24 |
|
25 |
for line in text.split("\n"):
|
26 |
if not line.strip():
|