Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
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')
|
|
|
|
|
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)
|