Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ st.title("Text-to-Voice Conversion")
|
|
19 |
st.markdown("Convert your text to speech using advanced AI models.")
|
20 |
|
21 |
# Load models outside of function calls for efficiency
|
22 |
-
@st.cache_data
|
23 |
def load_models():
|
24 |
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
|
25 |
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
@@ -29,8 +29,7 @@ def load_models():
|
|
29 |
model, processor, vocoder = load_models()
|
30 |
|
31 |
# Load speaker embeddings
|
32 |
-
@st.cache_data
|
33 |
-
def get_speaker_embeddings():
|
34 |
speaker_embeddings = np.load("cmu_us_slt_arctic-wav-arctic_a0508.npy")
|
35 |
return torch.tensor(speaker_embeddings).unsqueeze(0)
|
36 |
|
|
|
19 |
st.markdown("Convert your text to speech using advanced AI models.")
|
20 |
|
21 |
# Load models outside of function calls for efficiency
|
22 |
+
@st.cache_data
|
23 |
def load_models():
|
24 |
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
|
25 |
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
|
|
29 |
model, processor, vocoder = load_models()
|
30 |
|
31 |
# Load speaker embeddings
|
32 |
+
@st.cache_data
|
|
|
33 |
speaker_embeddings = np.load("cmu_us_slt_arctic-wav-arctic_a0508.npy")
|
34 |
return torch.tensor(speaker_embeddings).unsqueeze(0)
|
35 |
|