Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,13 +20,15 @@ def run_ultrasinger(opt_i, opt_o, mode, whisper_model, language, crepe_model, ex
|
|
| 20 |
if whisper_model:
|
| 21 |
cmd.extend(["--whisper", whisper_model])
|
| 22 |
if language:
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Add pitcher options
|
| 26 |
-
|
| 27 |
-
cmd.extend(["--crepe", "full"])
|
| 28 |
-
else:
|
| 29 |
-
cmd.extend(["--crepe", "tiny"])
|
| 30 |
|
| 31 |
# Add extra options
|
| 32 |
if extra:
|
|
@@ -51,7 +53,7 @@ def load_text_file(file_path):
|
|
| 51 |
return str(e)
|
| 52 |
|
| 53 |
# Define Gradio inputs and outputs for UltraSinger
|
| 54 |
-
opt_i = gr.File(label="Ultrastar.txt or audio file (.mp3, .wav,
|
| 55 |
opt_o = gr.Textbox(label="Output folder")
|
| 56 |
mode = gr.Dropdown(
|
| 57 |
label="Mode options",
|
|
@@ -66,8 +68,19 @@ whisper_model = gr.Dropdown(
|
|
| 66 |
],
|
| 67 |
value="large-v2"
|
| 68 |
)
|
| 69 |
-
language = gr.
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
extra = gr.Textbox(label="Extra options (e.g., --hyphenation True)")
|
| 72 |
device = gr.Dropdown(
|
| 73 |
label="Device options",
|
|
|
|
| 20 |
if whisper_model:
|
| 21 |
cmd.extend(["--whisper", whisper_model])
|
| 22 |
if language:
|
| 23 |
+
language_codes = {
|
| 24 |
+
"English": "en", "French": "fr", "German": "de", "Spanish": "es",
|
| 25 |
+
"Italian": "it", "Japanese": "ja", "Chinese": "zh", "Dutch": "nl",
|
| 26 |
+
"Ukrainian": "uk", "Portuguese": "pt"
|
| 27 |
+
}
|
| 28 |
+
cmd.extend(["--language", language_codes[language]])
|
| 29 |
|
| 30 |
# Add pitcher options
|
| 31 |
+
cmd.extend(["--crepe", crepe_model])
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Add extra options
|
| 34 |
if extra:
|
|
|
|
| 53 |
return str(e)
|
| 54 |
|
| 55 |
# Define Gradio inputs and outputs for UltraSinger
|
| 56 |
+
opt_i = gr.File(label="Ultrastar.txt or audio file (.mp3, .wav, YouTube link)")
|
| 57 |
opt_o = gr.Textbox(label="Output folder")
|
| 58 |
mode = gr.Dropdown(
|
| 59 |
label="Mode options",
|
|
|
|
| 68 |
],
|
| 69 |
value="large-v2"
|
| 70 |
)
|
| 71 |
+
language = gr.Dropdown(
|
| 72 |
+
label="Language",
|
| 73 |
+
choices=[
|
| 74 |
+
"English", "French", "German", "Spanish", "Italian",
|
| 75 |
+
"Japanese", "Chinese", "Dutch", "Ukrainian", "Portuguese"
|
| 76 |
+
],
|
| 77 |
+
value="English"
|
| 78 |
+
)
|
| 79 |
+
crepe_model = gr.Radio(
|
| 80 |
+
label="Crepe Model",
|
| 81 |
+
choices=["full", "tiny"],
|
| 82 |
+
value="full"
|
| 83 |
+
)
|
| 84 |
extra = gr.Textbox(label="Extra options (e.g., --hyphenation True)")
|
| 85 |
device = gr.Dropdown(
|
| 86 |
label="Device options",
|