Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
10ecb41
1
Parent(s):
107b5f6
update head of readme
Browse files- tts/gradio_api.py +5 -2
tts/gradio_api.py
CHANGED
|
@@ -20,7 +20,9 @@ import gradio as gr
|
|
| 20 |
import traceback
|
| 21 |
from tts.infer_cli import MegaTTS3DiTInfer, convert_to_wav, cut_wav
|
| 22 |
|
|
|
|
| 23 |
|
|
|
|
| 24 |
def model_worker(input_queue, output_queue, device_id):
|
| 25 |
device = None
|
| 26 |
if device_id is not None:
|
|
@@ -90,7 +92,8 @@ if __name__ == '__main__':
|
|
| 90 |
title="MegaTTS3",
|
| 91 |
description="Upload a speech clip as a reference for timbre, " +
|
| 92 |
"upload the pre-extracted latent file, "+
|
| 93 |
-
"input the target text, and receive the cloned voice."
|
| 94 |
-
|
|
|
|
| 95 |
for p in processes:
|
| 96 |
p.join()
|
|
|
|
| 20 |
import traceback
|
| 21 |
from tts.infer_cli import MegaTTS3DiTInfer, convert_to_wav, cut_wav
|
| 22 |
|
| 23 |
+
import spaces
|
| 24 |
|
| 25 |
+
@spaces.GPU
|
| 26 |
def model_worker(input_queue, output_queue, device_id):
|
| 27 |
device = None
|
| 28 |
if device_id is not None:
|
|
|
|
| 92 |
title="MegaTTS3",
|
| 93 |
description="Upload a speech clip as a reference for timbre, " +
|
| 94 |
"upload the pre-extracted latent file, "+
|
| 95 |
+
"input the target text, and receive the cloned voice. "+
|
| 96 |
+
"Tip: a generation process should be within 60s (check if your input text are too long).", concurrency_limit=1)
|
| 97 |
+
api_interface.launch(server_name='0.0.0.0', server_port=7860, debug=True)
|
| 98 |
for p in processes:
|
| 99 |
p.join()
|