Vegecken commited on
Commit
03b417a
·
1 Parent(s): b01ceec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -14,7 +14,7 @@ logging.getLogger('markdown_it').setLevel(logging.WARNING)
14
  logging.getLogger('urllib3').setLevel(logging.WARNING)
15
  logging.getLogger('matplotlib').setLevel(logging.WARNING)
16
 
17
- model = Svc("logs/44k/G_27200.pth", "configs/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
18
 
19
 
20
 
@@ -24,8 +24,8 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, noise_scale):
24
  sampling_rate, audio = input_audio
25
  # print(audio.shape,sampling_rate)
26
  duration = audio.shape[0] / sampling_rate
27
- if duration > 45:
28
- return "请上传小于45s的音频,需要转换长音频请本地进行转换", None
29
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
30
  if len(audio.shape) > 1:
31
  audio = librosa.to_mono(audio.transpose(1, 0))
@@ -48,13 +48,13 @@ with app:
48
  with gr.Tabs():
49
  with gr.TabItem("Basic"):
50
  gr.Markdown(value="""
51
- sovits4.0 nemo在线demo
52
 
53
 
54
  """)
55
  spks = list(model.spk2id.keys())
56
  sid = gr.Dropdown(label="音色", choices=["nemo", "1"], value="yunhao")
57
- vc_input3 = gr.Audio(label="上传音频(长度小于45秒)")
58
  vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)", value=0)
59
  cluster_ratio = gr.Number(label="聚类模型混合比例,0-1之间,默认为0不启用聚类,能提升音色相似度,但会导致咬字下降(如果使用建议0.5左右)", value=0)
60
  auto_f0 = gr.Checkbox(label="自动f0预测,配合聚类模型f0预测效果更好,会导致变调功能失效(仅限转换语音,歌声不要勾选此项会究极跑调)", value=False)
 
14
  logging.getLogger('urllib3').setLevel(logging.WARNING)
15
  logging.getLogger('matplotlib').setLevel(logging.WARNING)
16
 
17
+ model = Svc("logs/44k/model.pth", "configs/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
18
 
19
 
20
 
 
24
  sampling_rate, audio = input_audio
25
  # print(audio.shape,sampling_rate)
26
  duration = audio.shape[0] / sampling_rate
27
+ if duration > 30:
28
+ return "这只是个DEMO只能有30s的长度", None
29
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
30
  if len(audio.shape) > 1:
31
  audio = librosa.to_mono(audio.transpose(1, 0))
 
48
  with gr.Tabs():
49
  with gr.TabItem("Basic"):
50
  gr.Markdown(value="""
51
+ sovits4.0 东知了在线demo
52
 
53
 
54
  """)
55
  spks = list(model.spk2id.keys())
56
  sid = gr.Dropdown(label="音色", choices=["nemo", "1"], value="yunhao")
57
+ vc_input3 = gr.Audio(label="上传音频(长度小于30秒)")
58
  vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)", value=0)
59
  cluster_ratio = gr.Number(label="聚类模型混合比例,0-1之间,默认为0不启用聚类,能提升音色相似度,但会导致咬字下降(如果使用建议0.5左右)", value=0)
60
  auto_f0 = gr.Checkbox(label="自动f0预测,配合聚类模型f0预测效果更好,会导致变调功能失效(仅限转换语音,歌声不要勾选此项会究极跑调)", value=False)