Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -471,13 +471,13 @@ with gr.Blocks() as ml_tts:
|
|
471 |
text.submit(multilingual, inputs=[text, voice, speed, trim, sk], outputs=[audio])
|
472 |
generate_btn.click(multilingual, inputs=[text, voice, speed, trim, sk], outputs=[audio])
|
473 |
|
474 |
-
|
475 |
def preview(text, voice, speed, trim, sk):
|
476 |
if not text.strip():
|
477 |
return None
|
478 |
assert sk == os.environ['SK'], ('❌', datetime.now(), text, voice, sk)
|
479 |
try:
|
480 |
-
audio, out_ps =
|
481 |
if len(out_ps) == 510:
|
482 |
gr.Warning('Input may have been truncated')
|
483 |
except Exception as e:
|
|
|
471 |
text.submit(multilingual, inputs=[text, voice, speed, trim, sk], outputs=[audio])
|
472 |
generate_btn.click(multilingual, inputs=[text, voice, speed, trim, sk], outputs=[audio])
|
473 |
|
474 |
+
client_x = Client('hexgrad/kokoro-src-x', hf_token=os.environ['SRC'])
|
475 |
def preview(text, voice, speed, trim, sk):
|
476 |
if not text.strip():
|
477 |
return None
|
478 |
assert sk == os.environ['SK'], ('❌', datetime.now(), text, voice, sk)
|
479 |
try:
|
480 |
+
audio, out_ps = client_x.predict(text=text, voice=voice, speed=speed, trim=trim, use_gpu=True, sk=sk, api_name='/generate')
|
481 |
if len(out_ps) == 510:
|
482 |
gr.Warning('Input may have been truncated')
|
483 |
except Exception as e:
|