ZiyueJiang commited on
Commit
cefe80e
·
1 Parent(s): 541302b

update gradio cached examples

Browse files
Files changed (1) hide show
  1. tts/gradio_api.py +3 -1
tts/gradio_api.py CHANGED
@@ -38,10 +38,13 @@ def model_worker(input_queue, output_queue, device_id):
38
  inp_audio_path, inp_npy_path, inp_text, infer_timestep, p_w, t_w = task
39
 
40
  if inp_npy_path is None or inp_audio_path is None:
 
41
  raise gr.Error("Please provide .wav and .npy file")
42
  if (inp_audio_path.split('/')[-1][:-4] != inp_npy_path.split('/')[-1][:-4]):
 
43
  raise gr.Error(".npy and .wav mismatch")
44
  if len(inp_text) > 200:
 
45
  raise gr.Error("input text is too long")
46
 
47
  try:
@@ -66,7 +69,6 @@ def main(inp_audio, inp_npy, inp_text, infer_timestep, p_w, t_w, processes, inpu
66
  if res is not None:
67
  return res
68
  else:
69
- print("")
70
  return None
71
 
72
 
 
38
  inp_audio_path, inp_npy_path, inp_text, infer_timestep, p_w, t_w = task
39
 
40
  if inp_npy_path is None or inp_audio_path is None:
41
+ output_queue.put(None)
42
  raise gr.Error("Please provide .wav and .npy file")
43
  if (inp_audio_path.split('/')[-1][:-4] != inp_npy_path.split('/')[-1][:-4]):
44
+ output_queue.put(None)
45
  raise gr.Error(".npy and .wav mismatch")
46
  if len(inp_text) > 200:
47
+ output_queue.put(None)
48
  raise gr.Error("input text is too long")
49
 
50
  try:
 
69
  if res is not None:
70
  return res
71
  else:
 
72
  return None
73
 
74