jlopez00's picture
Upload folder using huggingface_hub
1378843 verified
raw
history blame
1.59 kB
import logging
import sys
import gradio as gr
import assets.installation_checker as installation_checker
import assets.themes.loadThemes as loadThemes
from assets.i18n.i18n import I18nAuto
from core import run_prerequisites_script
from tabs.download.download import download_tab
from tabs.plugins import plugins_core
from tabs.tts.tts import tts_tab
from tts_service.utils import env_bool
# Set up logging
logging.getLogger("uvicorn").setLevel(logging.WARNING)
logging.getLogger("httpx").setLevel(logging.WARNING)
# Import Tabs
plugins_core.check_new_folders()
# Run prerequisites
run_prerequisites_script(
pretraineds_v1_f0=False,
pretraineds_v1_nof0=False,
pretraineds_v2_f0=True,
pretraineds_v2_nof0=False,
models=True,
voices=not env_bool("OFFLINE", False),
)
# Initialize i18n
i18n = I18nAuto()
# Check installation
installation_checker.check_installation()
# Start Flask server if enabled
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("# Text-to-Speech Playground")
gr.Markdown(i18n("Select a voice model, enter text, and press 'Convert' to synthesize speech."))
with gr.Tab(i18n("TTS")):
tts_tab()
with gr.Tab(i18n("Download")):
download_tab()
def launch_gradio():
Applio.launch(
favicon_path="assets/ICON.ico",
share="--share" in sys.argv,
inbrowser="--open" in sys.argv,
)
if __name__ == "__main__":
launch_gradio()