Upload app.py
Browse files
app.py
CHANGED
@@ -1327,9 +1327,9 @@ def check_for_name():
|
|
1327 |
|
1328 |
def download_from_url(url, model):
|
1329 |
if url == '':
|
1330 |
-
return "
|
1331 |
if model =='':
|
1332 |
-
return "
|
1333 |
url = url.strip()
|
1334 |
zip_dirs = ["zips", "unzips"]
|
1335 |
for directory in zip_dirs:
|
@@ -1363,11 +1363,11 @@ def download_from_url(url, model):
|
|
1363 |
shutil.copy(file_path,f'./weights/{model}.pth')
|
1364 |
shutil.rmtree("zips")
|
1365 |
shutil.rmtree("unzips")
|
1366 |
-
return "
|
1367 |
except:
|
1368 |
-
return "
|
1369 |
def success_message(face):
|
1370 |
-
return f'{face.name}
|
1371 |
def mouth(size, face, voice, faces):
|
1372 |
if size == 'Half':
|
1373 |
size = 2
|
@@ -1481,12 +1481,12 @@ def zip_downloader(model):
|
|
1481 |
else:
|
1482 |
return f'./weights/{model}.pth', "Could not find Index file."
|
1483 |
|
1484 |
-
with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"), title="RVC - AI HUB BRASIL
|
1485 |
with gr.Tabs():
|
1486 |
with gr.TabItem("Inference"):
|
1487 |
-
gr.HTML("<h1> RVC - AI HUB BRASIL
|
1488 |
gr.HTML("<h10> Você pode encontrar mais modelos em AI Hub: https://discord.gg/aihub <br> ou AI Hub Brasil https://discord.gg/aihubrasil </h10>")
|
1489 |
-
gr.HTML("<h4> Huggingface port
|
1490 |
|
1491 |
# Inference Preset Row
|
1492 |
# with gr.Row():
|
@@ -1498,11 +1498,11 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1498 |
|
1499 |
# Other RVC stuff
|
1500 |
with gr.Row():
|
1501 |
-
sid0 = gr.Dropdown(label="1.
|
1502 |
-
refresh_button = gr.Button("
|
1503 |
if check_for_name() != '':
|
1504 |
get_vc(sorted(names)[0])
|
1505 |
-
vc_transform0 = gr.Number(label="
|
1506 |
#clean_button = gr.Button(i18n("卸载音色省显存"), variant="primary")
|
1507 |
spk_item = gr.Slider(
|
1508 |
minimum=0,
|
@@ -1525,11 +1525,11 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1525 |
with gr.Row():
|
1526 |
dropbox = gr.File(label="Drag your audio file and click refresh.")
|
1527 |
with gr.Row():
|
1528 |
-
|
1529 |
with gr.Row():
|
1530 |
input_audio0 = gr.Dropdown(
|
1531 |
-
label="2.
|
1532 |
-
value="./audios/
|
1533 |
choices=audio_files
|
1534 |
)
|
1535 |
dropbox.upload(fn=save_to_wav2, inputs=[dropbox], outputs=[input_audio0])
|
@@ -1540,12 +1540,12 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1540 |
with gr.Row():
|
1541 |
with gr.Accordion('ElevenLabs / Google TTS', open=False):
|
1542 |
with gr.Column():
|
1543 |
-
lang = gr.Radio(label='
|
1544 |
-
api_box = gr.Textbox(label="
|
1545 |
-
elevenid=gr.Dropdown(label="
|
1546 |
with gr.Column():
|
1547 |
-
tfs = gr.Textbox(label="
|
1548 |
-
tts_button = gr.Button(value="
|
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):
|
@@ -1571,17 +1571,17 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1571 |
|
1572 |
with gr.Accordion('Edge-TTS', open=True):
|
1573 |
with gr.Column():
|
1574 |
-
ilariaid=gr.Dropdown(label="
|
1575 |
-
ilariatext = gr.Textbox(label="
|
1576 |
-
ilariatts_button = gr.Button(value="
|
1577 |
ilariatts_button.click(fn=ilariaTTS, inputs=[ilariatext, ilariaid], outputs=[record_button, input_audio0])
|
1578 |
|
1579 |
#with gr.Column():
|
1580 |
-
with gr.Accordion("
|
1581 |
#with gr.Row():
|
1582 |
|
1583 |
file_index1 = gr.Dropdown(
|
1584 |
-
label="3.
|
1585 |
choices=get_indexes(),
|
1586 |
value=get_index(),
|
1587 |
interactive=True,
|
@@ -1598,16 +1598,16 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1598 |
index_rate1 = gr.Slider(
|
1599 |
minimum=0,
|
1600 |
maximum=1,
|
1601 |
-
label=i18n("
|
1602 |
value=0.66,
|
1603 |
interactive=True,
|
1604 |
)
|
1605 |
|
1606 |
animate_button.click(fn=mouth, inputs=[size, face, vc_output2, faces], outputs=[animation, preview])
|
1607 |
|
1608 |
-
with gr.Accordion("
|
1609 |
f0method0 = gr.Radio(
|
1610 |
-
label="
|
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,
|
@@ -1626,7 +1626,7 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1626 |
filter_radius0 = gr.Slider(
|
1627 |
minimum=0,
|
1628 |
maximum=7,
|
1629 |
-
label=i18n(">=3
|
1630 |
value=3,
|
1631 |
step=1,
|
1632 |
interactive=True,
|
@@ -1643,22 +1643,22 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1643 |
rms_mix_rate0 = gr.Slider(
|
1644 |
minimum=0,
|
1645 |
maximum=1,
|
1646 |
-
label=i18n("
|
1647 |
value=0.21,
|
1648 |
interactive=True,
|
1649 |
)
|
1650 |
protect0 = gr.Slider(
|
1651 |
minimum=0,
|
1652 |
maximum=0.5,
|
1653 |
-
label=i18n("
|
1654 |
value=0.33,
|
1655 |
step=0.01,
|
1656 |
interactive=True,
|
1657 |
)
|
1658 |
formanting = gr.Checkbox(
|
1659 |
value=bool(DoFormant),
|
1660 |
-
label="[EXPERIMENTAL]
|
1661 |
-
info="
|
1662 |
interactive=True,
|
1663 |
visible=True,
|
1664 |
)
|
@@ -1846,14 +1846,14 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"
|
|
1846 |
[vc_output3],
|
1847 |
)
|
1848 |
but1.click(fn=lambda: easy_uploader.clear())
|
1849 |
-
with gr.TabItem("
|
1850 |
with gr.Row():
|
1851 |
url=gr.Textbox(label="Huggingface Link:")
|
1852 |
with gr.Row():
|
1853 |
-
model = gr.Textbox(label="
|
1854 |
-
download_button=gr.Button("
|
1855 |
with gr.Row():
|
1856 |
-
status_bar=gr.Textbox(label="Status
|
1857 |
download_button.click(fn=download_from_url, inputs=[url, model], outputs=[status_bar])
|
1858 |
with gr.Row():
|
1859 |
gr.Markdown(
|
|
|
1327 |
|
1328 |
def download_from_url(url, model):
|
1329 |
if url == '':
|
1330 |
+
return "URL cannot be left empty."
|
1331 |
if model =='':
|
1332 |
+
return "You need to name your model. For example: My-Model"
|
1333 |
url = url.strip()
|
1334 |
zip_dirs = ["zips", "unzips"]
|
1335 |
for directory in zip_dirs:
|
|
|
1363 |
shutil.copy(file_path,f'./weights/{model}.pth')
|
1364 |
shutil.rmtree("zips")
|
1365 |
shutil.rmtree("unzips")
|
1366 |
+
return "Model downloaded, you can go back to the inference page!"
|
1367 |
except:
|
1368 |
+
return "ERROR - The download failed. Check if the link is valid."
|
1369 |
def success_message(face):
|
1370 |
+
return f'{face.name} has been uploaded.', 'None'
|
1371 |
def mouth(size, face, voice, faces):
|
1372 |
if size == 'Half':
|
1373 |
size = 2
|
|
|
1481 |
else:
|
1482 |
return f'./weights/{model}.pth', "Could not find Index file."
|
1483 |
|
1484 |
+
with gr.Blocks(theme=gr.themes.Default(primary_hue="green", secondary_hue="blue"), title="RVC - AI HUB BRASIL 🇧🇷") as app:
|
1485 |
with gr.Tabs():
|
1486 |
with gr.TabItem("Inference"):
|
1487 |
+
gr.HTML("<h1> RVC - AI HUB BRASIL 🇧🇷 </h1>")
|
1488 |
gr.HTML("<h10> Você pode encontrar mais modelos em AI Hub: https://discord.gg/aihub <br> ou AI Hub Brasil https://discord.gg/aihubrasil </h10>")
|
1489 |
+
gr.HTML("<h4> Huggingface port POR Ilaria a partir do Rejekt Easy GUI </h4>")
|
1490 |
|
1491 |
# Inference Preset Row
|
1492 |
# with gr.Row():
|
|
|
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,
|
|
|
1525 |
with gr.Row():
|
1526 |
dropbox = gr.File(label="Drag your audio file and click refresh.")
|
1527 |
with gr.Row():
|
1528 |
+
record_button=gr.Audio(source="microphone", label="Or you can use your microphone!", type="filepath")
|
1529 |
with gr.Row():
|
1530 |
input_audio0 = gr.Dropdown(
|
1531 |
+
label="2.Choose the audio file.",
|
1532 |
+
value="./audios/Test_Audio.mp3",
|
1533 |
choices=audio_files
|
1534 |
)
|
1535 |
dropbox.upload(fn=save_to_wav2, inputs=[dropbox], 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')
|
1544 |
+
api_box = gr.Textbox(label="Enter your API Key for ElevenLabs, or leave empty to use GoogleTTS", value='')
|
1545 |
+
elevenid=gr.Dropdown(label="Voice:", choices=eleven_voices)
|
1546 |
with gr.Column():
|
1547 |
+
tfs = gr.Textbox(label="Input your Text", interactive=True, value="Isso é um teste.")
|
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):
|
|
|
1571 |
|
1572 |
with gr.Accordion('Edge-TTS', open=True):
|
1573 |
with gr.Column():
|
1574 |
+
ilariaid=gr.Dropdown(label="Voice:", choices=ilariavoices, value="Brazilian-Antonio- (Male)")
|
1575 |
+
ilariatext = gr.Textbox(label="Input your Text", interactive=True, value="Isso é um teste.")
|
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(
|
1584 |
+
label="3. Choose the index file (in case it wasn't automatically found.)",
|
1585 |
choices=get_indexes(),
|
1586 |
value=get_index(),
|
1587 |
interactive=True,
|
|
|
1598 |
index_rate1 = gr.Slider(
|
1599 |
minimum=0,
|
1600 |
maximum=1,
|
1601 |
+
label=i18n("检索特征占比"),
|
1602 |
value=0.66,
|
1603 |
interactive=True,
|
1604 |
)
|
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,
|
|
|
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,
|
|
|
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 |
)
|
|
|
1846 |
[vc_output3],
|
1847 |
)
|
1848 |
but1.click(fn=lambda: easy_uploader.clear())
|
1849 |
+
with gr.TabItem("Download Voice Models"):
|
1850 |
with gr.Row():
|
1851 |
url=gr.Textbox(label="Huggingface Link:")
|
1852 |
with gr.Row():
|
1853 |
+
model = gr.Textbox(label="Name of the model (without spaces):")
|
1854 |
+
download_button=gr.Button("Download")
|
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(
|