Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -69,8 +69,8 @@ for repo_id in repo_ids:
|
|
69 |
generator_path = hf_hub_download(repo_id, ckpt_name)
|
70 |
config_path = hf_hub_download(repo_id, "config.json")
|
71 |
hparams = HParams(**json.loads(Path(config_path).read_text()))
|
72 |
-
|
73 |
-
speakers.extend(
|
74 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
75 |
model = Svc(net_g_path=generator_path, config_path=config_path, device=device, cluster_model_path=cluster_model_path)
|
76 |
models.append(model)
|
@@ -225,7 +225,7 @@ article = """
|
|
225 |
interface_mic = gr.Interface(
|
226 |
predict,
|
227 |
inputs=[
|
228 |
-
gr.Dropdown(
|
229 |
gr.Audio(type="filepath", source="microphone", label="请用麦克风上传您想转换的歌曲"),
|
230 |
gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
|
231 |
gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
|
@@ -246,7 +246,7 @@ interface_mic = gr.Interface(
|
|
246 |
interface_file = gr.Interface(
|
247 |
predict,
|
248 |
inputs=[
|
249 |
-
gr.Dropdown(speakers, value=speakers[0], label="🎤AI
|
250 |
gr.Audio(type="filepath", source="upload", label="请上传您想转换的歌曲 (仅人声部分)"),
|
251 |
gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
|
252 |
gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
|
@@ -268,11 +268,11 @@ interface_yt = gr.Interface(
|
|
268 |
predict_song_from_yt,
|
269 |
inputs=[
|
270 |
gr.Textbox(
|
271 |
-
label="Bilibili网址", info="请填写含有您喜欢歌曲的Bilibili网址,可直接填写相应的BV号"
|
272 |
),
|
273 |
gr.Number(value=0, label="起始时间 (秒)"),
|
274 |
gr.Number(value=15, label="结束时间 (秒)"),
|
275 |
-
gr.Dropdown(speakers, value=speakers[
|
276 |
gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
|
277 |
gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
|
278 |
gr.Slider(0.0, 1.0, value=default_cluster_infer_ratio, step=0.1, label="聚类模型混合比例", info="0-1之间,0即不启用聚类。使用聚类模型能提升音色相似度,但会导致咬字下降"),
|
|
|
69 |
generator_path = hf_hub_download(repo_id, ckpt_name)
|
70 |
config_path = hf_hub_download(repo_id, "config.json")
|
71 |
hparams = HParams(**json.loads(Path(config_path).read_text()))
|
72 |
+
speaker = list(hparams.spk.keys())
|
73 |
+
speakers.extend(speaker)
|
74 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
75 |
model = Svc(net_g_path=generator_path, config_path=config_path, device=device, cluster_model_path=cluster_model_path)
|
76 |
models.append(model)
|
|
|
225 |
interface_mic = gr.Interface(
|
226 |
predict,
|
227 |
inputs=[
|
228 |
+
gr.Dropdown(speakers, value=speakers[0], label="🎤AI歌手选择🎶"),
|
229 |
gr.Audio(type="filepath", source="microphone", label="请用麦克风上传您想转换的歌曲"),
|
230 |
gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
|
231 |
gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
|
|
|
246 |
interface_file = gr.Interface(
|
247 |
predict,
|
248 |
inputs=[
|
249 |
+
gr.Dropdown(speakers, value=speakers[0], label="🎤AI歌手选择🎶"),
|
250 |
gr.Audio(type="filepath", source="upload", label="请上传您想转换的歌曲 (仅人声部分)"),
|
251 |
gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
|
252 |
gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
|
|
|
268 |
predict_song_from_yt,
|
269 |
inputs=[
|
270 |
gr.Textbox(
|
271 |
+
label="Bilibili网址", info="请填写含有您喜欢歌曲的Bilibili网址,可直接填写相应的BV号"
|
272 |
),
|
273 |
gr.Number(value=0, label="起始时间 (秒)"),
|
274 |
gr.Number(value=15, label="结束时间 (秒)"),
|
275 |
+
gr.Dropdown(speakers, value=speakers[0], label="🎤AI歌手选择🎶"),
|
276 |
gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
|
277 |
gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
|
278 |
gr.Slider(0.0, 1.0, value=default_cluster_infer_ratio, step=0.1, label="聚类模型混合比例", info="0-1之间,0即不启用聚类。使用聚类模型能提升音色相似度,但会导致咬字下降"),
|