banner
hughie

hughie

热爱技术的小菜鸟, 记录一下所学所感

MusicGen - Music Generator

Tool Sharing#

MusicGen is an AI music generator based on the Transformer model, which can transform text descriptions into 12-second audio.

Features#

Using the Meta encodec audio tokenizer, the audio data is broken down into smaller parts, and then the next part of the music segment is predicted, similar to a language model predicting the next letter in a phrase. It can handle both text and music prompts simultaneously, with fast and efficient single-stage processing capabilities.

Deployment#

  • Install the project

    pip install 'torch>=2.0'
    git clone https://github.com/facebookresearch/audiocraft.git
    cd audiocraft
    pip install -e .  # or if you cloned the repo locally
    
  • Download pre-trained models

small: 300M model, text to music only

medium: 1.5B model, text to music only

melody: 1.5B model, text to music and text+melody to music

large: 3.3B model, text to music only

  • Run MusicGen

    python app.py
    

Platform#

Official demo
Online testing


Disclaimer#

This article is only for sharing tools.

This article is synchronized with HBlog.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.