Spaces:
Paused
Paused
alan
commited on
Commit
·
e308dcc
1
Parent(s):
48b44f9
update kotoba-speech url
Browse files
app.py
CHANGED
|
@@ -57,10 +57,10 @@ AVAILABLE_MODELS = {
|
|
| 57 |
# 'Parler TTS': 'parler'
|
| 58 |
'MOE-VITS': 'moe-vits',
|
| 59 |
'BARK': 'bark',
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
#'BLANE-TTS': 'blane-tts',
|
| 65 |
'AMITARO-VITS': 'amitaro-vits',
|
| 66 |
'GOOGLE-TTS': 'google-tts',
|
|
@@ -130,10 +130,10 @@ def get_db():
|
|
| 130 |
|
| 131 |
def get_tts_file(text: str, model: str):
|
| 132 |
url = {
|
| 133 |
-
f"kotoba-speech-{SPK1.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/call/tts",
|
| 134 |
-
f"kotoba-speech-{SPK2.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/call/tts",
|
| 135 |
-
f"kotoba-speech-{SPK3.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/call/tts",
|
| 136 |
-
f"kotoba-speech-{SPK4.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/call/tts",
|
| 137 |
"blane-tts": "https://blane187-blane-tts.hf.space/call/get_audio_file"
|
| 138 |
}
|
| 139 |
headers = {
|
|
@@ -147,8 +147,8 @@ def get_tts_file(text: str, model: str):
|
|
| 147 |
5,
|
| 148 |
"Preset voices",
|
| 149 |
SPK1,
|
| 150 |
-
{"path": "
|
| 151 |
-
{"path": "
|
| 152 |
]
|
| 153 |
},
|
| 154 |
f"kotoba-speech-{SPK2.lower()}": {
|
|
@@ -158,8 +158,8 @@ def get_tts_file(text: str, model: str):
|
|
| 158 |
5,
|
| 159 |
"Preset voices",
|
| 160 |
SPK2,
|
| 161 |
-
{"path": "
|
| 162 |
-
{"path": "
|
| 163 |
]
|
| 164 |
},
|
| 165 |
f"kotoba-speech-{SPK3.lower()}": {
|
|
@@ -169,8 +169,8 @@ def get_tts_file(text: str, model: str):
|
|
| 169 |
5,
|
| 170 |
"Preset voices",
|
| 171 |
SPK3,
|
| 172 |
-
{"path": "
|
| 173 |
-
{"path": "
|
| 174 |
]
|
| 175 |
},
|
| 176 |
f"kotoba-speech-{SPK4.lower()}": {
|
|
@@ -180,8 +180,8 @@ def get_tts_file(text: str, model: str):
|
|
| 180 |
5,
|
| 181 |
"Preset voices",
|
| 182 |
SPK4,
|
| 183 |
-
{"path": "
|
| 184 |
-
{"path": "
|
| 185 |
]
|
| 186 |
},
|
| 187 |
"blane-tts": {
|
|
@@ -456,10 +456,10 @@ model_links = {
|
|
| 456 |
# 'metavoice': 'https://github.com/metavoiceio/metavoice-src',
|
| 457 |
'bark': 'https://suno-bark.hf.space/',
|
| 458 |
'moe-vits': 'skytnt/moe-tts',
|
| 459 |
-
f'kotoba-speech-{SPK1.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/',
|
| 460 |
-
f'kotoba-speech-{SPK2.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/',
|
| 461 |
-
f'kotoba-speech-{SPK3.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/',
|
| 462 |
-
f'kotoba-speech-{SPK4.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/',
|
| 463 |
'blane-tts': 'https://blane187-blane-tts.hf.space/',
|
| 464 |
'amitaro-vits': 'https://lycoris53-vits-tts-japanese-only-amitaro.hf.space/'
|
| 465 |
}
|
|
@@ -838,9 +838,9 @@ def synthandreturn(text, retry=0):
|
|
| 838 |
#debug
|
| 839 |
if len(results) < 2 and retry < 2:
|
| 840 |
if mdl1k not in results:
|
| 841 |
-
gr.Warning(f"{model_names[
|
| 842 |
else:
|
| 843 |
-
gr.Warning(f"{model_names[
|
| 844 |
return synthandreturn(text, retry=retry+1)
|
| 845 |
print(results)
|
| 846 |
print(list(results.keys())[0])
|
|
|
|
| 57 |
# 'Parler TTS': 'parler'
|
| 58 |
'MOE-VITS': 'moe-vits',
|
| 59 |
'BARK': 'bark',
|
| 60 |
+
f'KOTOBA-SPEECH-{SPK1.upper()}': f'kotoba-speech-{SPK1.lower()}',
|
| 61 |
+
f'KOTOBA-SPEECH-{SPK2.upper()}': f'kotoba-speech-{SPK2.lower()}',
|
| 62 |
+
f'KOTOBA-SPEECH-{SPK3.upper()}': f'kotoba-speech-{SPK3.lower()}',
|
| 63 |
+
f'KOTOBA-SPEECH-{SPK4.upper()}': f'kotoba-speech-{SPK4.lower()}',
|
| 64 |
#'BLANE-TTS': 'blane-tts',
|
| 65 |
'AMITARO-VITS': 'amitaro-vits',
|
| 66 |
'GOOGLE-TTS': 'google-tts',
|
|
|
|
| 130 |
|
| 131 |
def get_tts_file(text: str, model: str):
|
| 132 |
url = {
|
| 133 |
+
f"kotoba-speech-{SPK1.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/gradio_api/call/tts",
|
| 134 |
+
f"kotoba-speech-{SPK2.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/gradio_api/call/tts",
|
| 135 |
+
f"kotoba-speech-{SPK3.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/gradio_api/call/tts",
|
| 136 |
+
f"kotoba-speech-{SPK4.lower()}": "https://kotoba-tech-kotoba-speech.hf.space/gradio_api/call/tts",
|
| 137 |
"blane-tts": "https://blane187-blane-tts.hf.space/call/get_audio_file"
|
| 138 |
}
|
| 139 |
headers = {
|
|
|
|
| 147 |
5,
|
| 148 |
"Preset voices",
|
| 149 |
SPK1,
|
| 150 |
+
{"path": "fam/ui/voice01_A.mp3"},
|
| 151 |
+
{"path": "fam/ui/voice01_A.mp3"}
|
| 152 |
]
|
| 153 |
},
|
| 154 |
f"kotoba-speech-{SPK2.lower()}": {
|
|
|
|
| 158 |
5,
|
| 159 |
"Preset voices",
|
| 160 |
SPK2,
|
| 161 |
+
{"path": "fam/ui/voice01_A.mp3"},
|
| 162 |
+
{"path": "fam/ui/voice01_A.mp3"}
|
| 163 |
]
|
| 164 |
},
|
| 165 |
f"kotoba-speech-{SPK3.lower()}": {
|
|
|
|
| 169 |
5,
|
| 170 |
"Preset voices",
|
| 171 |
SPK3,
|
| 172 |
+
{"path": "fam/ui/voice01_A.mp3"},
|
| 173 |
+
{"path": "fam/ui/voice01_A.mp3"}
|
| 174 |
]
|
| 175 |
},
|
| 176 |
f"kotoba-speech-{SPK4.lower()}": {
|
|
|
|
| 180 |
5,
|
| 181 |
"Preset voices",
|
| 182 |
SPK4,
|
| 183 |
+
{"path": "fam/ui/voice01_A.mp3"},
|
| 184 |
+
{"path": "fam/ui/voice01_A.mp3"}
|
| 185 |
]
|
| 186 |
},
|
| 187 |
"blane-tts": {
|
|
|
|
| 456 |
# 'metavoice': 'https://github.com/metavoiceio/metavoice-src',
|
| 457 |
'bark': 'https://suno-bark.hf.space/',
|
| 458 |
'moe-vits': 'skytnt/moe-tts',
|
| 459 |
+
f'kotoba-speech-{SPK1.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/gradio_api/',
|
| 460 |
+
f'kotoba-speech-{SPK2.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/gradio_api/',
|
| 461 |
+
f'kotoba-speech-{SPK3.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/gradio_api/',
|
| 462 |
+
f'kotoba-speech-{SPK4.lower()}': 'https://kotoba-tech-kotoba-speech.hf.space/gradio_api/',
|
| 463 |
'blane-tts': 'https://blane187-blane-tts.hf.space/',
|
| 464 |
'amitaro-vits': 'https://lycoris53-vits-tts-japanese-only-amitaro.hf.space/'
|
| 465 |
}
|
|
|
|
| 838 |
#debug
|
| 839 |
if len(results) < 2 and retry < 2:
|
| 840 |
if mdl1k not in results:
|
| 841 |
+
gr.Warning(f"{model_names[mdl1]} API failed, re-sampling...")
|
| 842 |
else:
|
| 843 |
+
gr.Warning(f"{model_names[mdl2]} API failed, re-sampling...")
|
| 844 |
return synthandreturn(text, retry=retry+1)
|
| 845 |
print(results)
|
| 846 |
print(list(results.keys())[0])
|