Spaces:
Runtime error
Runtime error
Commit
·
34ecba0
1
Parent(s):
02d10dd
update
Browse files- app_locally.py +3 -4
app_locally.py
CHANGED
@@ -19,10 +19,9 @@ def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, language):
|
|
19 |
text_hint = ''
|
20 |
|
21 |
tts_model = TTS(language=language, device=device)
|
22 |
-
speaker_id = tts_model.hps.data.spk2id
|
23 |
-
speaker_key = speaker_id.lower().replace('_', '-')
|
24 |
-
source_se = torch.load(f'checkpoints/base_speakers/ses/{speaker_key}.pth', map_location=device)
|
25 |
|
|
|
|
|
26 |
|
27 |
if use_mic == True:
|
28 |
if mic_file_path is not None:
|
@@ -152,7 +151,7 @@ with gr.Blocks(analytics_enabled=False) as demo:
|
|
152 |
value=False,
|
153 |
info="Notice: Microphone input may not work properly under traffic",
|
154 |
)
|
155 |
-
language = gr.Radio(['EN_NEWEST', 'EN', 'ES', 'FR', 'ZH', 'JP', 'KR'], label='Language', value='EN_NEWEST')
|
156 |
|
157 |
tts_button = gr.Button("Send", elem_id="send-btn", visible=True)
|
158 |
|
|
|
19 |
text_hint = ''
|
20 |
|
21 |
tts_model = TTS(language=language, device=device)
|
|
|
|
|
|
|
22 |
|
23 |
+
speaker_key = language.lower().replace('_', '-')
|
24 |
+
source_se = torch.load(f'checkpoints/base_speakers/ses/{speaker_key}.pth', map_location=device)
|
25 |
|
26 |
if use_mic == True:
|
27 |
if mic_file_path is not None:
|
|
|
151 |
value=False,
|
152 |
info="Notice: Microphone input may not work properly under traffic",
|
153 |
)
|
154 |
+
language = gr.Radio(['EN_NEWEST', 'EN-US', 'EN-BR', 'EN_INDIA', 'EN-AU', 'EN-Default', 'ES', 'FR', 'ZH', 'JP', 'KR'], label='Language', value='EN_NEWEST')
|
155 |
|
156 |
tts_button = gr.Button("Send", elem_id="send-btn", visible=True)
|
157 |
|