Plachta commited on
Commit
3f40723
1 Parent(s): ef26308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -142,6 +142,9 @@ overlap_frame_len = 16
142
  overlap_wave_len = overlap_frame_len * hop_length
143
  bitrate = "320k"
144
 
 
 
 
145
  @torch.no_grad()
146
  @torch.inference_mode()
147
  def voice_conversion(source, target, diffusion_steps, length_adjust, inference_cfg_rate, f0_condition, auto_f0_adjust, pitch_shift):
@@ -342,7 +345,7 @@ if __name__ == "__main__":
342
  inputs = [
343
  gr.Audio(type="filepath", label="Source Audio / 源音频"),
344
  gr.Audio(type="filepath", label="Reference Audio / 参考音频"),
345
- gr.Slider(minimum=1, maximum=200, value=25, step=1, label="Diffusion Steps / 扩散步数", info="10 by default, 50~100 for best quality / 默认为 10,50~100 为最佳质量"),
346
  gr.Slider(minimum=0.5, maximum=2.0, step=0.1, value=1.0, label="Length Adjust / 长度调整", info="<1.0 for speed-up speech, >1.0 for slow-down speech / <1.0 加速语速,>1.0 减慢语速"),
347
  gr.Slider(minimum=0.0, maximum=1.0, step=0.1, value=0.7, label="Inference CFG Rate", info="has subtle influence / 有微小影响"),
348
  gr.Checkbox(label="Use F0 conditioned model / 启用F0输入", value=False, info="Must set to true for singing voice conversion / 歌声转换时必须勾选"),
@@ -354,7 +357,7 @@ if __name__ == "__main__":
354
  examples = [["examples/source/yae_0.wav", "examples/reference/dingzhen_0.wav", 25, 1.0, 0.7, False, True, 0],
355
  ["examples/source/jay_0.wav", "examples/reference/azuma_0.wav", 25, 1.0, 0.7, False, True, 0],
356
  ["examples/source/Wiz Khalifa,Charlie Puth - See You Again [vocals]_[cut_28sec].wav",
357
- "examples/reference/teio_0.wav", 100, 1.0, 0.7, True, False, 0],
358
  ["examples/source/TECHNOPOLIS - 2085 [vocals]_[cut_14sec].wav",
359
  "examples/reference/trump_0.wav", 50, 1.0, 0.7, True, False, -12],
360
  ]
 
142
  overlap_wave_len = overlap_frame_len * hop_length
143
  bitrate = "320k"
144
 
145
+ import spaces
146
+
147
+ @spaces.GPU
148
  @torch.no_grad()
149
  @torch.inference_mode()
150
  def voice_conversion(source, target, diffusion_steps, length_adjust, inference_cfg_rate, f0_condition, auto_f0_adjust, pitch_shift):
 
345
  inputs = [
346
  gr.Audio(type="filepath", label="Source Audio / 源音频"),
347
  gr.Audio(type="filepath", label="Reference Audio / 参考音频"),
348
+ gr.Slider(minimum=1, maximum=200, value=25, step=1, label="Diffusion Steps / 扩散步数", info="25 by default, 50~100 for best quality / 默认为 25,50~100 为最佳质量"),
349
  gr.Slider(minimum=0.5, maximum=2.0, step=0.1, value=1.0, label="Length Adjust / 长度调整", info="<1.0 for speed-up speech, >1.0 for slow-down speech / <1.0 加速语速,>1.0 减慢语速"),
350
  gr.Slider(minimum=0.0, maximum=1.0, step=0.1, value=0.7, label="Inference CFG Rate", info="has subtle influence / 有微小影响"),
351
  gr.Checkbox(label="Use F0 conditioned model / 启用F0输入", value=False, info="Must set to true for singing voice conversion / 歌声转换时必须勾选"),
 
357
  examples = [["examples/source/yae_0.wav", "examples/reference/dingzhen_0.wav", 25, 1.0, 0.7, False, True, 0],
358
  ["examples/source/jay_0.wav", "examples/reference/azuma_0.wav", 25, 1.0, 0.7, False, True, 0],
359
  ["examples/source/Wiz Khalifa,Charlie Puth - See You Again [vocals]_[cut_28sec].wav",
360
+ "examples/reference/teio_0.wav", 50, 1.0, 0.7, True, False, 0],
361
  ["examples/source/TECHNOPOLIS - 2085 [vocals]_[cut_14sec].wav",
362
  "examples/reference/trump_0.wav", 50, 1.0, 0.7, True, False, -12],
363
  ]