Spaces:
Runtime error
Runtime error
Next
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -23,9 +23,6 @@ def separator(audio):
|
|
23 |
|
24 |
return files
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
def download_audio(url):
|
30 |
ydl_opts = {
|
31 |
'format': 'bestaudio/best',
|
@@ -45,41 +42,25 @@ def download_audio(url):
|
|
45 |
def download_and_show(url):
|
46 |
file_path = download_audio(url)
|
47 |
return file_path
|
48 |
-
|
49 |
|
50 |
with gr.Blocks() as demo:
|
51 |
-
with gr.Tab("
|
52 |
audio_input = gr.Audio(type="numpy", label="Input")
|
53 |
output1 = gr.Audio(type="filepath", label="Stem 1", interactive=False)
|
54 |
output2 = gr.Audio(type="filepath", label="Stem 2", interactive=False)
|
55 |
submit_button = gr.Button("Separate")
|
56 |
-
submit_button.click
|
57 |
-
(
|
58 |
separator,
|
59 |
-
inputs=
|
60 |
-
|
61 |
-
audio_input,
|
62 |
-
],
|
63 |
-
outputs=
|
64 |
-
[
|
65 |
-
output1,
|
66 |
-
output2,
|
67 |
-
],
|
68 |
)
|
69 |
-
with gr.Tab("Download
|
70 |
-
url = gr.Textbox(label="
|
71 |
-
download = gr.Button("
|
72 |
-
download.click
|
73 |
-
(
|
74 |
download_and_show,
|
75 |
-
inputs=
|
76 |
-
|
77 |
-
url,
|
78 |
-
],
|
79 |
-
outputs=
|
80 |
-
[
|
81 |
-
audio_input,
|
82 |
-
],
|
83 |
)
|
84 |
|
85 |
demo.launch()
|
|
|
23 |
|
24 |
return files
|
25 |
|
|
|
|
|
|
|
26 |
def download_audio(url):
|
27 |
ydl_opts = {
|
28 |
'format': 'bestaudio/best',
|
|
|
42 |
def download_and_show(url):
|
43 |
file_path = download_audio(url)
|
44 |
return file_path
|
|
|
45 |
|
46 |
with gr.Blocks() as demo:
|
47 |
+
with gr.Tab("Separator"):
|
48 |
audio_input = gr.Audio(type="numpy", label="Input")
|
49 |
output1 = gr.Audio(type="filepath", label="Stem 1", interactive=False)
|
50 |
output2 = gr.Audio(type="filepath", label="Stem 2", interactive=False)
|
51 |
submit_button = gr.Button("Separate")
|
52 |
+
submit_button.click(
|
|
|
53 |
separator,
|
54 |
+
inputs=[audio_input],
|
55 |
+
outputs=[output1, output2]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
)
|
57 |
+
with gr.Tab("Download YouTube audio for separation"):
|
58 |
+
url = gr.Textbox(label="URL to YouTube")
|
59 |
+
download = gr.Button("Download")
|
60 |
+
download.click(
|
|
|
61 |
download_and_show,
|
62 |
+
inputs=[url],
|
63 |
+
outputs=[audio_input]
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
)
|
65 |
|
66 |
demo.launch()
|