Spaces:
Build error
Build error
trying fix
Browse filesFiles changed (2)
- app.py+1-1
- app_batched.py+120-61
181 unmodified lines182183184185186187188181 unmodified linesparser.add_argument('--listen',type=str,default='127.0.0.1',help='IP to listen on for connections to Gradio',)parser.add_argument(181 unmodified lines182183184185186187188181 unmodified linesparser.add_argument('--listen',type=str,default='0.0.0.0',help='IP to listen on for connections to Gradio',)parser.add_argument(
95 unmodified lines9697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216395 unmodified linesreturn reswith gr.Blocks() as demo:gr.Markdown("""# MusicGenThis is the demo for [MusicGen](https://github.com/facebookresearch/audiocraft), a simple and controllable model for music generationpresented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284).<br/><a href="https://huggingface.co/spaces/musicgen/MusicGen?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank"><img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>for longer sequences, more control and no queue.</p>""")with gr.Row():with gr.Column():with gr.Row():text = gr.Text(label="Describe your music", lines=2, interactive=True)melody = gr.Audio(source="upload", type="numpy", label="Condition on a melody (optional)", interactive=True)with gr.Row():submit = gr.Button("Generate")with gr.Column():output = gr.Video(label="Generated Music")submit.click(predict, inputs=[text, melody], outputs=[output], batch=True, max_batch_size=8)gr.Examples(fn=predict,examples=[["An 80s driving pop song with heavy drums and synth pads in the background","./assets/bach.mp3",],["A cheerful country song with acoustic guitars","./assets/bolero_ravel.mp3",],["90s rock song with electric guitar and heavy drums",None,],["a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions bpm: 130","./assets/bach.mp3",],["lofi slow bpm electro chill with organic samples",None,],],inputs=[text, melody],outputs=[output])gr.Markdown("""### More detailsThe model will generate 12 seconds of audio based on the description you provided.You can optionaly provide a reference audio from which a broad melody will be extracted.The model will then try to follow both the description and melody provided.All samples are generated with the `melody` model.You can also use your own GPU or a Google Colab by following the instructions on our repo.See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)for more details.""")demo.queue(max_size=8 * 4).launch()95 unmodified lines9697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122295 unmodified linesreturn resdef ui(**kwargs):with gr.Blocks() as demo:gr.Markdown("""# MusicGenThis is the demo for [MusicGen](https://github.com/facebookresearch/audiocraft), a simple and controllable model for music generationpresented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284).<br/><a href="https://huggingface.co/spaces/musicgen/MusicGen?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank"><img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>for longer sequences, more control and no queue.</p>""")with gr.Row():with gr.Column():with gr.Row():text = gr.Text(label="Describe your music", lines=2, interactive=True)melody = gr.Audio(source="upload", type="numpy", label="Condition on a melody (optional)", interactive=True)with gr.Row():submit = gr.Button("Generate")with gr.Column():output = gr.Video(label="Generated Music")submit.click(predict, inputs=[text, melody], outputs=[output], batch=True, max_batch_size=8)gr.Examples(fn=predict,examples=[["An 80s driving pop song with heavy drums and synth pads in the background","./assets/bach.mp3",],["A cheerful country song with acoustic guitars","./assets/bolero_ravel.mp3",],["90s rock song with electric guitar and heavy drums",None,],["a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions bpm: 130","./assets/bach.mp3",],["lofi slow bpm electro chill with organic samples",None,],],inputs=[text, melody],outputs=[output])gr.Markdown("""### More detailsThe model will generate 12 seconds of audio based on the description you provided.You can optionaly provide a reference audio from which a broad melody will be extracted.The model will then try to follow both the description and melody provided.All samples are generated with the `melody` model.You can also use your own GPU or a Google Colab by following the instructions on our repo.See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)for more details.""")# Show the interfacelaunch_kwargs = {}username = kwargs.get('username')password = kwargs.get('password')server_port = kwargs.get('server_port', 0)inbrowser = kwargs.get('inbrowser', False)share = kwargs.get('share', False)server_name = kwargs.get('listen')launch_kwargs['server_name'] = server_nameif username and password:launch_kwargs['auth'] = (username, password)if server_port > 0:launch_kwargs['server_port'] = server_portif inbrowser:launch_kwargs['inbrowser'] = inbrowserif share:launch_kwargs['share'] = sharedemo.queue(max_size=8 * 4).launch(**launch_kwargs)if __name__ == "__main__":parser = argparse.ArgumentParser()parser.add_argument('--listen',type=str,default='0.0.0.0',help='IP to listen on for connections to Gradio',)parser.add_argument('--username', type=str, default='', help='Username for authentication')parser.add_argument('--password', type=str, default='', help='Password for authentication')parser.add_argument('--server_port',type=int,default=0,help='Port to run the server listener on',)parser.add_argument('--inbrowser', action='store_true', help='Open in browser')parser.add_argument('--share', action='store_true', help='Share the gradio UI')args = parser.parse_args()ui(username=args.username,password=args.password,inbrowser=args.inbrowser,server_port=args.server_port,share=args.share,listen=args.listen)
app.py+1-1
app_batched.py+120-61