Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def inference(file_uploaded, composer):
|
|
59 |
|
60 |
|
61 |
# Thanks a lot to "https://huggingface.co/Taithrah" for this theme.
|
62 |
-
# taken from https://huggingface.co/spaces/
|
63 |
block = gr.Blocks(theme="Taithrah/Minimal")
|
64 |
|
65 |
with block:
|
@@ -86,34 +86,30 @@ with block:
|
|
86 |
"""
|
87 |
)
|
88 |
with gr.Group():
|
89 |
-
with gr.
|
90 |
-
|
91 |
-
file_uploaded = gr.Audio(label="Upload an audio", type="filepath")
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
yt_audio_path = gr.Audio(label="Audio Extracted from the YouTube Video", interactive=False)
|
100 |
-
|
101 |
-
yt_btn.click(get_audio_from_yt_video, inputs=[yt_link], outputs=[yt_audio_path, file_uploaded])
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
|
|
|
117 |
gr.Examples([
|
118 |
["./examples/custom_song.mp3", "composer1"],
|
119 |
["./examples/BornThisWay.mp3", "composer1"],
|
@@ -127,7 +123,20 @@ with block:
|
|
127 |
gr.HTML(
|
128 |
"""
|
129 |
<div class="footer">
|
130 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
</p>
|
132 |
</div>
|
133 |
"""
|
|
|
59 |
|
60 |
|
61 |
# Thanks a lot to "https://huggingface.co/Taithrah" for this theme.
|
62 |
+
# taken from https://huggingface.co/spaces/NoCrypt/miku
|
63 |
block = gr.Blocks(theme="Taithrah/Minimal")
|
64 |
|
65 |
with block:
|
|
|
86 |
"""
|
87 |
)
|
88 |
with gr.Group():
|
89 |
+
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
90 |
+
file_uploaded = gr.Audio(label="Upload an audio", type="filepath")
|
|
|
91 |
|
92 |
+
with gr.Column():
|
93 |
+
with gr.Row():
|
94 |
+
yt_link = gr.Textbox(label="Enter YouTube link of the Video", autofocus=True)
|
95 |
+
yt_btn = gr.Button("Get Audio from the YT link(Press this before pressing Generate)")
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
yt_audio_path = gr.Audio(label="Audio Extracted from the YouTube Video", interactive=False)
|
98 |
+
yt_btn.click(get_audio_from_yt_video, inputs=[yt_link], outputs=[yt_audio_path, file_uploaded])
|
99 |
+
|
100 |
+
with gr.Group():
|
101 |
+
with gr.Column():
|
102 |
+
composer = gr.Dropdown(label="Arranger", choices=composers, value="composer1")
|
103 |
+
btn = gr.Button("Generate")
|
104 |
|
105 |
+
with gr.Group():
|
106 |
+
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
107 |
+
wav_output2 = gr.File(label="Download the Generated MIDI (.wav)")
|
108 |
+
wav_output1 = gr.Audio(label="Listen to the Generated MIDI")
|
109 |
+
midi_output = gr.File(label="Download the Generated MIDI (.mid)")
|
110 |
+
btn.click(inference, inputs=[file_uploaded, composer], outputs=[wav_output1, wav_output2, midi_output])
|
111 |
|
112 |
+
with gr.Group():
|
113 |
gr.Examples([
|
114 |
["./examples/custom_song.mp3", "composer1"],
|
115 |
["./examples/BornThisWay.mp3", "composer1"],
|
|
|
123 |
gr.HTML(
|
124 |
"""
|
125 |
<div class="footer">
|
126 |
+
<center>The design for this Space is taken from <a href="https://huggingface.co/spaces/NoCrypt/miku"> NoCrypt/miku </a>
|
127 |
+
</p>
|
128 |
+
</div>
|
129 |
+
"""
|
130 |
+
)
|
131 |
+
|
132 |
+
gr.HTML(
|
133 |
+
"""
|
134 |
+
<div class="footer">
|
135 |
+
<center><p><a href="http://sweetcocoa.github.io/pop2piano_samples" style="text-decoration: underline;" target="_blank">Project Page</a>
|
136 |
+
<center><a href="https://huggingface.co/docs/transformers/main/model_doc/pop2piano" style="text-decoration: underline;" target="_blank">HuggingFace Model Card</a>
|
137 |
+
<center><a href="http://sweetcocoa.github.io/pop2piano_samples" style="text-decoration: underline;" target="_blank">Github</a>
|
138 |
+
|
139 |
+
|
140 |
</p>
|
141 |
</div>
|
142 |
"""
|