How to Install Meta's FREE Text-to-Music AI Generator Locally (AudioGen)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
text to audio is finally here do you remember a few weeks ago when Google released their music LM demo here it is they had a bunch of different captions and the audio that accompanied those captions let's take a look the audio soundtrack of an arcade game fast pacing upbeat with catchy electric guitar riff let's listen to what that sounds like [Music] okay so this is really cool it was a great first paper but you had no control over it and it's just a demo then a few weeks later they released their AI Test Kitchen version of it where you can actually play around with it so I said trap music with deep bass and hi hats so I click play it generates that but we don't have a lot of control over it let's see how it sounds though thank you so that sounds pretty good but again you don't have a lot of control over it you can't control the length if you try to put anything in here that has like I want to hear a Katy Perry type song it won't let you do it you can download it from right here though but now Facebook research has released a completely open source version of text to music and it's awesome here it is it's called audio craft so I'm going to show you how to install this using two methods one a very easy way using just Google collab and all you need to do is open it up and run it and then the second way I'm going to show you how to get this working on your local computer let's go so here's the Google collab I'm going to drop the link to this in the description below the first thing you're going to do is run this first panel and it's going to install audio craft after that's done scroll down and then you're going to run the second panel and this is going to import all of the libraries that you need to do this next is where you're actually going to get the method started so here you don't really need to change anything the only thing you may want to change is the duration it's by default set to 8 seconds and then in this last panel this is where you're going to write your prompts for the types of songs that you want to hear you comma separate each prompt and each one will generate a song on its own so you could see here we have five different descriptions and that means we're going to get five outputs so I already ran this let's listen to some of the songs the first one is crazy EDM heavy Bang foreign [Music] classic reggae track with an electronic guitar solo so these sound really good and again these are completely AI generated so that's how to do it with Google call lab it's very simple but let me show you how to run it on your own computer because that's where it gets exciting because you have so much more control over it so we're gonna need a few things to do this and the first thing I'm going to say is I'm on a Windows 11 machine and I have an Nvidia graphics card and the next thing you're going to need is Anaconda which is a python version management system and really it solves all of the Python and module mismatch issues so I highly suggest this I know a lot of you have dealt with some of these versioning issues I have as well and it really just solves it and makes it so much easier so from now on I'm going to be using conda and all you need to do is a Google search for Anaconda Python and install it it's very straightforward and the last thing you're going to need is the Cuda Library which you can download from Nvidia and the link is right here developer.nvidia.com Cuda Dash downloads you come here you select your machine and then you download it you download the toolkit you install it and then you're ready to go so the first thing you're going to do is create a new folder I named it music gen 2. you can name it anything you want just know where it's located and navigate to that folder from your terminal and remember open up the Anaconda prompt that is different from the regular terminal so we're going to do conda create dash dash name my end python 3.10.11 so there's two things going on here one we're creating a new Anaconda environment so that all of our modules all of our installs go to the same place and we know we're not going to have any version issues next we're installing this specific version of python because that is the one that I found works with Cuda and all of the other AI libraries that we need to run this so hit enter and for me I'm getting a warning because I already have an environment that exists but we're going to remove it you're not going to see this next it's going to ask me if I want to install all of these packages I'm going to click yes and there we go so our new environment is spun up now we have to activate it so I'm going to copy that conda activate my end and you could tell it's activated because it says my right here next we're going to install all of the machine learning and AI libraries that we need to get this going I have conda install pytorch torch Vision torch audio we specify the pi torch Cuda that we need to get it running with my GPU and then we're going to hit enter and again I'm going to put all of this together in a file and I'm going to link it in the description below all right so we're asked do we want to proceed yes we do okay it's done next while I was getting this all set up I ran into some issues and I found that these next three lines of code are the things that fixed it so just follow along and hopefully they fix it for you first we're going to pip install xformers and this is just a library that we need for the text and music hit enter next we're going to install the audio craft Library pip install audiocraft enter alright that's done the last thing we need right now is PIP install IPython and I'm going to go ahead and click enter next I wrote a little script to make sure that Cuda is available and we have the right version I'm going to drop this script in the description below as well but let's run it it's called checker.pi so we're going to say python checker.com enter so this is what we should see we have the torch version with Cuda and the torch Cuda is available Boolean and it's true next I took the script from the Google collab and I modified it to work locally I'm going to share this script it's going to be in the description like everything else I did have to make some adjustments here one of which was at the end of the script the original version used something that only worked in Jupiter notebooks to Output the audio so what I did was I converted that to actually download the audio locally so you could play it now I didn't know how to do that and the awesome thing was I took the errors I was seeing I pass it into Chachi PT and I just said what do I do to fix this and it rewrote the script and gave it to me so I really still use chatgpt as a coding helper to this day so here's the script let's run it python script dot Pi enter now you're gonna get this error no module named Triton Triton is an open AI language but it is not needed it's not available on Windows and we don't need it anyway so you could just ignore that error but if it's working we should see something soon that is what we expect to see and it's actually working if I open up nzxtcam we could see that the GPU is going Burr it's being used so our GPU is now powering this Music Creation I find it so awesome now I have noticed that when I'm recording video I'm recording my screen and I'm running these GPU intensive programs they sometimes run really slow so if I find that I'm just going to end this program and then I'm going to show you the music that was created when I wasn't recording the video and if we switch back to our monitor we could still see we're only at 35 GPU usage okay so this is what happened last time right around when it got to the halfway mark it started running really slow and I noticed that the GPU usage jumped to a hundred percent and it's going to go really slow right now and I don't want to wait for that so I know it works after this I'm gonna quit out of here so we don't have to wait and then let me show you the output from when I wasn't doing video so here are some of the outputs that I have let's listen this is audio zero which which is crazy EDM heavy bang and I have it set to 30 second duration [Music] pretty good let's listen to another one this is classic reggae track with an electronic guitar solo this sounds fantastic and one last one rock with saturated guitars [Music] and that's it now we have complete control of the music we create and it's local to our computer you could play around with it have fun let me know what you create if you have any troubles getting it set up jump into my Discord I'll try to help you out
Info
Channel: Matthew Berman
Views: 34,271
Rating: undefined out of 5
Keywords: ai music, ai generative music, ai music generator, ai generated music, ai art, meta ai music, open-source music gen, meta music gen, meta musicgen, llama, openai, open ai, artificial intelligence, ai music video, meta ai, meta artificial intelligence, open source, open source model, chatgpt, gpt, gpt4, opensource llm
Id: map22OdIUp8
Channel Id: undefined
Length: 8min 29sec (509 seconds)
Published: Tue Jun 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.