hzrr commited on
Commit
a87d03d
·
1 Parent(s): 171426e
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -43,7 +43,8 @@ def load_model(config_path, pth_path):
43
 
44
  print(f"{pth_path}加载成功!")
45
 
46
- def infer(c_id, text):
 
47
  stn_tst = get_text(text, hps_ms)
48
  with torch.no_grad():
49
  x_tst = stn_tst.to(dev).unsqueeze(0)
@@ -100,7 +101,7 @@ with app:
100
  tts_submit = gr.Button("用文本合成", variant="primary")
101
  tts_output2 = gr.Audio(label="Output")
102
  # model_submit.click(load_model, [config_path, pth_path])
103
- tts_submit.click(infer, ["2", tts_input1], [tts_output2])
104
  gr.HTML("""
105
  <div style="text-align:center">
106
  仅供学习交流,不可用于商业或非法用途
 
43
 
44
  print(f"{pth_path}加载成功!")
45
 
46
+ def infer(text):
47
+ c_id = 2
48
  stn_tst = get_text(text, hps_ms)
49
  with torch.no_grad():
50
  x_tst = stn_tst.to(dev).unsqueeze(0)
 
101
  tts_submit = gr.Button("用文本合成", variant="primary")
102
  tts_output2 = gr.Audio(label="Output")
103
  # model_submit.click(load_model, [config_path, pth_path])
104
+ tts_submit.click(infer, [tts_input1], [tts_output2])
105
  gr.HTML("""
106
  <div style="text-align:center">
107
  仅供学习交流,不可用于商业或非法用途