File size: 3,742 Bytes
c76c626
 
 
 
 
f86a862
c76c626
 
41eb33c
fbe3d83
 
 
 
 
 
 
 
8ecd27c
 
 
 
fbe3d83
8ecd27c
fbe3d83
 
 
 
 
a06d437
a22cc60
7eb91bd
e7628aa
 
 
8ecd27c
e7628aa
 
 
 
 
 
a22cc60
e7628aa
 
 
b703faf
 
8ecd27c
 
 
b703faf
 
 
 
 
fbe3d83
19763bc
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
import os
import shutil
from os import listdir
import gradio as gr

with gr.Blocks(theme="Ryouko-Yamanda65777/ryo") as demo:
    with gr.Row():
        gr.Markdown("# RVC V2 - EASY GUI")
    with gr.Row():
        with gr.Tab("Inference"):
            with gr.Row():
                model_name = gr.Textbox(label="Model Name For Inference")
            with gr.Row():
                input_path = gr.Audio(label="Input Audio Path", type="filepath")
            with gr.Row():
                with gr.Accordion("Inference Settings"):
                    pitch = gr.Slider(minimum=-12, maximum=12, step=1, label="Pitch", value=0)
                    f0_method = gr.Dropdown(choices=["rmvpe", "pm", "harvest"], label="f0 Method", value="rmvpe", interactive=True)
                    index_rate = gr.Slider(minimum=0, maximum=1, step=0.01, label="Index Rate", value=0.5, interactive=True)
                    volume_normalization = gr.Slider(minimum=0, maximum=1, step=0.01, label="Volume Normalization", value=0, interactive=True)
                    consonant_protection = gr.Slider(minimum=0, maximum=1, step=0.01, label="Consonant Protection", value=0.5, interactive=True)
            with gr.Row():
                save_as = gr.Textbox(value="/content/RVC/audios/output_audio.wav", label="Output Audio Path", interactive=True)
                
            run_btn = gr.Button("Run Inference")
            with gr.Row():
                output_message = gr.Textbox(label="Output Message",interactive=False)
                output_audio = gr.Audio(label="Output Audio",interactive=False)
            #run_btn.click(run_inference, [model_name, pitch, input_path, f0_method, save_as, index_rate, volume_normalization, consonant_protection], output_message)

        with gr.Tab("Training"):
            with gr.TabItem("Create Index and stuff"):
                model_name = gr.Textbox(label="Model Name (No spaces or symbols)")
                dataset_folder = gr.Textbox(label="Dataset Folder", value="/content/dataset")
                f0method = gr.Dropdown(["pm", "harvest", "rmvpe", "rmvpe_gpu"], label="F0 Method", value="rmvpe_gpu", interactive=True)
                preprocess_btn = gr.Button("Start Preprocessing")
                f0_btn = gr.Button("Extract F0 Feature")
                train_btn = gr.Button("Train Index")
                preprocess_output = gr.Textbox(label="Preprocessing Log")
                f0_output = gr.Textbox(label="F0 Feature Extraction Log")
                train_output = gr.Textbox(label="Training Log")

                #preprocess_btn.click(preprocess_data, inputs=[model_name, dataset_folder], outputs=preprocess_output)
                #f0_btn.click(extract_f0_feature, inputs=[model_name, f0method], outputs=f0_output)
                #train_btn.click(train_index, inputs=[model_name, "v2"], outputs=train_output)
            with gr.TabItem("Train Your Model"):
                model_name_input = gr.Textbox(label="Model Name", placeholder="Enter the model name", interactive=True)
                epochs_slider = gr.Slider(minimum=50, maximum=2000, value=200, step=10, label="Epochs", interactive=True)
                save_frequency_slider = gr.Slider(minimum=10, maximum=100, value=50, step=10, label="Save Frequency", interactive=True)
                batch_size_slider = gr.Slider(minimum=1, maximum=20, value=8, step=1, label="Batch Size", interactive=True)
    
                train_button = gr.Button("Train Model")
                training_output = gr.Textbox(label="Training Log", interactive=False)
    
                #train_button.click(launch_training, inputs=[model_name_input, epochs_slider, save_frequency_slider, batch_size_slider], outputs=training_output)
    
demo.launch()