File size: 2,076 Bytes
16de183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75e6d47
 
 
 
 
 
 
16de183
 
 
 
 
 
 
 
 
 
 
 
aeb40ca
 
 
 
16de183
 
 
75e6d47
 
 
16de183
 
 
 
 
 
 
 
 
 
 
 
 
 
75e6d47
 
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
import gradio as gr
import sys
import os

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

from assets.i18n.i18n import I18nAuto

i18n = I18nAuto()

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 assets.discord_presence import rich_presence

rich_presence()

try:
    from tensorflow.python.client import device_lib

    gpus = [device.name for device in device_lib.list_local_devices() if device.device_type == "GPU"]
except ImportError:
    gpus = []

with gr.Blocks(theme="ParityError/Interstellar", 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)"
        )
    )
    gr.HTML("<h4> This space currently utilizes only CPU for inference. If you encounter queue issues, consider duplicating the space. </h4>")
    gr.Markdown(
    "[![Duplicate this Space](https://huggingface.co./datasets/huggingface/badges/raw/main/duplicate-this-space-sm-dark.svg)](https://huggingface.co./spaces/PlayerBPlaytime/Applio-V3-HF?duplicate=true)\n\n"
    )
    with gr.Tab(i18n("Inference")):
        inference_tab()

    if gpus:
        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()

if __name__ == "__main__":
    Applio.launch()
    # share=True