Spaces:
Running
Running
jhj0517
commited on
Commit
·
545761a
1
Parent(s):
9b63534
Add tab
Browse files
app.py
CHANGED
@@ -197,6 +197,7 @@ class App:
|
|
197 |
translation_params = self.default_params["translation"]
|
198 |
deepl_params = translation_params["deepl"]
|
199 |
nllb_params = translation_params["nllb"]
|
|
|
200 |
|
201 |
with self.app:
|
202 |
with gr.Row():
|
@@ -341,6 +342,29 @@ class App:
|
|
341 |
btn_openfolder.click(fn=lambda: self.open_folder(os.path.join(self.args.output_dir, "translations")),
|
342 |
inputs=None,
|
343 |
outputs=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
|
345 |
# Launch the app with optional gradio settings
|
346 |
args = self.args
|
|
|
197 |
translation_params = self.default_params["translation"]
|
198 |
deepl_params = translation_params["deepl"]
|
199 |
nllb_params = translation_params["nllb"]
|
200 |
+
uvr_params = self.default_params["bgm_separation"]
|
201 |
|
202 |
with self.app:
|
203 |
with gr.Row():
|
|
|
342 |
btn_openfolder.click(fn=lambda: self.open_folder(os.path.join(self.args.output_dir, "translations")),
|
343 |
inputs=None,
|
344 |
outputs=None)
|
345 |
+
with gr.TabItem("BGM Separation"):
|
346 |
+
files_audio = gr.Files(type="filepath", label="Upload Audio Files to separate background music")
|
347 |
+
dd_uvr_device = gr.Dropdown(label="Device", value=self.whisper_inf.music_separator.device,
|
348 |
+
choices=self.whisper_inf.music_separator.available_devices)
|
349 |
+
dd_uvr_model_size = gr.Dropdown(label="Model", value=uvr_params["model_size"],
|
350 |
+
choices=self.whisper_inf.music_separator.available_models)
|
351 |
+
nb_uvr_segment_size = gr.Number(label="Segment Size", value=uvr_params["segment_size"], precision=0)
|
352 |
+
cb_uvr_save_file = gr.Checkbox(label="Save separated files to output",
|
353 |
+
value=uvr_params["save_file"])
|
354 |
+
btn_run = gr.Button("SEPARATE BACKGROUND MUSIC", variant="primary")
|
355 |
+
with gr.Row():
|
356 |
+
with gr.Column(scale=8):
|
357 |
+
ad_instrumental = gr.Audio(label="Instrumental")
|
358 |
+
ad_vocals = gr.Audio(label="Vocals")
|
359 |
+
with gr.Column(scale=1):
|
360 |
+
btn_openfolder = gr.Button('📂', scale=1)
|
361 |
+
|
362 |
+
btn_run.click(fn=self.whisper_inf.music_separator.separate,
|
363 |
+
inputs=[files_audio, dd_uvr_device, dd_uvr_model_size, nb_uvr_segment_size, cb_uvr_save_file],
|
364 |
+
outputs=[ad_instrumental, ad_vocals])
|
365 |
+
btn_openfolder.click(inputs=None,
|
366 |
+
outputs=None,
|
367 |
+
fn=lambda: self.open_folder(os.path.join(self.args.output_dir, "uvr")))
|
368 |
|
369 |
# Launch the app with optional gradio settings
|
370 |
args = self.args
|