hexgrad commited on
Commit
7915f44
·
verified ·
1 Parent(s): 8e1f0c1

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -422,7 +422,9 @@ 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
  try:
425
- audio = client.predict(text=text, voice=voice, speed=speed, trim=trim, use_gpu=True, sk=sk, api_name='/generate')[0]
 
 
426
  except Exception as e:
427
  print('📡', datetime.now(), text, voice, repr(e))
428
  gr.Warning('v0.22 temporarily unavailable')
@@ -456,6 +458,8 @@ with gr.Blocks() as preview_tts:
456
  📡 Telemetry: For debugging purposes, the text you enter may be printed to temporary logs, which are periodically wiped.
457
 
458
  ⚠️ Tokenizers for Chinese, Japanese, and Korean do not correctly handle English letters yet.
 
 
459
  ''', container=True)
460
  with gr.Row():
461
  sk = gr.Textbox(visible=False)
 
422
  def preview(text, voice, speed, trim, sk):
423
  assert sk == os.environ['SK'], ('❌', datetime.now(), text, voice, sk)
424
  try:
425
+ audio, out_ps = client.predict(text=text, voice=voice, speed=speed, trim=trim, use_gpu=True, sk=sk, api_name='/generate')
426
+ if len(out_ps) == 510:
427
+ gr.Warning('Input may have been truncated')
428
  except Exception as e:
429
  print('📡', datetime.now(), text, voice, repr(e))
430
  gr.Warning('v0.22 temporarily unavailable')
 
458
  📡 Telemetry: For debugging purposes, the text you enter may be printed to temporary logs, which are periodically wiped.
459
 
460
  ⚠️ Tokenizers for Chinese, Japanese, and Korean do not correctly handle English letters yet.
461
+
462
+ ⚠️ Preview v0.22 does not yet support custom pronunciation or Long Form. You can still use these features for v0.19.
463
  ''', container=True)
464
  with gr.Row():
465
  sk = gr.Textbox(visible=False)