facebookresearch / audiocraft

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.
MIT License
20.59k stars 2.09k forks source link

audiogen_app.py #185

Open cocktailpeanut opened 1 year ago

cocktailpeanut commented 1 year ago

A Gradio web UI for the new AudioGen module.

Forked from musicgen_app.py and removed some parts that I think are not relevant for AudioGen.

Confirmed it works.

facebook-github-bot commented 1 year ago

Hi @cocktailpeanut!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

cocktailpeanut commented 1 year ago

Just signed the contributor license agreement, looking forward to feedback!

Also, please let me know if I need to modify anything. One thing I wasn't sure about was whether AudioGen supports Multi Band Diffusion (Looking at the code I kind of assumed it doesn't but maybe I'm wrong), so just took that out of the UI. Let me know if this needs to be supported as well.

cocktailpeanut commented 1 year ago

BTW here's what it looks like in action: https://twitter.com/cocktailpeanut/status/1687565351721005056

mberman84 commented 1 year ago

Works for me also, you are amazing @cocktailpeanut

JadeCopet commented 1 year ago

Thanks for your contribution!

The MBD model is not available for AudioGen for now and using the one trained on MusicGen may not be optimal. Can you remove the use of MBD from the app ?

Another nice addition could be to have text prompt examples to get started similarly to the MusicGen demo, e.g. adding:

gr.Examples(
  fn=predict_full,
  examples=[
      [
          "Typing on a typewriter",
      ],
      [
          "The siren of an emergency vehicle sounds",
      ],
      [
          "A duck quacking as birds chirp and a pigeon cooing",
      ],
      [
          "Thundering sounds while rain pours",
      ],
  ],
  inputs=[text],
  outputs=[output]
)