update demos
Browse filesFiles changed (3)
- app.py+16-2
- app_batched.py+14-3
- hf_loading.py+1-4
65 unmodified lines6667686970717 unmodified lines7980818283848521 unmodified lines10710810911011111211365 unmodified lines1. Melody -- a music generation model capable of generating music condition on text and melody inputs. **Note**, you can also use text only.2. Small -- a 300M transformer decoder conditioned on text only.3. Medium -- a 1.5B transformer decoder conditioned on text only.See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)for more details.7 unmodified lineswith gr.Row():submit = gr.Button("Submit")with gr.Row():model = gr.Radio(["melody", "medium", "small"], label="Model", value="melody", interactive=True)with gr.Row():duration = gr.Slider(minimum=1, maximum=30, value=10, label="Duration", interactive=True)with gr.Row():21 unmodified lines"a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions","./assets/bach.mp3","melody"]],inputs=[text, melody, model],outputs=[output]65 unmodified lines666768697071727374757677787980817 unmodified lines8990919293949521 unmodified lines11711811912012112212312412512612765 unmodified lines1. Melody -- a music generation model capable of generating music condition on text and melody inputs. **Note**, you can also use text only.2. Small -- a 300M transformer decoder conditioned on text only.3. Medium -- a 1.5B transformer decoder conditioned on text only.4. Large -- a 3.3B transformer decoder conditioned on text only (might OOM for the longest sequences.)When the optional melody conditioning wav is provided, the model will extracta broad melody and try to follow it in the generated samples.For skipping queue, you can duplicate this space, and upgrade to GPU in the settings.<br/><a href="https://huggingface.co/spaces/musicgen/MusicGen?duplicate=true"><img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a></p>See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)for more details.7 unmodified lineswith gr.Row():submit = gr.Button("Submit")with gr.Row():model = gr.Radio(["melody", "medium", "small", "large"], label="Model", value="melody", interactive=True)with gr.Row():duration = gr.Slider(minimum=1, maximum=30, value=10, label="Duration", interactive=True)with gr.Row():21 unmodified lines"a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions","./assets/bach.mp3","melody"],["lofi slow bpm electro chill with organic samples","medium",],],inputs=[text, melody, model],outputs=[output]
70 unmodified lines717273747576777821 unmodified lines10010110210310410510610710870 unmodified linespresented at: "Simple and Controllable Music Generation".Enter the description of the music you want and an optional audio used for melody conditioning.This will generate a 12s extract with the `melody` model. For generating longer sequences(up to 30 seconds), use the Colab demo or your own GPU.See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)for more details.21 unmodified linesNone,],["a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions","./assets/bach.mp3",]],inputs=[text, melody],outputs=[output]70 unmodified lines71727374757677787980818283848521 unmodified lines10710810911011111211311411511611711811970 unmodified linespresented at: "Simple and Controllable Music Generation".Enter the description of the music you want and an optional audio used for melody conditioning.The model will extract the broad melody from the uploaded wav if provided.This will generate a 12s extract with the `melody` model.For generating longer sequences (up to 30 seconds) and skipping queue, you can duplicateto full demo space, which contains more control and upgrade to GPU in the settings.<br/><a href="https://huggingface.co/spaces/musicgen/MusicGen?duplicate=true"><img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a></p>See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)for more details.21 unmodified linesNone,],["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]
123456789105 unmodified lines1617181920212223"""Utility for loading the models from HF."""import osfrom pathlib import Pathimport typing as tpfrom omegaconf import OmegaConffrom huggingface_hub import hf_hub_download, loginimport torchfrom audiocraft.models import builders, MusicGen5 unmodified lines"melody": "facebook/musicgen-melody",}login(os.environ['ACCESS_TOKEN'])def _get_state_dict(file_or_url: tp.Union[Path, str],filename="state_dict.bin", device='cpu'):1234567895 unmodified lines151617181920"""Utility for loading the models from HF."""from pathlib import Pathimport typing as tpfrom omegaconf import OmegaConffrom huggingface_hub import hf_hub_downloadimport torchfrom audiocraft.models import builders, MusicGen5 unmodified lines"melody": "facebook/musicgen-melody",}def _get_state_dict(file_or_url: tp.Union[Path, str],filename="state_dict.bin", device='cpu'):
app.py+16-2
app_batched.py+14-3
hf_loading.py+1-4