File size: 1,246 Bytes
f80c5ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from app.settings import SettingsTab
from app.tutorial import TutotialTab
from app.dataset import DatasetTab
from app.train import TrainTab
from app.infer import InferenceTab
from app.zero import zero_is_available

if zero_is_available:
    import torch

    torch.backends.cuda.matmul.allow_tf32 = True


with gr.Blocks() as app:
    gr.Markdown("# ZeroRVC")
    gr.Markdown(
        "Run Retrieval-based Voice Conversion training and inference on Hugging Face ZeroGPU or locally."
    )

    settings = SettingsTab()
    tutorial = TutotialTab()
    dataset = DatasetTab()
    training = TrainTab()
    inference = InferenceTab()

    with gr.Accordion(label="Environment Settings"):
        settings.ui()

    with gr.Tabs():
        with gr.Tab(label="Tutorial", id=0):
            tutorial.ui()

        with gr.Tab(label="Dataset", id=1):
            dataset.ui()

        with gr.Tab(label="Training", id=2):
            training.ui()

        with gr.Tab(label="Inference", id=3):
            inference.ui()

    settings.build()
    tutorial.build()
    dataset.build(settings.exp_dir, settings.hf_token)
    training.build(settings.exp_dir, settings.hf_token)
    inference.build(settings.exp_dir)

    app.launch()