TroubleChute Logo
TEXT AI

MusicGen / AudioCraft - Facebook's CRAZY open-source AI


Published: Jun 11, 2023
Last Edit: Jun 11, 2023
Music-AI Facebookresearch
551 Words, 3 Minutes.

Watch the video:


Timestamps:
0:00 - Explanation
0:41 - What MusicGen/Audiocraft does
1:03 - One-line install command
2:57 - Starting Facebook's MusicGen / AudioCraft
4:11 - VRAM requirements (actually not a huge amount!)
4:37 - Surprisingly good AI music
6:09 - Generate music with melody/existing music
7:14 - Using this without a GPU (HuggingFace)

What is Audiocraft

Audiocraft, also known as MusicGen was released to the public through GitHub a few days ago at the time of writing. This new powerful AI allows you to generate music from JUST TEXT - and even feed it a melody to have it create something similar. The fact that you can guide this to create something with just text and even a melody is insane - and even more so because you can run this on consumer-grade hardware.

AudioCraft can be found on the Facebook Research GitHub.

One-line install script for MusicGen / Audiocraft

Recently I’ve been creating simple PowerShell scripts that should install everything and get it up and working. The install process isn’t difficult at all, but to remove all the difficulty even for people who aren’t used to the command line is what I was aiming for.

The script I created runs the automated installers, creates a desktop shortcut and launches the program. See the video for more.

Open a PowerShell window as Admin, or if you have Terminal you can launch that as well - just make sure to choose PowerShell in the terminal window dropdown. “Installing” really is just having the files there, and deleting them will ‘uninstall’ the project.

All you need to do is enter the following line and hit Enter:

iex (irm vicuna.tc.ht)

If you’re curious about how this works, you can see everything it does on the Source code page and via my TCHT GitHub

Follow the prompts on screen and you’ll be up and running in no time.

Manual install

Should you want to install it manually, you can do that instead.

Requirements

Download and install Python 3.9 or above (but lesser than 3.11). I suggest downloading and installing Python 3.10.11.

Just make ABSOLUTELY SURE to tick “add Python to PATH” on the first window of the installer or this will not work properly!

Then, install Git as well.

And, finally, Install FFMPEG as well - This also have a one-line installer from me.

Downloading Audiocraft / MusicGen

Open a folder, and click the path at the top so you can type in the Windows Explorer window. Type cmd and hit Enter.

Alternatively, copy the folder’s path and in a new cmd window, type: cd <path you copied> and hit Enter.

Now you can run git clone https://github.com/facebookresearch/audiocraft.git .

Finally, to install the actual project itself, start with PyTorch with CUDA support:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

(Assuming you get a CUDA error you’ll need to download and install CUDA 11.8 - Which, you guessed it, my one-line installer above also handles)

Finally, run the last 2 commands:

pip install -U audiocraft and pip install -e .

Now everything should be set up.

Run AudioCraft / MusicGen

You should now be able to run AudioCraft / MusicGen by running python app.py in your console or terminal window.

Now you’re up and running, ready to generate music with text or melody and text! It’s super powerful

TroubleChute © Wesley Pyburn (TroubleChute)
Support Me Privacy Policy Cookies Policy Terms of Service Change privacy settings Contact