Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from io import StringIO
|
|
6 |
import soundfile as sf
|
7 |
|
8 |
# Load models outside of function calls for efficiency
|
9 |
-
@st.
|
10 |
def load_models():
|
11 |
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
|
12 |
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
@@ -16,7 +16,7 @@ def load_models():
|
|
16 |
model, processor, vocoder = load_models()
|
17 |
|
18 |
# Load speaker embeddings
|
19 |
-
@st.
|
20 |
def get_speaker_embeddings():
|
21 |
speaker_embeddings = np.load("cmu_us_slt_arctic-wav-arctic_a0508.npy")
|
22 |
return torch.tensor(speaker_embeddings).unsqueeze(0)
|
|
|
6 |
import soundfile as sf
|
7 |
|
8 |
# Load models outside of function calls for efficiency
|
9 |
+
@st.cache_data(allow_output_mutation=True)
|
10 |
def load_models():
|
11 |
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
|
12 |
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
|
|
16 |
model, processor, vocoder = load_models()
|
17 |
|
18 |
# Load speaker embeddings
|
19 |
+
@st.cache_data(allow_output_mutation=True)
|
20 |
def get_speaker_embeddings():
|
21 |
speaker_embeddings = np.load("cmu_us_slt_arctic-wav-arctic_a0508.npy")
|
22 |
return torch.tensor(speaker_embeddings).unsqueeze(0)
|