Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
from TTS.api import TTS
|
2 |
import torch
|
3 |
import os
|
|
|
4 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
5 |
|
6 |
# Initialize TTS
|
7 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
|
8 |
|
9 |
# Generate and save speaker embedding
|
|
|
10 |
def save_speaker_embedding(speaker_wav, output_path):
|
11 |
embedding = tts.speaker_manager.compute_embedding_from_clip(speaker_wav)
|
12 |
torch.save(embedding, output_path)
|
|
|
1 |
from TTS.api import TTS
|
2 |
import torch
|
3 |
import os
|
4 |
+
import spaces
|
5 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
6 |
|
7 |
# Initialize TTS
|
8 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
|
9 |
|
10 |
# Generate and save speaker embedding
|
11 |
+
@spaces.GPU
|
12 |
def save_speaker_embedding(speaker_wav, output_path):
|
13 |
embedding = tts.speaker_manager.compute_embedding_from_clip(speaker_wav)
|
14 |
torch.save(embedding, output_path)
|