hexgrad commited on
Commit
1daab5c
โ€ข
1 Parent(s): 8974c6a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 = 'af_0'
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='af_0',
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