File size: 31,516 Bytes
3f56d56
2e667cb
a677c6f
15f6d19
75d3f3c
eb1c729
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5cb13ea
1036aef
d52c44f
1036aef
 
 
4788471
1036aef
 
 
 
 
 
 
 
 
 
 
 
2cc588e
 
 
 
 
 
37e4a75
 
 
 
 
 
 
 
 
 
 
 
 
 
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37e4a75
 
 
 
 
 
1036aef
2cc588e
1036aef
 
2e667cb
1036aef
 
 
 
2ac2781
1036aef
 
 
 
 
2ac2781
1036aef
 
 
 
 
 
 
 
2ac2781
1036aef
 
 
 
 
2ac2781
1036aef
 
 
 
2cc588e
 
 
 
 
 
2ac2781
1036aef
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
2cc588e
1036aef
 
2ac2781
1036aef
 
 
 
2ac2781
1036aef
 
 
 
 
2ac2781
1036aef
 
 
 
 
 
 
 
2ac2781
1036aef
 
 
 
 
2ac2781
1036aef
 
 
 
2cc588e
 
 
 
 
 
2ac2781
1036aef
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
2ac2781
 
1036aef
 
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
2cc588e
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2cc588e
 
 
 
 
 
 
1036aef
 
 
 
2ac2781
 
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2cc588e
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3f56d56
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
2cc588e
 
 
 
 
 
 
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2cc588e
 
1036aef
 
 
 
 
 
 
 
2cc588e
1036aef
ad9fa56
1036aef
 
 
824e8a4
1036aef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ad9fa56
 
 
 
 
 
 
 
3a2a3a0
 
1036aef
 
 
 
3a2a3a0
1036aef
 
 
 
 
 
 
 
 
 
 
00523fc
 
24dac05
00523fc
 
 
 
 
e42de32
ad9fa56
1036aef
 
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
import gradio as gr
from separwator import *
import os, subprocess
import gc, re

def leaderboard(list_filter, list_limit):
    try:
        result = subprocess.run(
            ["audio-separator", "-l", f"--list_filter={list_filter}", f"--list_limit={list_limit}"],
            capture_output=True,
            text=True,
        )
        if result.returncode != 0:
            return f"Error: {result.stderr}"
        
        return "<table border='1'>" + "".join(
            f"<tr style='{'font-weight: bold; font-size: 1.2em;' if i == 0 else ''}'>" + 
            "".join(f"<td>{cell}</td>" for cell in re.split(r"\s{2,}", line.strip())) + 
            "</tr>" 
            for i, line in enumerate(re.findall(r"^(?!-+)(.+)$", result.stdout.strip(), re.MULTILINE))
        ) + "</table>"
    
    except Exception as e:
        return f"Error: {e}"



with gr.Blocks(theme=gr.themes.Base(), title = "🎵 Audio Separator UI 🎵") as app:
    with gr.Row():
        gr.Markdown("<h1><center> 🎵 Audio Separator UI 🎵")
    with gr.Row():
        with gr.Tabs():
            with gr.TabItem("BS/Mel Roformer"):
                with gr.Row():
                    roformer_model = gr.Dropdown(
                        label = "Select the model",
                        choices = list(roformer_models.keys()),
                        value = lambda : None,
                        interactive = True
                    )
                    roformer_output_format = gr.Dropdown(
                        label = "Select the output format",
                        choices = output_format,
                        value = lambda : None,
                        interactive = True
                    )
                with gr.Row():
                    roformer_audio = gr.Audio(
                        label = "Input audio",
                        type = "filepath",
                        interactive = True
                    )
                with gr.Column():
                    with gr.Accordion("Advanced settings", open = False):
                        with gr.Group():
                            with gr.Row():
                                roformer_segment_size = gr.Slider(
                                    label = "Segment size",
                                    info = "Larger consumes more resources, but may give better results",
                                    minimum = 32,
                                    maximum = 4000,
                                    step = 32,
                                    value = 256,
                                    interactive = True
                                )
                                
                            roformer_override_segment_size = gr.Checkbox(
                                label = "Override segment size",
                                info = "Override model default segment size instead of using the model default value",
                                value = False,
                                interactive = True
                            )
                        with gr.Row():
                            roformer_overlap = gr.Slider(
                                label = "Overlap",
                                info = "Amount of overlap between prediction windows",
                                minimum = 2,
                                maximum = 10,
                                step = 1,
                                value = 8,
                                interactive = True
                            )
                            roformer_batch_size = gr.Slider(
                                label = "Batch size",
                                info = "Larger consumes more RAM but may process slightly faster",
                                minimum = 1,
                                maximum = 16,
                                step = 1,
                                value = 1,
                                interactive = True
                            )
                        with gr.Row():
                            roformer_normalization_threshold = gr.Slider(
                                label = "Normalization threshold",
                                info = "The threshold for audio normalization",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                            roformer_amplification_threshold = gr.Slider(label = "Amplification threshold",info = "The threshold for audio amplification", minimum = 0.1,maximum = 1,step = 0.1,value = 0.1,interactive = True)
                                
                                
                                
                                                       
                                
                
                    
                
                with gr.Row():
                    roformer_button = gr.Button("Separate!", variant = "primary")
                with gr.Row():
                    roformer_stem1 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        label = "Stem 1",
                        type = "filepath"
                    )
                    roformer_stem2 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        label = "Stem 2",
                        type = "filepath"
                    )

                roformer_button.click(roformer_separator, [roformer_audio, roformer_model, roformer_output_format, roformer_segment_size, roformer_override_segment_size, roformer_overlap, roformer_batch_size, roformer_normalization_threshold, roformer_amplification_threshold], [roformer_stem1, roformer_stem2])

            with gr.TabItem("MDX23C"):
                with gr.Row():
                    mdx23c_model = gr.Dropdown(
                        label = "Select the model",
                        choices = mdx23c_models,
                        value = lambda : None,
                        interactive = True
                    )
                    mdx23c_output_format = gr.Dropdown(
                        label = "Select the output format",
                        choices = output_format,
                        value = lambda : None,
                        interactive = True
                    )
                with gr.Row():
                    mdx23c_audio = gr.Audio(
                        label = "Input audio",
                        type = "filepath",
                        interactive = True
                    )
                with gr.Accordion("Advanced settings", open = False):
                    with gr.Group():
                        with gr.Row():
                            mdx23c_segment_size = gr.Slider(
                                minimum = 32,
                                maximum = 4000,
                                step = 32,
                                label = "Segment size",
                                info = "Larger consumes more resources, but may give better results",
                                value = 256,
                                interactive = True
                            )
                            mdx23c_override_segment_size = gr.Checkbox(
                                label = "Override segment size",
                                info = "Override model default segment size instead of using the model default value",
                                value = False,
                                interactive = True
                            )
                        with gr.Row():
                            mdx23c_overlap = gr.Slider(
                                minimum = 2,
                                maximum = 50,
                                step = 1,
                                label = "Overlap",
                                info = "Amount of overlap between prediction windows",
                                value = 8,
                                interactive = True
                            )
                            mdx23c_batch_size = gr.Slider(
                                label = "Batch size",
                                info = "Larger consumes more RAM but may process slightly faster",
                                minimum = 1,
                                maximum = 16,
                                step = 1,
                                value = 1,
                                interactive = True
                            )
                        with gr.Row():
                            mdx23c_normalization_threshold = gr.Slider(
                                label = "Normalization threshold",
                                info = "The threshold for audio normalization",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                            mdx23c_amplification_threshold = gr.Slider(
                                label = "Amplification threshold",
                                info = "The threshold for audio amplification",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                
                
                with gr.Row():
                    mdx23c_button = gr.Button("Separate!", variant = "primary")
                with gr.Row():
                    mdx23c_stem1 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        label = "Stem 1",
                        type = "filepath"
                    )
                    mdx23c_stem2 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        label = "Stem 2",
                        type = "filepath"
                    )

                mdx23c_button.click(mdxc_separator, [mdx23c_audio, mdx23c_model, mdx23c_output_format, mdx23c_segment_size, mdx23c_override_segment_size, mdx23c_overlap, mdx23c_batch_size, mdx23c_normalization_threshold, mdx23c_amplification_threshold], [mdx23c_stem1, mdx23c_stem2])
                
            with gr.TabItem("MDX-NET"):
                with gr.Row():
                    mdxnet_model = gr.Dropdown(
                        label = "Select the model",
                        choices = mdxnet_models,
                        value = lambda : None,
                        interactive = True
                    )
                    mdxnet_output_format = gr.Dropdown(
                        label = "Select the output format",
                        choices = output_format,
                        value = lambda : None,
                        interactive = True
                    )
                with gr.Row():
                    mdxnet_audio = gr.Audio(
                        label = "Input audio",
                        type = "filepath",
                        interactive = True
                    )
                with gr.Accordion("Advanced settings", open = False):
                    with gr.Group():
                        with gr.Row():
                            mdxnet_hop_length = gr.Slider(
                                label = "Hop length",
                                info = "Usually called stride in neural networks; only change if you know what you're doing",
                                minimum = 32,
                                maximum = 2048,
                                step = 32,
                                value = 1024,
                                interactive = True
                            )
                            mdxnet_segment_size = gr.Slider(
                                minimum = 32,
                                maximum = 4000,
                                step = 32,
                                label = "Segment size",
                                info = "Larger consumes more resources, but may give better results",
                                value = 256,
                                interactive = True
                            )
                            mdxnet_denoise = gr.Checkbox(
                                label = "Denoise",
                                info = "Enable denoising during separation",
                                value = True,
                                interactive = True
                            )
                        with gr.Row():
                            mdxnet_overlap = gr.Slider(
                                label = "Overlap",
                                info = "Amount of overlap between prediction windows",
                                minimum = 0.001,
                                maximum = 0.999,
                                step = 0.001,
                                value = 0.25,
                                interactive = True
                            )
                            mdxnet_batch_size = gr.Slider(
                                label = "Batch size",
                                info = "Larger consumes more RAM but may process slightly faster",
                                minimum = 1,
                                maximum = 16,
                                step = 1,
                                value = 1,
                                interactive = True
                            )
                        with gr.Row():
                            mdxnet_normalization_threshold = gr.Slider(
                                label = "Normalization threshold",
                                info = "The threshold for audio normalization",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                            mdxnet_amplification_threshold = gr.Slider(
                                label = "Amplification threshold",
                                info = "The threshold for audio amplification",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                
                
                
                with gr.Row():
                    mdxnet_button = gr.Button("Separate!", variant = "primary")
                with gr.Row():
                    mdxnet_stem1 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        label = "Stem 1",
                        type = "filepath"
                    )
                    mdxnet_stem2 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        label = "Stem 2",
                        type = "filepath"
                    )

                mdxnet_button.click(mdxnet_separator, [mdxnet_audio, mdxnet_model, mdxnet_output_format, mdxnet_hop_length, mdxnet_segment_size, mdxnet_denoise, mdxnet_overlap, mdxnet_batch_size, mdxnet_normalization_threshold, mdxnet_amplification_threshold], [mdxnet_stem1, mdxnet_stem2])

            with gr.TabItem("VR ARCH"):
                with gr.Row():
                    vrarch_model = gr.Dropdown(
                        label = "Select the model",
                        choices = vrarch_models,
                        value = lambda : None,
                        interactive = True
                    )
                    vrarch_output_format = gr.Dropdown(
                        label = "Select the output format",
                        choices = output_format,
                        value = lambda : None,
                        interactive = True
                    )
                with gr.Row():
                    vrarch_audio = gr.Audio(
                        label = "Input audio",
                        type = "filepath",
                        interactive = True
                    )
                
                with gr.Accordion("Advanced settings", open = False):
                    with gr.Group():
                        with gr.Row():
                            vrarch_window_size = gr.Slider(
                                label = "Window size",
                                info = "Balance quality and speed. 1024 = fast but lower, 320 = slower but better quality",
                                minimum=320,
                                maximum=1024,
                                step=32,
                                value = 512,
                                interactive = True
                            )
                            vrarch_agression = gr.Slider(
                                minimum = 1,
                                maximum = 50,
                                step = 1,
                                label = "Agression",
                                info = "Intensity of primary stem extraction",
                                value = 5,
                                interactive = True
                            )
                            vrarch_tta = gr.Checkbox(
                                label = "TTA",
                                info = "Enable Test-Time-Augmentation; slow but improves quality",
                                value = True,
                                visible = True,
                                interactive = True
                            )
                        with gr.Row():
                            vrarch_post_process = gr.Checkbox(
                                label = "Post process",
                                info = "Identify leftover artifacts within vocal output; may improve separation for some songs",
                                value = False,
                                visible = True,
                                interactive = True
                            )
                            vrarch_post_process_threshold = gr.Slider(
                                label = "Post process threshold",
                                info = "Threshold for post-processing",
                                minimum = 0.1,
                                maximum = 0.3,
                                step = 0.1,
                                value = 0.2,
                                interactive = True
                            )
                        with gr.Row():
                            vrarch_high_end_process = gr.Checkbox(
                                label = "High end process",
                                info = "Mirror the missing frequency range of the output",
                                value = False,
                                visible = True,
                                interactive = True,
                            )
                            vrarch_batch_size = gr.Slider(
                                label = "Batch size",
                                info = "Larger consumes more RAM but may process slightly faster",
                                minimum = 1,
                                maximum = 16,
                                step = 1,
                                value = 1,
                                interactive = True
                            )
                        with gr.Row():
                            vrarch_normalization_threshold = gr.Slider(
                                label = "Normalization threshold",
                                info = "The threshold for audio normalization",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                            vrarch_amplification_threshold = gr.Slider(
                                label = "Amplification threshold",
                                info = "The threshold for audio amplification",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                
                
                with gr.Row():
                    vrarch_button = gr.Button("Separate!", variant = "primary")
                with gr.Row():
                    vrarch_stem1 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 1"
                    )
                    vrarch_stem2 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 2"
                    )

                vrarch_button.click(vrarch_separator, [vrarch_audio, vrarch_model, vrarch_output_format, vrarch_window_size, vrarch_agression, vrarch_tta, vrarch_post_process, vrarch_post_process_threshold, vrarch_high_end_process, vrarch_batch_size, vrarch_normalization_threshold, vrarch_amplification_threshold], [vrarch_stem1, vrarch_stem2])

            with gr.TabItem("Demucs"):
                with gr.Row():
                    demucs_model = gr.Dropdown(
                        label = "Select the model",
                        choices = demucs_models,
                        value = lambda : None,
                        interactive = True
                    )
                    demucs_output_format = gr.Dropdown(
                        label = "Select the output format",
                        choices = output_format,
                        value = lambda : None,             
                        interactive = True
                    )
                with gr.Row():
                    demucs_audio = gr.Audio(
                        label = "Input audio",
                        type = "filepath",
                        interactive = True
                    )
                with gr.Accordion("Advanced settings", open = False):
                    with gr.Group():
                        with gr.Row():
                            demucs_shifts = gr.Slider(
                                label = "Shifts",
                                info = "Number of predictions with random shifts, higher = slower but better quality",
                                minimum = 1,
                                maximum = 20,
                                step = 1,
                                value = 2,
                                interactive = True
                            )
                            demucs_segment_size = gr.Slider(
                                label = "Segment size",
                                info = "Size of segments into which the audio is split. Higher = slower but better quality",
                                minimum = 1,
                                maximum = 100,
                                step = 1,
                                value = 40,
                                interactive = True
                            )
                            demucs_segments_enabled = gr.Checkbox(
                                label = "Segment-wise processing",
                                info = "Enable segment-wise processing",
                                value = True,
                                interactive = True
                            )
                        with gr.Row():
                            demucs_overlap = gr.Slider(
                                label = "Overlap",
                                info = "Overlap between prediction windows. Higher = slower but better quality",
                                minimum=0.001,
                                maximum=0.999,
                                step=0.001,
                                value = 0.25,
                                interactive = True
                            )
                            demucs_batch_size = gr.Slider(
                                label = "Batch size",
                                info = "Larger consumes more RAM but may process slightly faster",
                                minimum = 1,
                                maximum = 16,
                                step = 1,
                                value = 1,
                                interactive = True
                            )
                        with gr.Row():
                            demucs_normalization_threshold = gr.Slider(
                                label = "Normalization threshold",
                                info = "The threshold for audio normalization",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                            demucs_amplification_threshold = gr.Slider(
                                label = "Amplification threshold",
                                info = "The threshold for audio amplification",
                                minimum = 0.1,
                                maximum = 1,
                                step = 0.1,
                                value = 0.1,
                                interactive = True
                            )
                        
                
                    with gr.Row():
                        gr.Markdown("You can paste the link to the video/audio from many sites, check the complete list [here](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)")
                    with gr.Row():
                        demucs_download_button = gr.Button(
                            "Download!",
                            variant = "primary"
                        )

                
                
                    

                
                with gr.Row():
                    demucs_button = gr.Button("Separate!", variant = "primary")
                with gr.Row():
                    demucs_stem1 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 1"
                    )
                    demucs_stem2 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 2"
                    )
                with gr.Row():
                    demucs_stem3 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 3"
                    )
                    demucs_stem4 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 4"
                    )
                with gr.Row(visible=False) as stem6:
                    demucs_stem5 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 5"
                    )
                    demucs_stem6 = gr.Audio(
                        show_download_button = True,
                        interactive = False,
                        type = "filepath",
                        label = "Stem 6"
                    )

                demucs_model.change(update_stems, inputs=[demucs_model], outputs=stem6)
                
                demucs_button.click(demucs_separator, [demucs_audio, demucs_model, demucs_output_format, demucs_shifts, demucs_segment_size, demucs_segments_enabled, demucs_overlap, demucs_batch_size, demucs_normalization_threshold, demucs_amplification_threshold], [demucs_stem1, demucs_stem2, demucs_stem3, demucs_stem4, demucs_stem5, demucs_stem6])


            with gr.Tab("Leaderboard"):
                with gr.Row(equal_height=True):
                    list_filter = gr.Dropdown(value="vocals", choices=["vocals", "instrumental", "drums", "bass", "guitar", "piano", "other"], label="List filter", info="Filter and sort the model list by 'stem'")
                    list_limit = gr.Slider(minimum=1, maximum=10, step=1, value=5, label="List limit", info="Limit the number of models shown.")
                    list_button = gr.Button("Show list", variant="primary")
                output_list = gr.HTML(label="Leaderboard")

            list_button.click(leaderboard, inputs=[list_filter, list_limit], outputs=output_list)

            
            with gr.TabItem("Credits"):
                gr.Markdown(
                    """
                    audio separator UI created by [Eddycrack 864](https://github.com/Eddycrack864) & [_noxty](https://huggingface.co/theNeofr).
                    * python-audio-separator by [beveradb](https://github.com/beveradb).
                    * Thanks to [Mikus](https://github.com/cappuch) for the help with the code.
                    * Thanks to [Nick088](https://huggingface.co/Nick088) for the help to fix roformers.
                    * Thanks to [ArisDev](https://github.com/aris-py) for porting UVR5 UI to Kaggle and improvements.
                    * Thanks to [Bebra777228](https://github.com/Bebra777228)'s code for guiding me to improve my code.
                    
                    
                    You can donate to the original UVR5 project here:
                    [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/uvr5)
                    """
                )
                gr.Markdown(
                    """
                    <h1> similar of this project\n
                    [Audio_separator by r3gm](https://huggingface.co/spaces/r3gm/Audio_separator)\n
                    [Audio-Separator by Politrees](https://huggingface.co/spaces/Politrees/Audio-Separator)\n
                    [UVR5 UI by Eddycrack 864](https://huggingface.co/spaces/Eddycrack864/UVR5-UI)
                    """
                )

            
app.queue()
app.launch(share=True, debug=True)