Spaces:
Running
Running
added styletts space
Browse files- app.py +20 -2
- test_tts_styletts.py +12 -0
app.py
CHANGED
@@ -100,7 +100,9 @@ AVAILABLE_MODELS = {
|
|
100 |
'innoai/Edge-TTS-Text-to-Speech': 'innoai/Edge-TTS-Text-to-Speech', # 4.29
|
101 |
|
102 |
# IMS-Toucan
|
103 |
-
|
|
|
|
|
104 |
|
105 |
# HF TTS w issues
|
106 |
'LeeSangHoon/HierSpeech_TTS': 'LeeSangHoon/HierSpeech_TTS', # irresponsive to exclamation marks # 4.29
|
@@ -251,7 +253,17 @@ HF_SPACES = {
|
|
251 |
'text_param_index': 0,
|
252 |
'return_audio_index': 0,
|
253 |
'series': 'IMS-Toucan',
|
254 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
# TTS w issues
|
257 |
# 'PolyAI/pheme': '/predict#0', #sleepy HF Space
|
@@ -375,6 +387,12 @@ OVERRIDE_INPUTS = {
|
|
375 |
6: None, #reference_audio
|
376 |
},
|
377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
|
380 |
hf_clients: Tuple[Client] = {}
|
|
|
100 |
'innoai/Edge-TTS-Text-to-Speech': 'innoai/Edge-TTS-Text-to-Speech', # 4.29
|
101 |
|
102 |
# IMS-Toucan
|
103 |
+
|
104 |
+
# StyleTTS v2
|
105 |
+
'Pendrokar/style-tts-2': 'Pendrokar/style-tts-2',
|
106 |
|
107 |
# HF TTS w issues
|
108 |
'LeeSangHoon/HierSpeech_TTS': 'LeeSangHoon/HierSpeech_TTS', # irresponsive to exclamation marks # 4.29
|
|
|
253 |
'text_param_index': 0,
|
254 |
'return_audio_index': 0,
|
255 |
'series': 'IMS-Toucan',
|
256 |
+
},
|
257 |
+
|
258 |
+
# StyleTTS v2
|
259 |
+
'Pendrokar/style-tts-2': {
|
260 |
+
'name': 'StyleTTS v2',
|
261 |
+
'function': '/synthesize',
|
262 |
+
'text_param_index': 0,
|
263 |
+
'return_audio_index': 0,
|
264 |
+
'is_zero_gpu_space': True,
|
265 |
+
'series': 'StyleTTS',
|
266 |
+
},
|
267 |
|
268 |
# TTS w issues
|
269 |
# 'PolyAI/pheme': '/predict#0', #sleepy HF Space
|
|
|
387 |
6: None, #reference_audio
|
388 |
},
|
389 |
|
390 |
+
# StyleTTS 2
|
391 |
+
'Pendrokar/style-tts-2': {
|
392 |
+
1: "f-us-1", #voice
|
393 |
+
2: 8, # lngsteps
|
394 |
+
},
|
395 |
+
|
396 |
}
|
397 |
|
398 |
hf_clients: Tuple[Client] = {}
|
test_tts_styletts.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from gradio_client import Client, file
|
3 |
+
|
4 |
+
client = Client("Pendrokar/style-tts-2", hf_token=os.getenv('HF_TOKEN'))
|
5 |
+
endpoints = client.view_api(all_endpoints=True, print_info=False, return_format='dict')
|
6 |
+
# print(endpoints)
|
7 |
+
result = client.predict(
|
8 |
+
text="Hello!!",
|
9 |
+
voice="f-us-1", # voice
|
10 |
+
lngsteps=8, # lngsteps
|
11 |
+
api_name="/synthesize" # api_name
|
12 |
+
)
|