hexgrad commited on
Commit
2dbd805
·
verified ·
1 Parent(s): 3b4357c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -340,7 +340,7 @@ a={
340
  '🇺🇸 🚺 Sarah ⭐': 'af_sarah',
341
  '🇺🇸 🚺 Alloy': 'af_alloy',
342
  '🇺🇸 🚺 Jessica 🧪': 'af_jessica',
343
- '🇺🇸 🚺 Matilda': 'af_matilda',
344
  '🇺🇸 🚺 Nova': 'af_nova',
345
  '🇺🇸 🚺 River': 'af_river',
346
  '🇺🇸 🚺 Sky': 'af_sky',
@@ -414,11 +414,13 @@ z={
414
  )
415
  def change_language(value):
416
  choices = list(PREVIEW_CHOICES[value].items())
417
- return gr.Dropdown(choices, value=choices[0][1], label='Voice', info='⭐ voices are stable, 🧪 are unstable')
 
418
 
419
  from gradio_client import Client
420
  client = Client('hexgrad/kokoro-src', hf_token=os.environ['SRC'])
421
  def preview(text, voice, speed, trim, sk):
 
422
  return client.predict(text=text, voice=voice, speed=speed, trim=trim, use_gpu=True, sk=sk, api_name='/generate')[0]
423
 
424
  with gr.Blocks() as preview_tts:
@@ -440,6 +442,12 @@ with gr.Blocks() as preview_tts:
440
  autoplay.change(toggle_autoplay, inputs=[autoplay], outputs=[audio])
441
  speed = gr.Slider(minimum=0.5, maximum=2, value=1, step=0.1, label='⚡️ Speed', info='Adjust the speaking speed')
442
  trim = gr.Slider(minimum=0, maximum=1, value=0.5, step=0.1, label='✂️ Trim', info='How much to cut from both ends')
 
 
 
 
 
 
443
  with gr.Row():
444
  sk = gr.Textbox(visible=False)
445
  text.change(lambda: os.environ['SK'], outputs=[sk])
@@ -740,7 +748,7 @@ with gr.Blocks() as changelog:
740
  🚀 Model Preview v0.22<br/>
741
  🌐 5 languages: English, Chinese, Japanese, Korean, French<br/>
742
  🗣️ 68 total voices<br/>
743
- 📁 Added data card
744
 
745
  **30 Nov 2024**<br/>
746
  ✂️ Better trimming with `librosa.effects.trim`<br/>
 
340
  '🇺🇸 🚺 Sarah ⭐': 'af_sarah',
341
  '🇺🇸 🚺 Alloy': 'af_alloy',
342
  '🇺🇸 🚺 Jessica 🧪': 'af_jessica',
343
+ '🇺🇸 🚺 Matilda 🧪': 'af_matilda',
344
  '🇺🇸 🚺 Nova': 'af_nova',
345
  '🇺🇸 🚺 River': 'af_river',
346
  '🇺🇸 🚺 Sky': 'af_sky',
 
414
  )
415
  def change_language(value):
416
  choices = list(PREVIEW_CHOICES[value].items())
417
+ info = 'Missing British voices will be restored later' if value == 'b' else '⭐ voices are stable, 🧪 are unstable'
418
+ return gr.Dropdown(choices, value=choices[0][1], label='Voice', info=info)
419
 
420
  from gradio_client import Client
421
  client = Client('hexgrad/kokoro-src', hf_token=os.environ['SRC'])
422
  def preview(text, voice, speed, trim, sk):
423
+ assert sk == os.environ['SK'], ('❌', datetime.now(), text, voice, sk)
424
  return client.predict(text=text, voice=voice, speed=speed, trim=trim, use_gpu=True, sk=sk, api_name='/generate')[0]
425
 
426
  with gr.Blocks() as preview_tts:
 
442
  autoplay.change(toggle_autoplay, inputs=[autoplay], outputs=[audio])
443
  speed = gr.Slider(minimum=0.5, maximum=2, value=1, step=0.1, label='⚡️ Speed', info='Adjust the speaking speed')
444
  trim = gr.Slider(minimum=0, maximum=1, value=0.5, step=0.1, label='✂️ Trim', info='How much to cut from both ends')
445
+ with gr.Row():
446
+ gr.Markdown('''
447
+ 🎉 New! Kokoro v0.22 now supports 5 languages. 🎉
448
+
449
+ 📡 Telemetry: For debugging purposes, the text you enter may be printed to temporary logs, which are periodically wiped.
450
+ ''')
451
  with gr.Row():
452
  sk = gr.Textbox(visible=False)
453
  text.change(lambda: os.environ['SK'], outputs=[sk])
 
748
  🚀 Model Preview v0.22<br/>
749
  🌐 5 languages: English, Chinese, Japanese, Korean, French<br/>
750
  🗣️ 68 total voices<br/>
751
+ 📁 Added data card and telemetry notice
752
 
753
  **30 Nov 2024**<br/>
754
  ✂️ Better trimming with `librosa.effects.trim`<br/>