Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def generate_audio(text,):
|
|
| 39 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f:
|
| 40 |
sf.write(f.name, out["audio"][0].T, out["sampling_rate"])
|
| 41 |
|
| 42 |
-
return
|
| 43 |
|
| 44 |
css = """
|
| 45 |
#container{
|
|
@@ -63,8 +63,8 @@ with gr.Blocks(css=css) as demo_blocks:
|
|
| 63 |
btn = gr.Button("Generate Music! πΆ")
|
| 64 |
|
| 65 |
with gr.Column():
|
| 66 |
-
out_vid = gr.make_waveform(animate=True,)
|
| 67 |
out = gr.Audio(autoplay=False, label=f"Generated Music", show_label=True,)
|
|
|
|
| 68 |
|
| 69 |
with gr.Accordion("Use MusicGen with Transformers π€", open=False):
|
| 70 |
gr.Markdown(
|
|
@@ -89,7 +89,7 @@ with gr.Blocks(css=css) as demo_blocks:
|
|
| 89 |
"""
|
| 90 |
)
|
| 91 |
|
| 92 |
-
btn.click(generate_audio, inp_text, [
|
| 93 |
|
| 94 |
|
| 95 |
demo_blocks.queue().launch()
|
|
|
|
| 39 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f:
|
| 40 |
sf.write(f.name, out["audio"][0].T, out["sampling_rate"])
|
| 41 |
|
| 42 |
+
return f.name, output
|
| 43 |
|
| 44 |
css = """
|
| 45 |
#container{
|
|
|
|
| 63 |
btn = gr.Button("Generate Music! πΆ")
|
| 64 |
|
| 65 |
with gr.Column():
|
|
|
|
| 66 |
out = gr.Audio(autoplay=False, label=f"Generated Music", show_label=True,)
|
| 67 |
+
prompt_text = gr.Textbox(label="Upsampled Prompt")
|
| 68 |
|
| 69 |
with gr.Accordion("Use MusicGen with Transformers π€", open=False):
|
| 70 |
gr.Markdown(
|
|
|
|
| 89 |
"""
|
| 90 |
)
|
| 91 |
|
| 92 |
+
btn.click(generate_audio, inp_text, [out, prompt_text])
|
| 93 |
|
| 94 |
|
| 95 |
demo_blocks.queue().launch()
|