Spaces:
Running
on
Zero
Running
on
Zero
chong.zhang
commited on
Commit
·
22ee199
1
Parent(s):
84d3675
update
Browse files
app.py
CHANGED
@@ -136,33 +136,34 @@ def main():
|
|
136 |
label="Generate Audio Length (s)",
|
137 |
value=30)
|
138 |
|
139 |
-
with gr.Row(equal_height=True):
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
type="filepath")
|
144 |
-
music_output = gr.Audio(label="Generated Music", type="filepath")
|
145 |
-
|
146 |
-
with gr.Row():
|
147 |
-
button = gr.Button("Text to Music")
|
148 |
-
button.click(demo_inspiremusic_t2m,
|
149 |
-
inputs=[text_input, model_name,
|
150 |
-
chorus,
|
151 |
-
output_sample_rate,
|
152 |
-
max_generate_audio_seconds],
|
153 |
-
outputs=music_output)
|
154 |
|
155 |
-
|
156 |
-
|
|
|
157 |
inputs=[text_input, audio_input, model_name,
|
158 |
chorus,
|
159 |
output_sample_rate,
|
160 |
max_generate_audio_seconds],
|
161 |
-
outputs=
|
162 |
demo.launch()
|
163 |
|
164 |
if __name__ == '__main__':
|
165 |
-
model_list = ["InspireMusic-1.5B-Long", "InspireMusic-1.5B", "InspireMusic-Base"]
|
|
|
166 |
|
167 |
for model_name in model_list:
|
168 |
model_dir = f"pretrained_models/{model_name}"
|
|
|
136 |
label="Generate Audio Length (s)",
|
137 |
value=30)
|
138 |
|
139 |
+
# with gr.Row(equal_height=True):
|
140 |
+
text_input = gr.Textbox(label="Input Text (For Text-to-Music Task)", value="Experience soothing and sensual instrumental jazz with a touch of Bossa Nova, perfect for a relaxing restaurant or spa ambiance.")
|
141 |
+
music_output = gr.Audio(label="Text to Music Output", type="filepath")
|
142 |
+
|
143 |
+
button = gr.Button("Text to Music")
|
144 |
+
button.click(demo_inspiremusic_t2m,
|
145 |
+
inputs=[text_input, model_name,
|
146 |
+
chorus,
|
147 |
+
output_sample_rate,
|
148 |
+
max_generate_audio_seconds],
|
149 |
+
outputs=music_output)
|
150 |
+
|
151 |
+
audio_input = gr.Audio(label="Input Audio Prompt (For Music Continuation Task)",
|
152 |
type="filepath")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
+
music_con_output = gr.Audio(label="Music Continuation Output", type="filepath")
|
155 |
+
generate_button = gr.Button("Music Continuation")
|
156 |
+
generate_button.click(demo_inspiremusic_con,
|
157 |
inputs=[text_input, audio_input, model_name,
|
158 |
chorus,
|
159 |
output_sample_rate,
|
160 |
max_generate_audio_seconds],
|
161 |
+
outputs=music_con_output)
|
162 |
demo.launch()
|
163 |
|
164 |
if __name__ == '__main__':
|
165 |
+
# model_list = ["InspireMusic-1.5B-Long", "InspireMusic-1.5B", "InspireMusic-Base"]
|
166 |
+
model_list = ["InspireMusic-Base"]
|
167 |
|
168 |
for model_name in model_list:
|
169 |
model_dir = f"pretrained_models/{model_name}"
|