File size: 1,819 Bytes
a8c39f5
1378843
b3385db
1378843
 
b3385db
7e9f59c
1378843
 
 
b3385db
1378843
b3385db
1378843
a8c39f5
 
 
 
 
 
1378843
 
a8c39f5
 
b3385db
a8c39f5
 
 
 
 
1378843
a8c39f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bbf5262
1378843
b3385db
 
 
 
 
 
 
 
 
 
 
 
 
a8c39f5
 
2e0b1b0
b3385db
bbf5262
a8c39f5
 
 
 
 
 
7e9f59c
1378843
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import logging
import sys
from pathlib import Path

import gradio as gr
import yaml

import assets.installation_checker as installation_checker
import assets.themes.loadThemes as loadThemes
from assets.i18n.i18n import I18nAuto
from rvc.lib.tools.prerequisites_download import prequisites_download_pipeline
from tabs.plugins import plugins_core
from tabs.workflow.workflow import workflow_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
prequisites_download_pipeline(
    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="TTS Playground", css="footer{display:none !important}") as app:
    gr.Markdown("# Text-to-Speech Playground")
    gr.Markdown(i18n("Enter a page URL, click fetch and then synthesize"))
    with gr.Tab(i18n("Workflow")):
        workflow_tab()


def setup_logging():
    path = Path("logging.yml")
    if not path.exists():
        return
    with path.open() as f:
        from logging.config import dictConfig

        dictConfig(yaml.safe_load(f))


def launch_gradio():
    setup_logging()
    app.queue(status_update_rate=1).launch(
        favicon_path="assets/ICON.ico",
        share="--share" in sys.argv,
        inbrowser="--open" in sys.argv,
    )


if __name__ == "__main__":
    launch_gradio()