Rename infer-web.py to app.py
Browse files- infer-web.py → app.py +28 -207
infer-web.py → app.py
RENAMED
|
@@ -831,6 +831,21 @@ with gr.Blocks(title="RVC WebUI") as app:
|
|
| 831 |
visible=False,
|
| 832 |
interactive=True,
|
| 833 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 834 |
clean_button.click(
|
| 835 |
fn=clean, inputs=[], outputs=[sid0], api_name="infer_clean"
|
| 836 |
)
|
|
@@ -838,10 +853,6 @@ with gr.Blocks(title="RVC WebUI") as app:
|
|
| 838 |
with gr.Group():
|
| 839 |
with gr.Row():
|
| 840 |
with gr.Column():
|
| 841 |
-
vc_transform0 = gr.Number(
|
| 842 |
-
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"),
|
| 843 |
-
value=0,
|
| 844 |
-
)
|
| 845 |
input_audio0 = gr.Textbox(
|
| 846 |
label=i18n(
|
| 847 |
"输入待处理音频文件路径(默认是正确格式示例)"
|
|
@@ -860,18 +871,7 @@ with gr.Blocks(title="RVC WebUI") as app:
|
|
| 860 |
choices=sorted(index_paths),
|
| 861 |
interactive=True,
|
| 862 |
)
|
| 863 |
-
|
| 864 |
-
label=i18n(
|
| 865 |
-
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU"
|
| 866 |
-
),
|
| 867 |
-
choices=(
|
| 868 |
-
["pm", "harvest", "crepe", "rmvpe"]
|
| 869 |
-
if config.dml == False
|
| 870 |
-
else ["pm", "harvest", "rmvpe"]
|
| 871 |
-
),
|
| 872 |
-
value="rmvpe",
|
| 873 |
-
interactive=True,
|
| 874 |
-
)
|
| 875 |
|
| 876 |
with gr.Column():
|
| 877 |
resample_sr0 = gr.Slider(
|
|
@@ -941,6 +941,7 @@ with gr.Blocks(title="RVC WebUI") as app:
|
|
| 941 |
but0 = gr.Button(i18n("转换"), variant="primary")
|
| 942 |
with gr.Row():
|
| 943 |
vc_output1 = gr.Textbox(label=i18n("输出信息"))
|
|
|
|
| 944 |
vc_output2 = gr.Audio(
|
| 945 |
label=i18n("输出音频(右下角三个点,点了可以下载)")
|
| 946 |
)
|
|
@@ -1421,199 +1422,19 @@ with gr.Blocks(title="RVC WebUI") as app:
|
|
| 1421 |
api_name="train_start_all",
|
| 1422 |
)
|
| 1423 |
|
| 1424 |
-
|
| 1425 |
-
with gr.Group():
|
| 1426 |
-
gr.Markdown(value=i18n("模型融合, 可用于测试音色融合"))
|
| 1427 |
-
with gr.Row():
|
| 1428 |
-
ckpt_a = gr.Textbox(
|
| 1429 |
-
label=i18n("A模型路径"), value="", interactive=True
|
| 1430 |
-
)
|
| 1431 |
-
ckpt_b = gr.Textbox(
|
| 1432 |
-
label=i18n("B模型路径"), value="", interactive=True
|
| 1433 |
-
)
|
| 1434 |
-
alpha_a = gr.Slider(
|
| 1435 |
-
minimum=0,
|
| 1436 |
-
maximum=1,
|
| 1437 |
-
label=i18n("A模型权重"),
|
| 1438 |
-
value=0.5,
|
| 1439 |
-
interactive=True,
|
| 1440 |
-
)
|
| 1441 |
-
with gr.Row():
|
| 1442 |
-
sr_ = gr.Radio(
|
| 1443 |
-
label=i18n("目标采样率"),
|
| 1444 |
-
choices=["40k", "48k"],
|
| 1445 |
-
value="40k",
|
| 1446 |
-
interactive=True,
|
| 1447 |
-
)
|
| 1448 |
-
if_f0_ = gr.Radio(
|
| 1449 |
-
label=i18n("模型是否带音高指导"),
|
| 1450 |
-
choices=[i18n("是"), i18n("否")],
|
| 1451 |
-
value=i18n("是"),
|
| 1452 |
-
interactive=True,
|
| 1453 |
-
)
|
| 1454 |
-
info__ = gr.Textbox(
|
| 1455 |
-
label=i18n("要置入的模型信息"),
|
| 1456 |
-
value="",
|
| 1457 |
-
max_lines=8,
|
| 1458 |
-
interactive=True,
|
| 1459 |
-
)
|
| 1460 |
-
name_to_save0 = gr.Textbox(
|
| 1461 |
-
label=i18n("保存的模型名不带后缀"),
|
| 1462 |
-
value="",
|
| 1463 |
-
max_lines=1,
|
| 1464 |
-
interactive=True,
|
| 1465 |
-
)
|
| 1466 |
-
version_2 = gr.Radio(
|
| 1467 |
-
label=i18n("模型版本型号"),
|
| 1468 |
-
choices=["v1", "v2"],
|
| 1469 |
-
value="v1",
|
| 1470 |
-
interactive=True,
|
| 1471 |
-
)
|
| 1472 |
-
with gr.Row():
|
| 1473 |
-
but6 = gr.Button(i18n("融合"), variant="primary")
|
| 1474 |
-
info4 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8)
|
| 1475 |
-
but6.click(
|
| 1476 |
-
merge,
|
| 1477 |
-
[
|
| 1478 |
-
ckpt_a,
|
| 1479 |
-
ckpt_b,
|
| 1480 |
-
alpha_a,
|
| 1481 |
-
sr_,
|
| 1482 |
-
if_f0_,
|
| 1483 |
-
info__,
|
| 1484 |
-
name_to_save0,
|
| 1485 |
-
version_2,
|
| 1486 |
-
],
|
| 1487 |
-
info4,
|
| 1488 |
-
api_name="ckpt_merge",
|
| 1489 |
-
) # def merge(path1,path2,alpha1,sr,f0,info):
|
| 1490 |
-
with gr.Group():
|
| 1491 |
-
gr.Markdown(
|
| 1492 |
-
value=i18n("修改模型信息(仅支持weights文件夹下提取的小模型文件)")
|
| 1493 |
-
)
|
| 1494 |
-
with gr.Row():
|
| 1495 |
-
ckpt_path0 = gr.Textbox(
|
| 1496 |
-
label=i18n("模型路径"), value="", interactive=True
|
| 1497 |
-
)
|
| 1498 |
-
info_ = gr.Textbox(
|
| 1499 |
-
label=i18n("要改的模型信息"),
|
| 1500 |
-
value="",
|
| 1501 |
-
max_lines=8,
|
| 1502 |
-
interactive=True,
|
| 1503 |
-
)
|
| 1504 |
-
name_to_save1 = gr.Textbox(
|
| 1505 |
-
label=i18n("保存的文件名, 默认空为和源文件同名"),
|
| 1506 |
-
value="",
|
| 1507 |
-
max_lines=8,
|
| 1508 |
-
interactive=True,
|
| 1509 |
-
)
|
| 1510 |
-
with gr.Row():
|
| 1511 |
-
but7 = gr.Button(i18n("修改"), variant="primary")
|
| 1512 |
-
info5 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8)
|
| 1513 |
-
but7.click(
|
| 1514 |
-
change_info,
|
| 1515 |
-
[ckpt_path0, info_, name_to_save1],
|
| 1516 |
-
info5,
|
| 1517 |
-
api_name="ckpt_modify",
|
| 1518 |
-
)
|
| 1519 |
-
with gr.Group():
|
| 1520 |
-
gr.Markdown(
|
| 1521 |
-
value=i18n("查看模型信息(仅支持weights文件夹下提取的小模型文件)")
|
| 1522 |
-
)
|
| 1523 |
-
with gr.Row():
|
| 1524 |
-
ckpt_path1 = gr.Textbox(
|
| 1525 |
-
label=i18n("模型路径"), value="", interactive=True
|
| 1526 |
-
)
|
| 1527 |
-
but8 = gr.Button(i18n("查看"), variant="primary")
|
| 1528 |
-
info6 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8)
|
| 1529 |
-
but8.click(show_info, [ckpt_path1], info6, api_name="ckpt_show")
|
| 1530 |
-
with gr.Group():
|
| 1531 |
-
gr.Markdown(
|
| 1532 |
-
value=i18n(
|
| 1533 |
-
"模型提取(输入logs文件夹下大文件模型路径),适用于训一半不想训了模型没有自动提取保存小文件模型,或者想测试中间模型的情况"
|
| 1534 |
-
)
|
| 1535 |
-
)
|
| 1536 |
-
with gr.Row():
|
| 1537 |
-
ckpt_path2 = gr.Textbox(
|
| 1538 |
-
label=i18n("模型路径"),
|
| 1539 |
-
value="E:\\codes\\py39\\logs\\mi-test_f0_48k\\G_23333.pth",
|
| 1540 |
-
interactive=True,
|
| 1541 |
-
)
|
| 1542 |
-
save_name = gr.Textbox(
|
| 1543 |
-
label=i18n("保存名"), value="", interactive=True
|
| 1544 |
-
)
|
| 1545 |
-
sr__ = gr.Radio(
|
| 1546 |
-
label=i18n("目标采样率"),
|
| 1547 |
-
choices=["32k", "40k", "48k"],
|
| 1548 |
-
value="40k",
|
| 1549 |
-
interactive=True,
|
| 1550 |
-
)
|
| 1551 |
-
if_f0__ = gr.Radio(
|
| 1552 |
-
label=i18n("模型是否带音高指导,1是0否"),
|
| 1553 |
-
choices=["1", "0"],
|
| 1554 |
-
value="1",
|
| 1555 |
-
interactive=True,
|
| 1556 |
-
)
|
| 1557 |
-
version_1 = gr.Radio(
|
| 1558 |
-
label=i18n("模型版本型号"),
|
| 1559 |
-
choices=["v1", "v2"],
|
| 1560 |
-
value="v2",
|
| 1561 |
-
interactive=True,
|
| 1562 |
-
)
|
| 1563 |
-
info___ = gr.Textbox(
|
| 1564 |
-
label=i18n("要置入的模型信息"),
|
| 1565 |
-
value="",
|
| 1566 |
-
max_lines=8,
|
| 1567 |
-
interactive=True,
|
| 1568 |
-
)
|
| 1569 |
-
but9 = gr.Button(i18n("提取"), variant="primary")
|
| 1570 |
-
info7 = gr.Textbox(label=i18n("输出信息"), value="", max_lines=8)
|
| 1571 |
-
ckpt_path2.change(
|
| 1572 |
-
change_info_, [ckpt_path2], [sr__, if_f0__, version_1]
|
| 1573 |
-
)
|
| 1574 |
-
but9.click(
|
| 1575 |
-
extract_small_model,
|
| 1576 |
-
[ckpt_path2, save_name, sr__, if_f0__, info___, version_1],
|
| 1577 |
-
info7,
|
| 1578 |
-
api_name="ckpt_extract",
|
| 1579 |
-
)
|
| 1580 |
-
|
| 1581 |
-
with gr.TabItem(i18n("Onnx导出")):
|
| 1582 |
-
with gr.Row():
|
| 1583 |
-
ckpt_dir = gr.Textbox(
|
| 1584 |
-
label=i18n("RVC模型路径"), value="", interactive=True
|
| 1585 |
-
)
|
| 1586 |
-
with gr.Row():
|
| 1587 |
-
onnx_dir = gr.Textbox(
|
| 1588 |
-
label=i18n("Onnx输出路径"), value="", interactive=True
|
| 1589 |
-
)
|
| 1590 |
-
with gr.Row():
|
| 1591 |
-
infoOnnx = gr.Label(label="info")
|
| 1592 |
-
with gr.Row():
|
| 1593 |
-
butOnnx = gr.Button(i18n("导出Onnx模型"), variant="primary")
|
| 1594 |
-
butOnnx.click(
|
| 1595 |
-
export_onnx, [ckpt_dir, onnx_dir], infoOnnx, api_name="export_onnx"
|
| 1596 |
-
)
|
| 1597 |
|
| 1598 |
tab_faq = i18n("常见问题解答")
|
| 1599 |
with gr.TabItem(tab_faq):
|
| 1600 |
-
|
| 1601 |
-
|
| 1602 |
-
with open("docs/cn/faq.md", "r", encoding="utf8") as f:
|
| 1603 |
-
info = f.read()
|
| 1604 |
-
else:
|
| 1605 |
-
with open("docs/en/faq_en.md", "r", encoding="utf8") as f:
|
| 1606 |
-
info = f.read()
|
| 1607 |
gr.Markdown(value=info)
|
| 1608 |
-
except:
|
| 1609 |
-
gr.Markdown(traceback.format_exc())
|
| 1610 |
|
| 1611 |
-
|
| 1612 |
-
|
| 1613 |
-
|
| 1614 |
-
|
| 1615 |
-
|
| 1616 |
-
|
| 1617 |
-
|
| 1618 |
-
|
| 1619 |
-
)
|
|
|
|
| 831 |
visible=False,
|
| 832 |
interactive=True,
|
| 833 |
)
|
| 834 |
+
with gr.Column():
|
| 835 |
+
vc_transform0 = gr.Number(
|
| 836 |
+
label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"),
|
| 837 |
+
value=0,
|
| 838 |
+
)
|
| 839 |
+
f0method0 = gr.Radio(
|
| 840 |
+
label=i18n(
|
| 841 |
+
"选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU,rmvpe效果最好且微吃GPU"
|
| 842 |
+
),
|
| 843 |
+
choices=(
|
| 844 |
+
["pm", "harvest", "crepe", "rmvpe"]
|
| 845 |
+
),
|
| 846 |
+
value="rmvpe",
|
| 847 |
+
interactive=True,
|
| 848 |
+
)
|
| 849 |
clean_button.click(
|
| 850 |
fn=clean, inputs=[], outputs=[sid0], api_name="infer_clean"
|
| 851 |
)
|
|
|
|
| 853 |
with gr.Group():
|
| 854 |
with gr.Row():
|
| 855 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
| 856 |
input_audio0 = gr.Textbox(
|
| 857 |
label=i18n(
|
| 858 |
"输入待处理音频文件路径(默认是正确格式示例)"
|
|
|
|
| 871 |
choices=sorted(index_paths),
|
| 872 |
interactive=True,
|
| 873 |
)
|
| 874 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 875 |
|
| 876 |
with gr.Column():
|
| 877 |
resample_sr0 = gr.Slider(
|
|
|
|
| 941 |
but0 = gr.Button(i18n("转换"), variant="primary")
|
| 942 |
with gr.Row():
|
| 943 |
vc_output1 = gr.Textbox(label=i18n("输出信息"))
|
| 944 |
+
with gr.Row():
|
| 945 |
vc_output2 = gr.Audio(
|
| 946 |
label=i18n("输出音频(右下角三个点,点了可以下载)")
|
| 947 |
)
|
|
|
|
| 1422 |
api_name="train_start_all",
|
| 1423 |
)
|
| 1424 |
|
| 1425 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1426 |
|
| 1427 |
tab_faq = i18n("常见问题解答")
|
| 1428 |
with gr.TabItem(tab_faq):
|
| 1429 |
+
with open("docs/en/faq_en.md", "r", encoding="utf8") as f:
|
| 1430 |
+
info = f.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1431 |
gr.Markdown(value=info)
|
|
|
|
|
|
|
| 1432 |
|
| 1433 |
+
|
| 1434 |
+
|
| 1435 |
+
app.queue(concurrency_count=511, max_size=1022).launch(
|
| 1436 |
+
server_name="0.0.0.0",
|
| 1437 |
+
inbrowser=not config.noautoopen,
|
| 1438 |
+
server_port=config.listen_port,
|
| 1439 |
+
quiet=True,
|
| 1440 |
+
)
|
|
|