Applio / app.py
blaise-tk's picture
Update app.py
9ff05d0 verified
import gradio as gr
import sys
import os
import logging
# Set up logging
logging.getLogger("uvicorn").setLevel(logging.WARNING)
logging.getLogger("httpx").setLevel(logging.WARNING)
# Add current directory to sys.path
now_dir = os.getcwd()
sys.path.append(now_dir)
# Import Tabs
from tabs.inference.inference import inference_tab
from tabs.download.download import download_tab
from tabs.tts.tts import tts_tab
# Run prerequisites
from clean import start_infinite_loop
from core import run_prerequisites_script
run_prerequisites_script(
pretraineds_v1_f0=False,
pretraineds_v1_nof0=False,
pretraineds_v2_f0=False,
pretraineds_v2_nof0=False,
models=True,
exe=True,
)
start_infinite_loop()
# Initialize i18n
from assets.i18n.i18n import I18nAuto
i18n = I18nAuto()
# Check installation
import assets.installation_checker as installation_checker
installation_checker.check_installation()
# Load theme
import assets.themes.loadThemes as loadThemes
my_applio = loadThemes.load_theme() or "ParityError/Interstellar"
# Define Gradio interface
with gr.Blocks(
theme=my_applio, title="Applio", css="footer{display:none !important}"
) as Applio:
gr.Markdown("# Applio")
gr.Markdown(
i18n(
"A simple, high-quality voice conversion tool focused on ease of use and performance."
)
)
gr.Markdown(
i18n(
"[Support](https://discord.gg/urxFjYmYYh) β€” [Discord Bot](https://discord.com/oauth2/authorize?client_id=1144714449563955302&permissions=1376674695271&scope=bot%20applications.commands) β€” [GitHub](https://github.com/IAHispano/Applio)"
)
)
with gr.Tab(i18n("Inference")):
inference_tab()
with gr.Tab(i18n("TTS")):
tts_tab()
with gr.Tab(i18n("Download")):
download_tab()
def launch_gradio():
Applio.launch()
if __name__ == "__main__":
launch_gradio()