How To Install Audiocraft Locally
Last updated
Last updated
https://www.youtube.com/watch?v=_OVi1sE1yiA
Mathew Berman
Chapters:
0:00 - Intro
0:11 - Musicgen Installation
3:13 - Audiogen Installation
Links: Install Instructions: https://gist.github.com/mberman84/afd...
Audiocraft Github - https://github.com/facebookresearch/a...
Audiogen PR - https://github.com/facebookresearch/a...
Audiocraft Announcement - https://about.fb.com/news/2023/08/aud...
Transcript:
Audiocraft is a new project for meta AI that allows you to create AI generated music and sound effects it's completely free completely open source and you can install it locally.
I'm going to show you how let's go so I'm going to be showing you how to install this on a Mac but it should work almost the same on windows.
The first thing we're going to do is create a new Conda environment.
We’re going to type Conda create Dash NAC for audio craft and we're going to be using python 3.9 which is the recommended version python equals 3.9 then enter.
It’s going to install all the packages we need we're going to accept all right there it's installed.
Next we're going to activate so we're going to grab this Command right here paste it Conda activate AC hit enter and now we know it worked because we have this little AC in the corner.
Next we need to make sure we have ffmpeg installed so we can actually play the audio files and to do that we're going to type Brew install ffmpeg.
if you don't already have Homebrew installed I recommend you get it if you're on a Mac and it's telling me I already have it installed because I ran through this already but it should install it for you so I'm good to go now.
next we need to clone the Repository so on the GitHub page click this little green code button and then right next to this URL we're going to click the copy button switch back to your terminal and then we're going to type ‘git clone’ and then the URL we just copied then hit enter.
Next we're going to change directory into it by typing CD Audiocraft.
Now we need to install all of the requirements so we're going to type python-m pip install Dash R requirements.txt.
The last thing we need to do is just spin up the Gradio demo.
To do that we're going to type python-em demos dot music gen underscore app dash dash share.
All right there we go it's going to give you the local URL so we're just going to highlight this and click copy.
We’re going to switch back to our browser paste in that URL and load it up and here it is. This is what it looks like.
Up in the top left where you see input text this is where you're going to type your prompt. And it can be anything describing any kind of music you want.
Now remember this is for Musicgen and so this is always going to be music and then I'll show you audio gen in a moment.
so I'm going to type 90s hip-hop West Coast and then submit the first time you run this it's going to need to download the models and it'll take a while now I've already done that so it's going to skip over that process and it's going to go right to actually generating music files.
It does take a while it's out of 500 steps and I believe it's only using my CPU right now.
While that's loading let me show you the other options I believe right here where you're seeing this file drop you can upload different music files and you can do music to music which is pretty cool.
over here you can select your model so I'm choosing music gen Dash Melody but they have small medium and large models as well so I encourage you to play around with those and see which one gives you the best results.
Down here you have the duration so it's set to 10 seconds and you can see how long it's taking for just a 10 second file.
You can scale this all the way up to a two minute audio file but I'm going to leave it at 10 seconds for now.
you can also play around with top K top P temperature which is at one that's a value between zero one and it's just like when you're using a large language model where the higher the temperature the more creative the response will be and for music I think we definitely want it at a one and then down below it gives us some examples.
All right it's finished there it is let's give it a listen.
Yeah so that's pretty good again you can play around with all the settings and see what else you can get out of it I've had some really good results so far.
Now let me show you how to make sound effects which is amazing.
I had a lot of trouble getting audio gen working I tried doing it through code I tried running the Jupiter notebook and I just had a ton of trouble.
Most likely the Jupiter notebook issue is something related to my Mac so you could probably get it working decently well.
But I found an even better way.
the incredible cocktail Peanut the same person responsible for creating the original DalleLama which allowed us to run llama locally has created a pull request to the Audiocraft repository that basically creates a radio app for the audio gen side of things not just the music gen and I tested it out and it works perfectly.
Right now the pull request is not merged but it looks like it's in the process of being merged so right now you do have to take a couple extra steps which I'll show you but soon enough you won't have to do this anymore.
the first thing we're going to need to do is fetch his PR and to do that we're going to type git fetch origin and pull slash 185 slash head colon pr185 and then hit enter.
Then we need to switch to that Branch so we're going to type git checkout pr185 enter.
and now you can tell we're on pr185 right there and then Just Like Music gen we can spin up the Gradio demo just like this python-mdemos dot audiogen underscore app dash dash share and there we go now it's live.
We can grab this local URL right here switch back to our browser and enter that URL and here we are this is Audiogen.
So you can type absolutely anything.
I'm going to say dog barking again the first time you run this you're going to need to download the model.
It’s going to take a while. I've already done that so I don't need to do that again.
All right it's done - let's give it a listen.
It gave me a little dog this time. It sounds really good though. And you can make any audio effect that you want from this. It’s free it's pretty amazing. Play around with it.