-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENG - A new interface has been added for those without internet access. - The "HuBERT Models Download" block has been moved to the "Models Download" tab. - The installation and launch file for Linux has been improved (`NOT TESTED`). - Gradio has been updated to version 5.0.1. - The SSH issue during HuBERT models installation has been fixed. - The "Transformation Settings" tab has been redesigned as an accordion. --- RU - Добавлен новый интерфейс для тех, у кого нет интернета. - Блок «Загрузка HuBERT моделей» перенесен во вкладку «Загрузка моделей». - Улучшен файл установки и запуска для Linux (`НЕ ПРОВЕРЕНО`). - Gradio обновлен до версии 5.0.1. - Исправлена проблема с SSH при установке HuBERT моделей. - Вкладка «Настройки преобразования» переделана под аккордион.
- Loading branch information
1 parent
b5938a5
commit 5e7ab31
Showing
9 changed files
with
227 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import os | ||
import sys | ||
import gradio as gr | ||
|
||
from tabs.welcome import welcome_tab | ||
from tabs.conversion.conversion import conversion_tab | ||
from tabs.processing.processing import processing_tab | ||
from tabs.install.install_models import zip_upload, files_upload | ||
|
||
DEFAULT_PORT = 4000 | ||
MAX_PORT_ATTEMPTS = 10 | ||
|
||
|
||
with gr.Blocks( | ||
title="PolGen - Politrees", | ||
css="footer{display:none !important}", | ||
theme=gr.themes.Soft( | ||
primary_hue="green", | ||
secondary_hue="green", | ||
neutral_hue="neutral", | ||
spacing_size="sm", | ||
radius_size="lg", | ||
), | ||
) as PolGen: | ||
|
||
with gr.Tab("Велком/Контакты"): | ||
welcome_tab() | ||
|
||
with gr.Tab("Преобразование и обработка голоса"): | ||
with gr.Tab("Замена голоса"): | ||
conversion_tab() | ||
|
||
with gr.Tab("Объединение/Обработка"): | ||
processing_tab() | ||
|
||
with gr.Tab("Загрузка RVC моделей"): | ||
zip_upload() | ||
files_upload() | ||
|
||
def launch(port): | ||
PolGen.launch( | ||
favicon_path=os.path.join(os.getcwd(), "assets", "logo.ico"), | ||
share="--share" in sys.argv, | ||
inbrowser="--open" in sys.argv, | ||
server_port=port, | ||
) | ||
|
||
|
||
def get_port_from_args(): | ||
if "--port" in sys.argv: | ||
port_index = sys.argv.index("--port") + 1 | ||
if port_index < len(sys.argv): | ||
return int(sys.argv[port_index]) | ||
return DEFAULT_PORT | ||
|
||
|
||
if __name__ == "__main__": | ||
port = get_port_from_args() | ||
for _ in range(MAX_PORT_ATTEMPTS): | ||
try: | ||
launch(port) | ||
break | ||
except OSError: | ||
print( | ||
f"Не удалось запустить на порту {port}, " | ||
f"повторите попытку на порту {port - 1}..." | ||
) | ||
port -= 1 | ||
except Exception as error: | ||
print(f"Произошла ошибка при запуске Gradio: {error}") | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.