Ailyth commited on
Commit
fdcc4cf
1 Parent(s): 7ff67bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -25,7 +25,7 @@ models = {
25
  "AdorableDarling": "./MODELS/adorabledarling.pth",
26
  "Silverleg": "./MODELS/silverhandG_4400.pth",
27
  "Tnikki6100": "./MODELS/Nikki_6100.pth",
28
- "Tnikki3400": "./MODELS/Nikki_3400.pth",
29
  "MoonLucidAloof": "./MODELS/G_2900.pth",
30
  "Rrabbitt": "./MODELS/rabbit4900.pth",
31
  "Mainlade": "./MODELS/DLM.pth",
@@ -96,8 +96,6 @@ def tts_generator(text, speaker, sdp_ratio, noise_scale, noise_scale_w, length_s
96
  except Exception as e:
97
  return "生成语音失败:" + str(e), None, None
98
 
99
- def count_chars(text):
100
- return f"已输入:{len(text)}"
101
 
102
  if __name__ == "__main__":
103
  hps = utils.get_hparams_from_file("./configs/config.json")
@@ -122,7 +120,6 @@ if __name__ == "__main__":
122
  text = gr.TextArea(label="Text", placeholder="Input Text Here",
123
  value="在不在?能不能借给我三百块钱买可乐",
124
  info="使用huggingface的免费CPU进行推理,因此速度不快,一次性不要输入超过500汉字")
125
- char_count = gr.Textbox(label="当前字数")
126
  model = gr.Radio(choices=list(models.keys()), value=list(models.keys())[0], label='音声模型')
127
  #model = gr.Dropdown(choices=models,value=models[0], label='音声模型')
128
  speaker = gr.Radio(choices=speakers, value=speakers[0], label='Speaker')
@@ -144,6 +141,7 @@ if __name__ == "__main__":
144
  inputs=[text, speaker, sdp_ratio, noise_scale, noise_scale_w, length_scale, model],
145
  outputs=[text_output, audio_output,MP3_output]
146
  )
147
-
148
- iface = gr.Interface(fn=count_chars, inputs=text, outputs=char_count, live=True)
149
- iface.launch()
 
 
25
  "AdorableDarling": "./MODELS/adorabledarling.pth",
26
  "Silverleg": "./MODELS/silverhandG_4400.pth",
27
  "Tnikki6100": "./MODELS/Nikki_6100.pth",
28
+ "Tnikki8900": "./MODELS/Nikki_8900.pth",
29
  "MoonLucidAloof": "./MODELS/G_2900.pth",
30
  "Rrabbitt": "./MODELS/rabbit4900.pth",
31
  "Mainlade": "./MODELS/DLM.pth",
 
96
  except Exception as e:
97
  return "生成语音失败:" + str(e), None, None
98
 
 
 
99
 
100
  if __name__ == "__main__":
101
  hps = utils.get_hparams_from_file("./configs/config.json")
 
120
  text = gr.TextArea(label="Text", placeholder="Input Text Here",
121
  value="在不在?能不能借给我三百块钱买可乐",
122
  info="使用huggingface的免费CPU进行推理,因此速度不快,一次性不要输入超过500汉字")
 
123
  model = gr.Radio(choices=list(models.keys()), value=list(models.keys())[0], label='音声模型')
124
  #model = gr.Dropdown(choices=models,value=models[0], label='音声模型')
125
  speaker = gr.Radio(choices=speakers, value=speakers[0], label='Speaker')
 
141
  inputs=[text, speaker, sdp_ratio, noise_scale, noise_scale_w, length_scale, model],
142
  outputs=[text_output, audio_output,MP3_output]
143
  )
144
+
145
+ app.launch(show_error=True)
146
+
147
+