candlend commited on
Commit
f23d0b3
1 Parent(s): fc4e766
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -17,8 +17,9 @@ import gradio as gr
17
  pth_path = os.path.basename(utils.latest_checkpoint_path("./", "G_*.pth"))
18
  # pth_path = "G_250000.pth"
19
  hps = utils.get_hparams_from_file("./configs/hoshimi_base.json")
20
- device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
21
- # device = torch.device("cpu")
 
22
 
23
  def get_text(text, hps):
24
  text_norm = text_to_sequence(text, hps.data.text_cleaners)
@@ -80,7 +81,7 @@ with app:
80
  choice_model = gr.Dropdown(
81
  choices=models, label="模型", value=pth_path)
82
  tts_input1 = gr.TextArea(
83
- label="请输入文本(目前只支持汉字和单个英文字母,也可以使用逗号、句号、感叹号、空格等常用符号来改变语调和停顿)",
84
  value="这里是爱喝奶茶,穿得也像奶茶魅力点是普通话二乙的星弥吼西咪,晚上齁。")
85
  tts_submit = gr.Button("合成", variant="primary")
86
  tts_output = gr.Audio(label="Output")
@@ -88,4 +89,11 @@ with app:
88
  tts_submit.click(infer, [tts_input1], [tts_output])
89
  choice_model.change(change_model, inputs=[
90
  choice_model], outputs=[tts_model])
 
 
 
 
 
 
 
91
  app.launch()
 
17
  pth_path = os.path.basename(utils.latest_checkpoint_path("./", "G_*.pth"))
18
  # pth_path = "G_250000.pth"
19
  hps = utils.get_hparams_from_file("./configs/hoshimi_base.json")
20
+ # device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
21
+ device = torch.device("cpu")
22
+ print(device)
23
 
24
  def get_text(text, hps):
25
  text_norm = text_to_sequence(text, hps.data.text_cleaners)
 
81
  choice_model = gr.Dropdown(
82
  choices=models, label="模型", value=pth_path)
83
  tts_input1 = gr.TextArea(
84
+ label="请输入文本(目前只支持汉字和单个英文字母,建议使用常用符号和空格来改变语调和停顿)",
85
  value="这里是爱喝奶茶,穿得也像奶茶魅力点是普通话二乙的星弥吼西咪,晚上齁。")
86
  tts_submit = gr.Button("合成", variant="primary")
87
  tts_output = gr.Audio(label="Output")
 
89
  tts_submit.click(infer, [tts_input1], [tts_output])
90
  choice_model.change(change_model, inputs=[
91
  choice_model], outputs=[tts_model])
92
+ gr.HTML('''
93
+ <div style="text-align:right;font-size:12px;color:#4D4D4D">
94
+ <div class="font-bold">版权声明</div>
95
+ <div>本项目数据集和模型版权属于星弥Hoshimi</div>
96
+ <div>仅供学习交流,不可用于任何商业用途和非法用途,否则后果自负</div>
97
+ </div>
98
+ ''')
99
  app.launch()