Spaces:
Runtime error
Runtime error
update demos
Browse filesFiles changed (3)
- app.py+16-2
- app_batched.py+14-3
- hf_loading.py+1-4
65 unmodified lines666768697071727374757677787980817 unmodified lines899091829293949521 unmodified lines11711811911012012112212312412512612765 unmodified lines 1. 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 extract a 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 lines with gr.Row(): submit = gr.Button("Submit") with gr.Row(): model = gr.Radio(["melody", "medium", "small"], label="Model", value="melody", interactive=True) 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 lines717273747574757677787980818283848521 unmodified lines10710810910311011111211311411511611711811970 unmodified lines presented 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. 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 duplicate to 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 lines None, ], [ "a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions", "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]122345767895 unmodified lines1516171920181920"""Utility for loading the models from HF."""import osfrom pathlib import Pathimport typing as tp
from omegaconf import OmegaConffrom huggingface_hub import hf_hub_download, loginfrom huggingface_hub import hf_hub_downloadimport torch
from 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'):app.py+16-2
app_batched.py+14-3
hf_loading.py+1-4