hzrr commited on
Commit
25fdb69
Β·
1 Parent(s): 4d0831c
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -45,8 +45,8 @@ def load_model(config_path, pth_path):
45
 
46
  print(f"{pth_path}加载成功!")
47
 
48
- def infer(text):
49
- c_id = 2
50
  stn_tst = get_text(text, hps)
51
  with torch.no_grad():
52
  x_tst = stn_tst.to(dev).unsqueeze(0)
@@ -87,7 +87,7 @@ with app:
87
  tts_submit = gr.Button("η”¨ζ–‡ζœ¬εˆζˆ", variant="primary")
88
  tts_output2 = gr.Audio(label="Output")
89
  # model_submit.click(load_model, [config_path, pth_path])
90
- tts_submit.click(infer, [tts_input1], [tts_output2])
91
  gr.HTML("""
92
  <div style="text-align:center">
93
  <h4 class="h-sign" style="font-size: 12px;">
 
45
 
46
  print(f"{pth_path}加载成功!")
47
 
48
+ def infer(c_id, text):
49
+
50
  stn_tst = get_text(text, hps)
51
  with torch.no_grad():
52
  x_tst = stn_tst.to(dev).unsqueeze(0)
 
87
  tts_submit = gr.Button("η”¨ζ–‡ζœ¬εˆζˆ", variant="primary")
88
  tts_output2 = gr.Audio(label="Output")
89
  # model_submit.click(load_model, [config_path, pth_path])
90
+ tts_submit.click(infer, [c_id, tts_input1], [tts_output2])
91
  gr.HTML("""
92
  <div style="text-align:center">
93
  <h4 class="h-sign" style="font-size: 12px;">