Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import zipfile
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
def train_rvc(dataset_zip):
|
| 6 |
+
# Extract dataset
|
| 7 |
+
with zipfile.ZipFile(dataset_zip, 'r') as zip_ref:
|
| 8 |
+
zip_ref.extractall("dataset")
|
| 9 |
+
|
| 10 |
+
# Here you would call your actual RVC training code
|
| 11 |
+
# Example placeholder:
|
| 12 |
+
os.system("python train.py --dataset dataset")
|
| 13 |
+
|
| 14 |
+
return "Training started!"
|
| 15 |
+
|
| 16 |
+
ui = gr.Interface(
|
| 17 |
+
fn=train_rvc,
|
| 18 |
+
inputs=gr.File(label="Upload dataset.zip"),
|
| 19 |
+
outputs="text",
|
| 20 |
+
title="RVC Trainer"
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
ui.launch()
|