File size: 3,045 Bytes
85d3b29
 
 
 
 
 
 
2693299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85d3b29
 
 
 
 
 
 
2693299
 
 
85d3b29
 
 
 
 
 
 
 
 
2693299
 
 
 
 
 
 
85d3b29
 
 
 
 
 
 
 
 
 
 
 
 
 
5304cd8
 
85d3b29
 
 
 
 
 
 
 
 
 
 
 
 
5304cd8
 
 
85d3b29
 
 
2693299
 
 
 
 
 
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import gradio as gr
import sys
import os

now_dir = os.getcwd()
sys.path.append(now_dir)


class InstallationError(Exception):
    def __init__(self, message="InstallationError"):
        self.message = message
        super().__init__(self.message)


try:
    system_drive = os.getenv("SystemDrive")
    current_drive = os.path.splitdrive(now_dir)[0]
    if current_drive.upper() != system_drive.upper():
        raise InstallationError(
            f"Error: Current working directory is not on the default system drive ({system_drive}). Please move Applio in the correct drive."
        )
except:
    pass
else:
    if "OneDrive" in now_dir:
        raise InstallationError(
            "Error: Current working directory is on OneDrive. Please move Applio in another folder."
        )
    elif " " in now_dir:
        raise InstallationError(
            "Error: Current working directory contains spaces. Please move Applio in another folder."
        )
    try:
        now_dir.encode("ascii")
    except UnicodeEncodeError:
        raise InstallationError(
            "Error: Current working directory contains non-ASCII characters. Please move Applio in another folder."
        )

from tabs.inference.inference import inference_tab
from tabs.train.train import train_tab
from tabs.extra.extra import extra_tab
from tabs.report.report import report_tab
from tabs.download.download import download_tab
from tabs.tts.tts import tts_tab
from tabs.settings.presence import presence_tab
from tabs.settings.themes import theme_tab

import assets.themes.loadThemes as loadThemes

from assets.i18n.i18n import I18nAuto

i18n = I18nAuto()

from assets.discord_presence import RPCManager

RPCManager.start_presence()

my_applio = loadThemes.load_json()
if my_applio:
    pass
else:
    my_applio = "ParityError/Interstellar"

with gr.Blocks(theme=my_applio, title="Applio") as Applio:
    gr.Markdown("# Applio")
    gr.Markdown(
        i18n(
            "Ultimate voice cloning tool, meticulously optimized for unrivaled power, modularity, and user-friendly experience."
        )
    )
    gr.Markdown(
        i18n(
            "[Support](https://discord.gg/IAHispano) β€” [Discord Bot](https://discord.com/oauth2/authorize?client_id=1144714449563955302&permissions=1376674695271&scope=bot%20applications.commands) β€” [Find Voices](https://applio.org/models) β€” [GitHub](https://github.com/IAHispano/Applio)"
        )
    )
    with gr.Tab(i18n("Inference")):
        inference_tab()

#    with gr.Tab(i18n("Train")):
#        train_tab()

    with gr.Tab(i18n("TTS")):
        tts_tab()

    with gr.Tab(i18n("Extra")):
        extra_tab()

    with gr.Tab(i18n("Download")):
        download_tab()

    with gr.Tab(i18n("Report a Bug")):
        report_tab()

#    with gr.Tab(i18n("Settings")):
#        presence_tab()
#        theme_tab()


if __name__ == "__main__":
    Applio.launch(
        favicon_path="assets/ICON.ico",
        share="--share" in sys.argv,
        inbrowser="--open" in sys.argv,
        server_port=6969,
    )