Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
541302b
1
Parent(s):
bc7f1e1
update gradio cached examples
Browse files- tts/gradio_api.py +3 -3
tts/gradio_api.py
CHANGED
@@ -27,7 +27,7 @@ CUDA_AVAILABLE = torch.cuda.is_available()
|
|
27 |
infer_pipe = MegaTTS3DiTInfer(device='cuda' if CUDA_AVAILABLE else 'cpu')
|
28 |
|
29 |
@spaces.GPU(duration=60)
|
30 |
-
def forward_gpu(file_content, latent_file, inp_text, time_step, p_w, t_w):
|
31 |
resource_context = infer_pipe.preprocess(file_content, latent_file)
|
32 |
wav_bytes = infer_pipe.forward(resource_context, inp_text, time_step=time_step, p_w=p_w, t_w=t_w)
|
33 |
return wav_bytes
|
@@ -50,7 +50,7 @@ def model_worker(input_queue, output_queue, device_id):
|
|
50 |
cut_wav(wav_path, max_len=24)
|
51 |
with open(wav_path, 'rb') as file:
|
52 |
file_content = file.read()
|
53 |
-
wav_bytes = forward_gpu(file_content, inp_npy_path, inp_text, time_step=infer_timestep, p_w=p_w, t_w=t_w)
|
54 |
output_queue.put(wav_bytes)
|
55 |
except Exception as e:
|
56 |
traceback.print_exc()
|
@@ -97,7 +97,7 @@ if __name__ == '__main__':
|
|
97 |
examples=[
|
98 |
['./official_test_case/范闲.wav', './official_test_case/范闲.npy', "你好呀,我是范闲,我是庆国十年来风雨画卷的见证者。", 32, 1.4, 3.0],
|
99 |
['./official_test_case/周杰伦1.wav', './official_test_case/周杰伦1.npy', "有的时候嘛,我去台湾开演唱会的时候,会很喜欢来一碗卤肉饭的。", 32, 1.4, 3.0],
|
100 |
-
['./official_test_case/
|
101 |
],
|
102 |
cache_examples=True,
|
103 |
description="Upload a speech clip as a reference for timbre, " +
|
|
|
27 |
infer_pipe = MegaTTS3DiTInfer(device='cuda' if CUDA_AVAILABLE else 'cpu')
|
28 |
|
29 |
@spaces.GPU(duration=60)
|
30 |
+
def forward_gpu(file_content, wav_path, latent_file, inp_text, time_step, p_w, t_w):
|
31 |
resource_context = infer_pipe.preprocess(file_content, latent_file)
|
32 |
wav_bytes = infer_pipe.forward(resource_context, inp_text, time_step=time_step, p_w=p_w, t_w=t_w)
|
33 |
return wav_bytes
|
|
|
50 |
cut_wav(wav_path, max_len=24)
|
51 |
with open(wav_path, 'rb') as file:
|
52 |
file_content = file.read()
|
53 |
+
wav_bytes = forward_gpu(file_content, wav_path, inp_npy_path, inp_text, time_step=infer_timestep, p_w=p_w, t_w=t_w)
|
54 |
output_queue.put(wav_bytes)
|
55 |
except Exception as e:
|
56 |
traceback.print_exc()
|
|
|
97 |
examples=[
|
98 |
['./official_test_case/范闲.wav', './official_test_case/范闲.npy', "你好呀,我是范闲,我是庆国十年来风雨画卷的见证者。", 32, 1.4, 3.0],
|
99 |
['./official_test_case/周杰伦1.wav', './official_test_case/周杰伦1.npy', "有的时候嘛,我去台湾开演唱会的时候,会很喜欢来一碗卤肉饭的。", 32, 1.4, 3.0],
|
100 |
+
['./official_test_case/english_talk_zhou.wav', './official_test_case/english_talk_zhou.npy', "Let us do some exercise and practice more.", 32, 1.4, 3.0],
|
101 |
],
|
102 |
cache_examples=True,
|
103 |
description="Upload a speech clip as a reference for timbre, " +
|