Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1481,38 +1481,18 @@ def zip_downloader(model):
|
|
1481 |
else:
|
1482 |
return f'./weights/{model}.pth', "Could not find Index file."
|
1483 |
|
1484 |
-
|
|
|
|
|
|
|
1485 |
with gr.Tabs():
|
1486 |
-
with gr.TabItem("
|
1487 |
-
gr.HTML("<h1> Ilaria RVC 💖 </h1>")
|
1488 |
-
gr.HTML("<h10> You can find voice models on AI Hub: https://discord.gg/aihub </h10>")
|
1489 |
-
gr.HTML("<h4> Huggingface port by Ilaria of the Rejekt Easy GUI </h4>")
|
1490 |
-
|
1491 |
-
# Inference Preset Row
|
1492 |
-
# with gr.Row():
|
1493 |
-
# mangio_preset = gr.Dropdown(label="Inference Preset", choices=sorted(get_presets()))
|
1494 |
-
# mangio_preset_name_save = gr.Textbox(
|
1495 |
-
# label="Your preset name"
|
1496 |
-
# )
|
1497 |
-
# mangio_preset_save_btn = gr.Button('Save Preset', variant="primary")
|
1498 |
-
|
1499 |
-
# Other RVC stuff
|
1500 |
with gr.Row():
|
1501 |
sid0 = gr.Dropdown(label="1.Choose the model.", choices=sorted(names), value=check_for_name())
|
1502 |
refresh_button = gr.Button("Refresh", variant="primary")
|
1503 |
if check_for_name() != '':
|
1504 |
get_vc(sorted(names)[0])
|
1505 |
vc_transform0 = gr.Number(label="Pitch: 0 from man to man (or woman to woman); 12 from man to woman and -12 from woman to man.", value=0)
|
1506 |
-
#clean_button = gr.Button(i18n("卸载音色省显存"), variant="primary")
|
1507 |
-
spk_item = gr.Slider(
|
1508 |
-
minimum=0,
|
1509 |
-
maximum=2333,
|
1510 |
-
step=1,
|
1511 |
-
label=i18n("请选择说话人id"),
|
1512 |
-
value=0,
|
1513 |
-
visible=False,
|
1514 |
-
interactive=True,
|
1515 |
-
)
|
1516 |
#clean_button.click(fn=clean, inputs=[], outputs=[sid0])
|
1517 |
sid0.change(
|
1518 |
fn=get_vc,
|
@@ -1537,7 +1517,7 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
|
|
1537 |
refresh_button2 = gr.Button("Refresh", variant="primary", size='sm')
|
1538 |
record_button.change(fn=save_to_wav, inputs=[record_button], outputs=[input_audio0])
|
1539 |
record_button.change(fn=change_choices2, inputs=[], outputs=[input_audio0])
|
1540 |
-
with gr.Row():
|
1541 |
with gr.Accordion('ElevenLabs / Google TTS', open=False):
|
1542 |
with gr.Column():
|
1543 |
lang = gr.Radio(label='Chinese & Japanese do not work with ElevenLabs currently.',choices=['en','it','es','fr','pt','zh-CN','de','hi','ja'], value='en')
|
@@ -1547,7 +1527,7 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
|
|
1547 |
tfs = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
|
1548 |
tts_button = gr.Button(value="Speak")
|
1549 |
tts_button.click(fn=elevenTTS, inputs=[api_box,tfs, elevenid, lang], outputs=[record_button, input_audio0])
|
1550 |
-
with gr.Row():
|
1551 |
with gr.Accordion('Wav2Lip', open=False, visible=False):
|
1552 |
with gr.Row():
|
1553 |
size = gr.Radio(label='Resolution:',choices=['Half','Full'])
|
@@ -1569,15 +1549,15 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
|
|
1569 |
interactive=False,
|
1570 |
)
|
1571 |
|
1572 |
-
with gr.Accordion('IlariaTTS', open=True):
|
1573 |
-
with gr.Column():
|
1574 |
ilariaid=gr.Dropdown(label="Voice:", choices=ilariavoices, value="English-Jenny (Female)")
|
1575 |
ilariatext = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
|
1576 |
ilariatts_button = gr.Button(value="Speak")
|
1577 |
ilariatts_button.click(fn=ilariaTTS, inputs=[ilariatext, ilariaid], outputs=[record_button, input_audio0])
|
1578 |
|
1579 |
#with gr.Column():
|
1580 |
-
with gr.Accordion("Index Settings", open=False):
|
1581 |
#with gr.Row():
|
1582 |
|
1583 |
file_index1 = gr.Dropdown(
|
@@ -1605,105 +1585,6 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
|
|
1605 |
|
1606 |
animate_button.click(fn=mouth, inputs=[size, face, vc_output2, faces], outputs=[animation, preview])
|
1607 |
|
1608 |
-
with gr.Accordion("Advanced Options", open=False):
|
1609 |
-
f0method0 = gr.Radio(
|
1610 |
-
label="Optional: Change the Pitch Extraction Algorithm. Extraction methods are sorted from 'worst quality' to 'best quality'. If you don't know what you're doing, leave rmvpe.",
|
1611 |
-
choices=["pm", "dio", "crepe-tiny", "mangio-crepe-tiny", "crepe", "harvest", "mangio-crepe", "rmvpe"], # Fork Feature. Add Crepe-Tiny
|
1612 |
-
value="rmvpe",
|
1613 |
-
interactive=True,
|
1614 |
-
)
|
1615 |
-
|
1616 |
-
crepe_hop_length = gr.Slider(
|
1617 |
-
minimum=1,
|
1618 |
-
maximum=512,
|
1619 |
-
step=1,
|
1620 |
-
label="Mangio-Crepe Hop Length. Higher numbers will reduce the chance of extreme pitch changes but lower numbers will increase accuracy. 64-192 is a good range to experiment with.",
|
1621 |
-
value=120,
|
1622 |
-
interactive=True,
|
1623 |
-
visible=False,
|
1624 |
-
)
|
1625 |
-
f0method0.change(fn=whethercrepeornah, inputs=[f0method0], outputs=[crepe_hop_length])
|
1626 |
-
filter_radius0 = gr.Slider(
|
1627 |
-
minimum=0,
|
1628 |
-
maximum=7,
|
1629 |
-
label=i18n(">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音"),
|
1630 |
-
value=3,
|
1631 |
-
step=1,
|
1632 |
-
interactive=True,
|
1633 |
-
)
|
1634 |
-
resample_sr0 = gr.Slider(
|
1635 |
-
minimum=0,
|
1636 |
-
maximum=48000,
|
1637 |
-
label=i18n("后处理重采样至最终采样率,0为不进行重采样"),
|
1638 |
-
value=0,
|
1639 |
-
step=1,
|
1640 |
-
interactive=True,
|
1641 |
-
visible=False
|
1642 |
-
)
|
1643 |
-
rms_mix_rate0 = gr.Slider(
|
1644 |
-
minimum=0,
|
1645 |
-
maximum=1,
|
1646 |
-
label=i18n("输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络"),
|
1647 |
-
value=0.21,
|
1648 |
-
interactive=True,
|
1649 |
-
)
|
1650 |
-
protect0 = gr.Slider(
|
1651 |
-
minimum=0,
|
1652 |
-
maximum=0.5,
|
1653 |
-
label=i18n("保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果"),
|
1654 |
-
value=0.33,
|
1655 |
-
step=0.01,
|
1656 |
-
interactive=True,
|
1657 |
-
)
|
1658 |
-
formanting = gr.Checkbox(
|
1659 |
-
value=bool(DoFormant),
|
1660 |
-
label="[EXPERIMENTAL] Formant shift inference audio",
|
1661 |
-
info="Used for male to female and vice-versa conversions",
|
1662 |
-
interactive=True,
|
1663 |
-
visible=True,
|
1664 |
-
)
|
1665 |
-
|
1666 |
-
formant_preset = gr.Dropdown(
|
1667 |
-
value='',
|
1668 |
-
choices=get_fshift_presets(),
|
1669 |
-
label="browse presets for formanting",
|
1670 |
-
visible=bool(DoFormant),
|
1671 |
-
)
|
1672 |
-
formant_refresh_button = gr.Button(
|
1673 |
-
value='\U0001f504',
|
1674 |
-
visible=bool(DoFormant),
|
1675 |
-
variant='primary',
|
1676 |
-
)
|
1677 |
-
#formant_refresh_button = ToolButton( elem_id='1')
|
1678 |
-
#create_refresh_button(formant_preset, lambda: {"choices": formant_preset}, "refresh_list_shiftpresets")
|
1679 |
-
|
1680 |
-
qfrency = gr.Slider(
|
1681 |
-
value=Quefrency,
|
1682 |
-
info="Default value is 1.0",
|
1683 |
-
label="Quefrency for formant shifting",
|
1684 |
-
minimum=0.0,
|
1685 |
-
maximum=16.0,
|
1686 |
-
step=0.1,
|
1687 |
-
visible=bool(DoFormant),
|
1688 |
-
interactive=True,
|
1689 |
-
)
|
1690 |
-
tmbre = gr.Slider(
|
1691 |
-
value=Timbre,
|
1692 |
-
info="Default value is 1.0",
|
1693 |
-
label="Timbre for formant shifting",
|
1694 |
-
minimum=0.0,
|
1695 |
-
maximum=16.0,
|
1696 |
-
step=0.1,
|
1697 |
-
visible=bool(DoFormant),
|
1698 |
-
interactive=True,
|
1699 |
-
)
|
1700 |
-
|
1701 |
-
formant_preset.change(fn=preset_apply, inputs=[formant_preset, qfrency, tmbre], outputs=[qfrency, tmbre])
|
1702 |
-
frmntbut = gr.Button("Apply", variant="primary", visible=bool(DoFormant))
|
1703 |
-
formanting.change(fn=formant_enabled,inputs=[formanting,qfrency,tmbre,frmntbut,formant_preset,formant_refresh_button],outputs=[formanting,qfrency,tmbre,frmntbut,formant_preset,formant_refresh_button])
|
1704 |
-
frmntbut.click(fn=formant_apply,inputs=[qfrency, tmbre], outputs=[qfrency, tmbre])
|
1705 |
-
formant_refresh_button.click(fn=update_fshift_presets,inputs=[formant_preset, qfrency, tmbre],outputs=[formant_preset, qfrency, tmbre])
|
1706 |
-
|
1707 |
with gr.Row():
|
1708 |
vc_output1 = gr.Textbox("")
|
1709 |
f0_file = gr.File(label=i18n("F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调"), visible=False)
|
@@ -1855,12 +1736,6 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
|
|
1855 |
with gr.Row():
|
1856 |
status_bar=gr.Textbox(label="Download Status")
|
1857 |
download_button.click(fn=download_from_url, inputs=[url, model], outputs=[status_bar])
|
1858 |
-
with gr.Row():
|
1859 |
-
gr.Markdown(
|
1860 |
-
"""
|
1861 |
-
Made with 💖 by Ilaria | Support her on [Ko-Fi](https://ko-fi.com/ilariaowo)
|
1862 |
-
"""
|
1863 |
-
)
|
1864 |
|
1865 |
def has_two_files_in_pretrained_folder():
|
1866 |
pretrained_folder = "./pretrained/"
|
|
|
1481 |
else:
|
1482 |
return f'./weights/{model}.pth', "Could not find Index file."
|
1483 |
|
1484 |
+
dark_minimalist = gr.Theme.from_hub("Taithrah/Minimal")
|
1485 |
+
|
1486 |
+
|
1487 |
+
with gr.Blocks(theme=gr.dark_minimalist) as app:
|
1488 |
with gr.Tabs():
|
1489 |
+
with gr.TabItem("Voice Changer"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1490 |
with gr.Row():
|
1491 |
sid0 = gr.Dropdown(label="1.Choose the model.", choices=sorted(names), value=check_for_name())
|
1492 |
refresh_button = gr.Button("Refresh", variant="primary")
|
1493 |
if check_for_name() != '':
|
1494 |
get_vc(sorted(names)[0])
|
1495 |
vc_transform0 = gr.Number(label="Pitch: 0 from man to man (or woman to woman); 12 from man to woman and -12 from woman to man.", value=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1496 |
#clean_button.click(fn=clean, inputs=[], outputs=[sid0])
|
1497 |
sid0.change(
|
1498 |
fn=get_vc,
|
|
|
1517 |
refresh_button2 = gr.Button("Refresh", variant="primary", size='sm')
|
1518 |
record_button.change(fn=save_to_wav, inputs=[record_button], outputs=[input_audio0])
|
1519 |
record_button.change(fn=change_choices2, inputs=[], outputs=[input_audio0])
|
1520 |
+
#with gr.Row():
|
1521 |
with gr.Accordion('ElevenLabs / Google TTS', open=False):
|
1522 |
with gr.Column():
|
1523 |
lang = gr.Radio(label='Chinese & Japanese do not work with ElevenLabs currently.',choices=['en','it','es','fr','pt','zh-CN','de','hi','ja'], value='en')
|
|
|
1527 |
tfs = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
|
1528 |
tts_button = gr.Button(value="Speak")
|
1529 |
tts_button.click(fn=elevenTTS, inputs=[api_box,tfs, elevenid, lang], outputs=[record_button, input_audio0])
|
1530 |
+
#with gr.Row():
|
1531 |
with gr.Accordion('Wav2Lip', open=False, visible=False):
|
1532 |
with gr.Row():
|
1533 |
size = gr.Radio(label='Resolution:',choices=['Half','Full'])
|
|
|
1549 |
interactive=False,
|
1550 |
)
|
1551 |
|
1552 |
+
#with gr.Accordion('IlariaTTS', open=True):
|
1553 |
+
#with gr.Column():
|
1554 |
ilariaid=gr.Dropdown(label="Voice:", choices=ilariavoices, value="English-Jenny (Female)")
|
1555 |
ilariatext = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
|
1556 |
ilariatts_button = gr.Button(value="Speak")
|
1557 |
ilariatts_button.click(fn=ilariaTTS, inputs=[ilariatext, ilariaid], outputs=[record_button, input_audio0])
|
1558 |
|
1559 |
#with gr.Column():
|
1560 |
+
#with gr.Accordion("Index Settings", open=False):
|
1561 |
#with gr.Row():
|
1562 |
|
1563 |
file_index1 = gr.Dropdown(
|
|
|
1585 |
|
1586 |
animate_button.click(fn=mouth, inputs=[size, face, vc_output2, faces], outputs=[animation, preview])
|
1587 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1588 |
with gr.Row():
|
1589 |
vc_output1 = gr.Textbox("")
|
1590 |
f0_file = gr.File(label=i18n("F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调"), visible=False)
|
|
|
1736 |
with gr.Row():
|
1737 |
status_bar=gr.Textbox(label="Download Status")
|
1738 |
download_button.click(fn=download_from_url, inputs=[url, model], outputs=[status_bar])
|
|
|
|
|
|
|
|
|
|
|
|
|
1739 |
|
1740 |
def has_two_files_in_pretrained_folder():
|
1741 |
pretrained_folder = "./pretrained/"
|