Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -111,6 +111,7 @@ def tokenize(ps):
|
|
111 |
|
112 |
# ๐งช indicates that voices are experimental
|
113 |
CHOICES = {
|
|
|
114 |
'๐บ๐ธ ๐บ American Female 0': 'af_0',
|
115 |
'๐บ๐ธ ๐บ Alloy ๐งช': 'af_alloy',
|
116 |
'๐บ๐ธ ๐บ Bella': 'af_bella',
|
@@ -180,7 +181,7 @@ def forward(tokens, voice, speed):
|
|
180 |
def generate(text, voice, ps=None, speed=1.0, reduce_noise=0.5, opening_cut=4000, closing_cut=2000, ease_in=3000, ease_out=1000, pad_before=5000, pad_after=5000):
|
181 |
if voice not in VOICES:
|
182 |
# Ensure stability for https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
|
183 |
-
voice = '
|
184 |
ps = ps or phonemize(text, voice)
|
185 |
tokens = tokenize(ps)
|
186 |
if not tokens:
|
@@ -486,7 +487,7 @@ client = Client('hexgrad/Kokoro-TTS')
|
|
486 |
# 3. Call the generate endpoint, which returns a pair: an audio path and a string of output phonemes
|
487 |
audio_path, out_ps = client.predict(
|
488 |
text="How could I know? It's an unanswerable question. Like asking an unborn child if they'll lead a good life. They haven't even been born.",
|
489 |
-
voice='
|
490 |
api_name='/generate'
|
491 |
)
|
492 |
|
|
|
111 |
|
112 |
# ๐งช indicates that voices are experimental
|
113 |
CHOICES = {
|
114 |
+
'๐บ๐ธ ๐บ Gladiatrix โ๏ธ': 'af_gladiatrix',
|
115 |
'๐บ๐ธ ๐บ American Female 0': 'af_0',
|
116 |
'๐บ๐ธ ๐บ Alloy ๐งช': 'af_alloy',
|
117 |
'๐บ๐ธ ๐บ Bella': 'af_bella',
|
|
|
181 |
def generate(text, voice, ps=None, speed=1.0, reduce_noise=0.5, opening_cut=4000, closing_cut=2000, ease_in=3000, ease_out=1000, pad_before=5000, pad_after=5000):
|
182 |
if voice not in VOICES:
|
183 |
# Ensure stability for https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
|
184 |
+
voice = 'af_gladiatrix'
|
185 |
ps = ps or phonemize(text, voice)
|
186 |
tokens = tokenize(ps)
|
187 |
if not tokens:
|
|
|
487 |
# 3. Call the generate endpoint, which returns a pair: an audio path and a string of output phonemes
|
488 |
audio_path, out_ps = client.predict(
|
489 |
text="How could I know? It's an unanswerable question. Like asking an unborn child if they'll lead a good life. They haven't even been born.",
|
490 |
+
voice='af_gladiatrix',
|
491 |
api_name='/generate'
|
492 |
)
|
493 |
|