LeeNight commited on
Commit
990cf29
1 Parent(s): 2ed202e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -16,7 +16,7 @@ logging.getLogger('matplotlib').setLevel(logging.WARNING)
16
 
17
  config_path = "configs/config.json"
18
 
19
- model = Svc("logs/44k/G_114400.pth", "configs/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
20
 
21
 
22
 
@@ -26,8 +26,8 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise
26
  sampling_rate, audio = input_audio
27
  # print(audio.shape,sampling_rate)
28
  duration = audio.shape[0] / sampling_rate
29
- if duration > 90:
30
- return "请上传小于90s的音频,需要转换长音频请本地进行转换", None
31
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
32
  if len(audio.shape) > 1:
33
  audio = librosa.to_mono(audio.transpose(1, 0))
@@ -46,9 +46,9 @@ with app:
46
  with gr.Tabs():
47
  with gr.TabItem("Basic"):
48
  gr.Markdown(value="""
49
- sovits4.0 在线demo
50
 
51
- 此demo为预训练底模在线demo,使用数据:云灏 即霜 辉宇·星AI 派蒙 绫地宁宁
52
  """)
53
  spks = list(model.spk2id.keys())
54
  sid = gr.Dropdown(label="音色", choices=spks, value=spks[0])
@@ -63,7 +63,7 @@ with app:
63
  vc_output2 = gr.Audio(label="Output Audio")
64
  vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale], [vc_output1, vc_output2])
65
 
66
- app.launch()
67
 
68
 
69
 
 
16
 
17
  config_path = "configs/config.json"
18
 
19
+ model = Svc("logs/44k/G_9600.pth", "configs/config.json", cluster_model_path="logs/44k/checkpoint_best_legacy_500.pt")
20
 
21
 
22
 
 
26
  sampling_rate, audio = input_audio
27
  # print(audio.shape,sampling_rate)
28
  duration = audio.shape[0] / sampling_rate
29
+ if duration > 100:
30
+ return "请上传小于100s的音频,需要转换长音频请本地进行转换", None
31
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
32
  if len(audio.shape) > 1:
33
  audio = librosa.to_mono(audio.transpose(1, 0))
 
46
  with gr.Tabs():
47
  with gr.TabItem("Basic"):
48
  gr.Markdown(value="""
49
+ 风又音理 sovits4.0 在线demo
50
 
51
+ 此demo为瞎做的
52
  """)
53
  spks = list(model.spk2id.keys())
54
  sid = gr.Dropdown(label="音色", choices=spks, value=spks[0])
 
63
  vc_output2 = gr.Audio(label="Output Audio")
64
  vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale], [vc_output1, vc_output2])
65
 
66
+ app.launch
67
 
68
 
69