Spaces:
Running
Running
MarcusSu1216
commited on
Commit
•
b29c6aa
1
Parent(s):
fc67207
Update app.py
Browse files
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/
|
18 |
|
19 |
def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, noise_scale):
|
20 |
if input_audio is None:
|
@@ -38,7 +38,7 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, noise_scale):
|
|
38 |
auto_predict_f0=auto_f0,
|
39 |
noice_scale=noise_scale
|
40 |
)
|
41 |
-
return "
|
42 |
|
43 |
|
44 |
app = gr.Blocks()
|
@@ -61,8 +61,8 @@ with app:
|
|
61 |
7、语音模型转换出的音频请勿用于商业化。
|
62 |
""")
|
63 |
spks = list(model.spk2id.keys())
|
64 |
-
sid = gr.Dropdown(label="音色", choices=["
|
65 |
-
vc_input3 = gr.Audio(label="
|
66 |
vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)", value=0)
|
67 |
cluster_ratio = gr.Number(label="聚类模型混合比例,0-1之间,默认为0不启用聚类,能提升音色相似度,但会导致咬字下降(如果使用建议0.5左右)", value=0)
|
68 |
auto_f0 = gr.Checkbox(label="自动f0预测,配合聚类模型f0预测效果更好,会导致变调功能失效(仅限转换语音,歌声不要勾选此项会究极跑调)", value=False)
|
@@ -72,4 +72,4 @@ with app:
|
|
72 |
vc_output2 = gr.Audio(label="Output Audio")
|
73 |
vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, noise_scale], [vc_output1, vc_output2])
|
74 |
|
75 |
-
app.launch()
|
|
|
14 |
logging.getLogger('urllib3').setLevel(logging.WARNING)
|
15 |
logging.getLogger('matplotlib').setLevel(logging.WARNING)
|
16 |
|
17 |
+
model = Svc("logs/44k/G_29600.pth", "configs/config.json", cluster_model_path="logs/44k/kmeans_10000.pt")
|
18 |
|
19 |
def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, noise_scale):
|
20 |
if input_audio is None:
|
|
|
38 |
auto_predict_f0=auto_f0,
|
39 |
noice_scale=noise_scale
|
40 |
)
|
41 |
+
return "转化完成", (44100, out_audio.numpy())
|
42 |
|
43 |
|
44 |
app = gr.Blocks()
|
|
|
61 |
7、语音模型转换出的音频请勿用于商业化。
|
62 |
""")
|
63 |
spks = list(model.spk2id.keys())
|
64 |
+
sid = gr.Dropdown(label="音色", choices=["ikaros"], value="ikaros")
|
65 |
+
vc_input3 = gr.Audio(label="上传音频(长度建议小于100秒)")
|
66 |
vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)", value=0)
|
67 |
cluster_ratio = gr.Number(label="聚类模型混合比例,0-1之间,默认为0不启用聚类,能提升音色相似度,但会导致咬字下降(如果使用建议0.5左右)", value=0)
|
68 |
auto_f0 = gr.Checkbox(label="自动f0预测,配合聚类模型f0预测效果更好,会导致变调功能失效(仅限转换语音,歌声不要勾选此项会究极跑调)", value=False)
|
|
|
72 |
vc_output2 = gr.Audio(label="Output Audio")
|
73 |
vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, noise_scale], [vc_output1, vc_output2])
|
74 |
|
75 |
+
app.launch()
|