Skip to content

AI Music Generation Audiocraft and MusicGen Tutorial with Example Free Text to Music Model

FurkanGozukara edited this page Oct 24, 2025 · 1 revision

AI Music Generation Audiocraft & MusicGen Tutorial with Example (Free Text-to-Music Model)

AI Music Generation Audiocraft & MusicGen Tutorial with Example (Free Text-to-Music Model)

image Hits Patreon BuyMeACoffee Furkan Gözükara Medium Codio Furkan Gözükara Medium

YouTube Channel Furkan Gözükara LinkedIn Udemy Twitter Follow Furkan Gözükara

GitHub instructions Readme file and Patreon Auto installer updated at 4 August 2023.

Facebook Meta Research has published the new amazing text-to-music model Audiocraft (MusicGen). In this video I have shown how you can install Audiocraft on your computer or use it on the Google Colab for free. This AI model can generate amazing music from just text or with text and supportive melody. It is is just amazing.

1 Click Auto Installer Updated 4 August 2023 ⤵️

https://www.patreon.com/posts/ai-music-auto-84334460

Source GitHub File (Readme File) ⤵️

https://github.com/FurkanGozukara/Stable-Diffusion/blob/main/Tutorials/AI-Music-Generation-Audiocraft-Tutorial.md

Our Discord server ⤵️

https://bit.ly/SECoursesDiscord

If I have been of assistance to you and you would like to show your support for my work, please consider becoming a patron on 🥰 ⤵️

https://www.patreon.com/SECourses

Technology & Science: News, Tips, Tutorials, Tricks, Best Applications, Guides, Reviews ⤵️

https://www.youtube.com/playlist?list=PL_pbwdIyffsnkay6X91BWb9rrfLATUMr3

Playlist of StableDiffusion Tutorials, Automatic1111 and Google Colab Guides, DreamBooth, Textual Inversion / Embedding, LoRA, AI Upscaling, Pix2Pix, Img2Img ⤵️

https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3

00:00:00 Introduction to Audiocraft full tutorial with example AI generated music

00:00:30 Sample several songs made by me via Audiocraft

00:01:27 How to save generated music files on your computer

00:03:53 How to install Audiocraft

00:06:49 How to do automatic installation with my special scripts

00:08:52 How to start Audiocraft / MusicGen application and use it

00:11:57 Where the Audiocraft / MusicGen model files are saved

00:12:31 How to use condition melody to generate a song

00:14:25 How to use Audiocraft / MusicGen on Google Colab

00:15:50 How to use automatic run script that I have shared

00:18:12 Very long text prompt experimentation

00:19:25 Very epic music generated by Audiocraft

00:20:44 How to close Google Colab runtime - turn it off

00:22:34 Amazing music generated by MusicGen

00:23:50 How to use pip freeze to see versions of all installed libraries

00:24:22 How to install specific version of a library in Python

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.

Audiocraft is a PyTorch library for deep learning research on audio generation. At the moment, it contains the code for MusicGen, a state-of-the-art controllable text-to-music model.

MusicGen

Audiocraft provides the code and models for MusicGen, a simple and controllable model for music generation. MusicGen is a single stage auto-regressive Transformer model trained over a 32kHz EnCodec tokenizer with 4 codebooks sampled at 50 Hz. Unlike existing methods like MusicLM, MusicGen doesn't require a self-supervised semantic representation, and it generates all 4 codebooks in one pass. By introducing a small delay between the codebooks, we show we can predict them in parallel, thus having only 50 auto-regressive steps per second of audio. Check out our sample page or test the available demo!

MusicGen Model Card

Model details

Organization developing the model: The FAIR team of Meta AI.

Model date: MusicGen was trained between April 2023 and May 2023.

Model version: This is the version 1 of the model.

Model type: MusicGen consists of an EnCodec model for audio tokenization, an auto-regressive language model based on the transformer architecture for music modeling. The model comes in different sizes: 300M, 1.5B and 3.3B parameters ; and two variants: a model trained for text-to-music generation task and a model trained for melody-guided music generation.

Where to send questions or comments about the model: Questions and comments about MusicGen can be sent via the Github repository of the project, or by opening an issue.

Intended use

Primary intended use: The primary use of MusicGen is research on AI-based music generation, including:

Research efforts, such as probing and better understanding the limitations of generative models to further improve the state of science

Generation of music guided by text or melody to understand current abilities of generative AI models by machine learning amateurs

Primary intended users: The primary intended users of the model are researchers in audio, machine learning and artificial intelligence, as well as amateur seeking to better understand those models.

Out-of-scope use cases The model should not be used on downstream applications without further risk evaluation and mitigation. The model should not be used to intentionally create or disseminate music pieces that create hostile or alienating environments for people.

Adventure by Alexander Nakarada | https://www.serpentsoundstudios.com

Music promoted by https://www.free-stock-music.com

Attribution 4.0 International (CC BY 4.0)

Video Transcription

  • 00:00:00 Greetings everyone.

  • 00:00:01 Facebook Research has released AudioCraft which can generate

  • 00:00:05 music from text prompts or from given audio files.

  • 00:00:10 AudioCraft is the best ever released

  • 00:00:13 music generator so far.

  • 00:00:15 Today I will show you how to install and use it.

  • 00:00:18 I will begin with showing you some of the samples I have generated on my computer.

  • 00:00:23 I am very bad at music so you can consider these are the worst generated samples.

  • 00:00:30 Now listen them together.

  • 00:01:02 For generating this song I have used this input

  • 00:01:05 text and I didn't use any melody condition.

  • 00:01:08 I used the large model with default parameters.

  • 00:01:12 The large model works very well on RTX 3090.

  • 00:01:17 Probably it requires about 15-16GB VRAM memory.

  • 00:01:21 However if you have lower VRAM having GPU you

  • 00:01:24 can use medium model or small model as well.

  • 00:01:28 The generated music files are not saved on

  • 00:01:31 your computer by default so you need to click this three dots icon here and click download

  • 00:01:37 and it will save the generated audio file into your downloads folder.

  • 00:01:42 It is totally up to you to how you prompt and get

  • 00:01:46 your output.

  • 00:01:47 I didn't have much chance to test

  • 00:01:49 yet to find better examples, but still this model

  • 00:01:54 is amazing.

  • 00:01:55 Now in this example, I am showing you

  • 00:01:58 the combination of this prompt with Bach mp3 file that comes along with the model itself.

  • 00:02:07 Let's listen to generated music.

  • 00:02:39 I also used this Creative Commons song as an example as well.

  • 00:02:43 Let me also show you

  • 00:02:45 how does it sound and it is amazing.

  • 00:02:48 So first I will let you listen the melody conditioning.

  • 00:03:07 And now let's listen the generated music with taking

  • 00:03:10 this melody condition and also this input text.

  • 00:03:44 As I said this is not a cherry picking.

  • 00:03:46 This is the first time generation because I didn't

  • 00:03:49 have

  • 00:03:50 much time to test and do more experimentation.

  • 00:03:53 So for installation I have prepared an amazing

  • 00:03:56 GitHub readme file.

  • 00:03:58 This file link will be in the description of the video.

  • 00:04:01 This file will get

  • 00:04:02 updated as it is necessary so you may find more information

  • 00:04:07 on this file.

  • 00:04:08 Why I am using such file

  • 00:04:10 because I am producing a lot of AI content and these

  • 00:04:13 repositories gets updated all the time and

  • 00:04:16 gets broken all the time so quickly.

  • 00:04:19 So I will keep this file up to date and you will be able

  • 00:04:23 to always

  • 00:04:24 follow this video and install and use this open source

  • 00:04:29 library.

  • 00:04:30 So there are two requirements that

  • 00:04:31 you need to do.

  • 00:04:33 First you need to install Python.

  • 00:04:35 I suggest you to use Python 3.10.x version.

  • 00:04:39 I am

  • 00:04:40 using Python 3.10.9 and it should be set in the path

  • 00:04:45 as a default.

  • 00:04:46 So when you type Python in your

  • 00:04:48 new cmd window, you should see a message like this.

  • 00:04:51 The second thing that you need to have installed

  • 00:04:54 is git.

  • 00:04:55 When you type git in your cmd window.

  • 00:04:58 You should see a git message like this.

  • 00:05:01 If you don't

  • 00:05:02 know how to install them I have excellent tutorial

  • 00:05:05 video.

  • 00:05:06 The link is here and the download links are

  • 00:05:07 in here.

  • 00:05:08 So now I will show the installation of Audiocraft on your computer.

  • 00:05:13 I also have prepared

  • 00:05:14 auto install and run script which is shared on my

  • 00:05:18 Patreon post.

  • 00:05:19 You can download these scripts and

  • 00:05:21 directly use them.

  • 00:05:22 I will also show how to use them as well so we will have a comparison.

  • 00:05:27 I have put

  • 00:05:28 every command here one by one so it is very easy

  • 00:05:31 to follow if you don't want to use my automated

  • 00:05:34 scripts.

  • 00:05:35 So first enter inside the folder where you want to install your script.

  • 00:05:39 I will make

  • 00:05:40 test3 folder like this.

  • 00:05:43 I have entered inside folder.

  • 00:05:45 First we will begin with cloning the

  • 00:05:47 repository.

  • 00:05:48 So open a new cmd window in here and this is where my cmd window is.

  • 00:05:53 Right click and

  • 00:05:54 start cloning.

  • 00:05:55 Then move into the cloned folder.

  • 00:05:57 Copy it, paste it and move it into the folder.

  • 00:06:00 Then if you want to use the same version that I have

  • 00:06:04 used in this video, do git checkout.

  • 00:06:07 Do this

  • 00:06:08 only if you encounter problems and if it doesn't work otherwise, you don't need to do this.

  • 00:06:13 You

  • 00:06:14 should use the latest version of the repository.

  • 00:06:16 Because developers usually fix bugs and add new

  • 00:06:20 features.

  • 00:06:21 Then we will generate our own virtual environment.

  • 00:06:23 This is really important because with

  • 00:06:26 this way it won't conflict with your other installations

  • 00:06:29 such as Stable Diffusion.

  • 00:06:31 Copy,

  • 00:06:32 paste and hit enter.

  • 00:06:33 Then we will activate the virtual environment.

  • 00:06:36 This is really important.

  • 00:06:37 You need to always work with activated virtual environment.

  • 00:06:40 Then we will install Torch, Torchvision,

  • 00:06:44 Torchaudio.

  • 00:06:45 Copy, right click and hit enter.

  • 00:06:47 Meanwhile this is installing.

  • 00:06:49 Let me show you

  • 00:06:50 the scripts that I have made.

  • 00:06:52 So for this, we will begin with cloning.

  • 00:06:54 I will use test4 folder.

  • 00:06:56 Open a new cmd, clone.

  • 00:06:58 Then cut the downloaded scripts.

  • 00:07:00 Put them into the cloned main repository

  • 00:07:03 which is Audiocraft.

  • 00:07:05 Paste them here.

  • 00:07:06 So you need to put these files into your cloned repository

  • 00:07:11 into your cloned directory.

  • 00:07:13 Then just double click install bat file.

  • 00:07:16 It may ask you this,

  • 00:07:18 then just click run anyway.

  • 00:07:19 The bat file is very simple like this.

  • 00:07:21 You can also code this if you

  • 00:07:23 wish, but you don't have to.

  • 00:07:24 This bat file will install everything automatically for you.

  • 00:07:28 If you

  • 00:07:29 don't have a good GPU don't worry.

  • 00:07:30 There is a special Google Colab made for Audiocraft.

  • 00:07:33 I will

  • 00:07:34 also show you how to install and use Audiocraft on

  • 00:07:36 Google Colab free account.

  • 00:07:38 So we can continue our

  • 00:07:40 manual installation while our automatic installation is going on automatically.

  • 00:07:46 After installing Torch and Torchvision we just

  • 00:07:49 need to execute this command.

  • 00:07:52 I made this

  • 00:07:53 command so easy for you.

  • 00:07:54 Just copy, paste and hit enter.

  • 00:07:57 You see as I do more research, more videos

  • 00:08:01 I'm improving my skills and providing you better

  • 00:08:04 content.

  • 00:08:05 So you don't have to support me on

  • 00:08:07 Patreon, but if you support me on Patreon, I would

  • 00:08:10 appreciate it very much.

  • 00:08:11 We have our links in the

  • 00:08:13 top you see support me on Patreon, youtube.

  • 00:08:16 You can also follow me on Twitter.

  • 00:08:18 I am not a faceless

  • 00:08:20 person.

  • 00:08:21 I am Dr. Furkan Gozukara.

  • 00:08:23 You can follow me.

  • 00:08:24 You can also connect me on my LinkedIn as well.

  • 00:08:27 Also don't forget to join our Discord channel.

  • 00:08:30 When you click this link, you will see our Discord

  • 00:08:32 channel.

  • 00:08:33 You see we have over 3000 members and we are growing.

  • 00:08:36 I am expecting you there as well.

  • 00:08:38 Okay this step is also completed.

  • 00:08:41 Now we will install xformer.

  • 00:08:43 So copy, paste.

  • 00:08:45 After you paste

  • 00:08:46 it.

  • 00:08:47 You need to hit enter.

  • 00:08:48 All right now we are ready to start application.

  • 00:08:51 So I will close our

  • 00:08:52 manual installation.

  • 00:08:54 Enter inside the folder, open a new cmd, then copy this command, paste and

  • 00:09:00 hit

  • 00:09:01 enter and it will start the Gradio interface.

  • 00:09:03 Unfortunately I couldn't find a way to install

  • 00:09:07 Triton on windows yet.

  • 00:09:10 On the official repository of Audiocraft.

  • 00:09:12 I have opened several issue topics.

  • 00:09:14 You may see them here as well.

  • 00:09:16 I have asked how can we install Triton.

  • 00:09:20 I have asked more information

  • 00:09:21 about top k, top p, temperature, and classifier free guidance parameters.

  • 00:09:27 I also asked where we

  • 00:09:29 can get text token list it was used to be trained on.

  • 00:09:33 So hopefully I will add more information to my

  • 00:09:36 readme file.

  • 00:09:37 So it started the URL.

  • 00:09:39 You need to copy this and open in your browser.

  • 00:09:42 So this is

  • 00:09:43 the interface that I have shown you in the beginning

  • 00:09:46 of the video.

  • 00:09:47 Just type anything you

  • 00:09:48 want.

  • 00:09:49 For example: amazing rap song and select the model

  • 00:09:53 that you want to use.

  • 00:09:54 You can also use melody

  • 00:09:56 and if you use melody, you need to drag and drop

  • 00:09:59 an audio file here so it will also use that

  • 00:10:02 condition.

  • 00:10:03 There is also medium small and large models.

  • 00:10:07 Depending on your gpu vram, you can test

  • 00:10:09 them.

  • 00:10:10 On rtx 3090 all of them works and it is really fast.

  • 00:10:13 So let's generate this with large

  • 00:10:16 model and I will keep video open while generating.

  • 00:10:21 So let me also show you the vram usage.

  • 00:10:23 I also have

  • 00:10:24 several other applications open right now so there

  • 00:10:27 is some extra little more vram usage.

  • 00:10:31 And

  • 00:10:32 video recording is also taking a lot of vram and gpu

  • 00:10:35 power.

  • 00:10:36 However it is working right now as you

  • 00:10:37 are seeing.

  • 00:10:39 Moreover when the first time you generate a song, it will download the models.

  • 00:10:44 Since I have downloaded already.

  • 00:10:46 It didn't re-download but when the first time you generate

  • 00:10:50 you will see download message like this where on

  • 00:10:54 the cmd window you launch it.

  • 00:10:56 Currently you see

  • 00:10:57 there is no messages because it is using the cached

  • 00:11:00 downloaded model files.

  • 00:11:02 I will also show

  • 00:11:03 you where these model files are located.

  • 00:11:07 Still generating our audio, it was like 60 seconds so far

  • 00:11:11 and I am generating 30 seconds song.

  • 00:11:14 I tried to generate more than 30 seconds, however it

  • 00:11:17 is

  • 00:11:18 not able to generate more than 30 seconds even

  • 00:11:21 if you wish.

  • 00:11:22 Okay it took like 70 seconds

  • 00:11:23 and you see still I am recording.

  • 00:11:25 There are a lot of things going on right now

  • 00:11:28 and it was really, really fast.

  • 00:11:30 Now let's listen it.

  • 00:11:39 Okay it looks like I didn't even write the song

  • 00:11:42 properly.

  • 00:11:43 I have written son.

  • 00:11:44 So as you do

  • 00:11:45 more detailed input here, it will generate much better

  • 00:11:49 music.

  • 00:11:50 I will look for what kind of prompts

  • 00:11:52 we can do.

  • 00:11:53 So I'm not sure yet.

  • 00:11:54 This is like Stable Diffusion.

  • 00:11:56 You need to figure out prompting.

  • 00:11:58 So let me show you where the model files are saved.

  • 00:12:01 They are saved inside your c drive,

  • 00:12:03 inside users, inside your username.

  • 00:12:06 In here go to the cache folder, in here, go to the hugging face,

  • 00:12:10 in here, go to the hub and you will see models facebook musicgen.

  • 00:12:16 For example: large model is

  • 00:12:17 taking 6 gigabytes on my hard drive, medium is

  • 00:12:21 taking 3 gigabytes on my hard drive 3.6

  • 00:12:24 and melody model is taking 2.8 and small model is taking only 1 gigabyte on my hard drive.

  • 00:12:32 So for using condition, what you need to do is just click here.

  • 00:12:37 Select the mp3 file or

  • 00:12:39 another sound file and hit generate.

  • 00:12:42 Don't forget to select model melody here.

  • 00:12:44 For example: let's

  • 00:12:45 also try this with melody and let's see how much time

  • 00:12:49 it will take.

  • 00:12:50 It says that it will take about

  • 00:12:51 73 seconds, but I am not sure.

  • 00:12:54 I can say that the facebook research is ahead of the other companies

  • 00:12:59 such as google.

  • 00:13:00 Google announced MusicLM, but they didn't release any models anything to the

  • 00:13:05 public

  • 00:13:06 so we couldn't test them.

  • 00:13:07 We only saw their demos.

  • 00:13:09 However, in here we have something live

  • 00:13:13 that we can test.

  • 00:13:14 We can play with it, we can experiment with it and this makes Facebook much

  • 00:13:20 better in the AI realm.

  • 00:13:22 I hope I have pronounced it correctly in the AI realm.

  • 00:13:27 Yeah and this is amazing.

  • 00:13:29 I am following all of the AI news so keep subscribed

  • 00:13:33 to my channel.

  • 00:13:34 Join our Discord.

  • 00:13:36 Hopefully if something new comes I will make a

  • 00:13:37 video for it I have a lot of backlog of new

  • 00:13:40 videos, new tutorials, even better tutorials will come

  • 00:13:44 hopefully soon.

  • 00:13:45 Okay, it took 74, 75.

  • 00:13:49 Yes, 75.

  • 00:13:50 Let's listen it.

  • 00:14:06 I am pretty sure you will be able to compose much better

  • 00:14:24 music than me.

  • 00:14:26 Okay, now let me show you how

  • 00:14:28 to use these models.

  • 00:14:30 How to use Audiocraft on Google Colab for free.

  • 00:14:34 Just click the link I

  • 00:14:35 shared in this GitHub readme file.

  • 00:14:38 By the way I have a GitHub repository named a Stable Diffusion.

  • 00:14:43 This is my main repository.

  • 00:14:44 Please star it.

  • 00:14:45 Fork it.

  • 00:14:46 Watch it.

  • 00:14:47 I appreciate that.

  • 00:14:48 It helps me growing.

  • 00:14:50 I have many other tutorials and useful stuff here.

  • 00:14:53 Tricks here.

  • 00:14:54 I think you will like other content I

  • 00:14:56 share here as well.

  • 00:14:58 So I am opening the Google Colab I will open in a new tab like this.

  • 00:15:01 This.

  • 00:15:02 Is

  • 00:15:03 our Colab.

  • 00:15:04 First begin with connecting.

  • 00:15:05 Click connect.

  • 00:15:06 Here it is connecting.

  • 00:15:07 This is a pretty

  • 00:15:08 simple script.

  • 00:15:09 This script made by Camenduru this guy is amazing.

  • 00:15:13 He is releasing so many

  • 00:15:14 Google Colab scripts.

  • 00:15:16 First verify that you are connected to gpu if you are not change

  • 00:15:19 runtime from here.

  • 00:15:21 Select gpu if you are not able to select gpu, that means that your account

  • 00:15:25 is

  • 00:15:26 not verified with a phone number very possibly or

  • 00:15:29 you have used all of your gpu time, free time.

  • 00:15:33 Then click play icon.

  • 00:15:34 Run anyway and just wait until it install everything and starts the

  • 00:15:39 gradio link for us.

  • 00:15:41 Meanwhile I will show you our automatic run script that I have shared on

  • 00:15:47 the

  • 00:15:48 my Patreon post.

  • 00:15:49 It was already completed the installation.

  • 00:15:51 You just double click the run.bat

  • 00:15:54 file, click more info.

  • 00:15:56 Click run anyway, this file is 100% safe because you can look what

  • 00:16:00 is

  • 00:16:01 inside and it is just this.

  • 00:16:02 These are the just commands we executed.

  • 00:16:04 This script just automates

  • 00:16:06 it and you see you get your Gradio link here.

  • 00:16:10 Okay, our installation is going on on Google

  • 00:16:12 Colab.

  • 00:16:13 You will also get this warning.

  • 00:16:15 Just ignore it.

  • 00:16:16 Don't restart or don't click this play icon

  • 00:16:19 again.

  • 00:16:20 You see it has started Gradio link.

  • 00:16:22 Click it and you will get a public Gradio.

  • 00:16:25 This Gradio

  • 00:16:26 is linked to this Google Colab runtime.

  • 00:16:29 Let's make a test with this one.

  • 00:16:32 So I click it.

  • 00:16:33 Let's

  • 00:16:34 select the large model.

  • 00:16:35 I don't know.

  • 00:16:36 Large model may get out of vram error on Google Colab.

  • 00:16:39 Let's

  • 00:16:40 try it.

  • 00:16:41 Submit.

  • 00:16:42 First it will download the large model on Google Colab.

  • 00:16:44 So this is running on cloud.

  • 00:16:46 Nothing here will affect your computer or will be downloaded onto your computer.

  • 00:16:52 Everything is Google servers.

  • 00:16:53 This is 100% safe.

  • 00:16:56 Let's see I wonder that if we will be able to

  • 00:16:58 use large model on Google Colab free account this is free account therefore I have only

  • 00:17:03 15

  • 00:17:04 gigabytes having gpu.

  • 00:17:05 Okay, so far we don't have out of memory error.

  • 00:17:08 It is using 8 gigabytes.

  • 00:17:09 I think it started processing.

  • 00:17:12 We are waiting the results.

  • 00:17:14 On Google Colab it displays extra

  • 00:17:16 information like you are seeing right now and we are

  • 00:17:20 at 11 gigabyte gpu ram and we got a generated

  • 00:17:24 music.

  • 00:17:25 Nice!

  • 00:17:26 Oh very nice.

  • 00:17:27 Now let's listen it.

  • 00:17:59 Okay for downloading the generated music files you

  • 00:18:02 need to click this icon and it will download

  • 00:18:05 it onto your computer.

  • 00:18:06 By the way, on Google Colab, it generated an mp4 file.

  • 00:18:11 I will now try with a

  • 00:18:12 very long description prompt.

  • 00:18:16 Let's see will it cause out of memory error or not and how much

  • 00:18:19 time it will take.

  • 00:18:21 Just hit submit and let's follow the gpu ram usage.

  • 00:18:25 I wonder if the prompt

  • 00:18:27 length is affecting the used vram memory amount.

  • 00:18:32 So you see it is a huge prompt.

  • 00:18:34 I generated it with

  • 00:18:37 ChatGPT I am also monitoring the time it is going to

  • 00:18:40 take on my computer.

  • 00:18:42 It is usually taking about

  • 00:18:43 60 seconds when the gpu is not much used.

  • 00:18:48 So on Google Colab we will see.

  • 00:18:50 By the way, on windows,

  • 00:18:51 we weren't fully utilizing the accelerators due

  • 00:18:55 to Triton library which was missing on windows.

  • 00:18:59 On Google Colab, it runs with unix, therefore that

  • 00:19:04 is available so it is more optimized than using

  • 00:19:08 this repository on Windows.

  • 00:19:12 Okay, it was 90 seconds, 100 seconds, 120 seconds.

  • 00:19:16 Let's look

  • 00:19:17 at the messages: 130.

  • 00:19:19 Okay, about 130 seconds.

  • 00:19:22 The model was already loaded so we didn't wait

  • 00:19:25 or

  • 00:19:26 count it.

  • 00:19:27 Let's listen.

  • 00:19:37 Wow, this was epic.

  • 00:19:59 So you see there is so much thing that you can do.

  • 00:20:02 I will test the same prompt

  • 00:20:04 on my computer to see whether there is any difference

  • 00:20:07 in generation time.

  • 00:20:10 You see on windows

  • 00:20:11 we don't have Triton, therefore some optimizations will not be enabled.

  • 00:20:15 But I think my gpu is still

  • 00:20:17 two times faster than what is on Google Colab.

  • 00:20:20 So let's open the interface.

  • 00:20:22 Type our text, select

  • 00:20:24 large model select 30 seconds.

  • 00:20:26 By the way, if you use lesser duration, that may reduce your

  • 00:20:30 vram

  • 00:20:31 usage.

  • 00:20:32 So let's submit.

  • 00:20:33 Oh, first time it is loading the model.

  • 00:20:35 So I need to repeat this experimentation

  • 00:20:37 to ignore model loading time.

  • 00:20:39 Meanwhile, I will also shut off my Google Colab so it won't

  • 00:20:43 use

  • 00:20:44 my gpu time.

  • 00:20:45 Just click here, disconnect and delete runtime and it will delete everything and

  • 00:20:50 it will

  • 00:20:51 shut off the Google Colab.

  • 00:20:52 Okay, 60 seconds, but it is also including the loading model

  • 00:20:57 time.

  • 00:20:58 Okay, it took like 96 seconds.

  • 00:21:00 Now I will submit again.

  • 00:21:02 By the way, each time you generate

  • 00:21:04 a new music, it will be different than previous one depending of these top-k, top-p, temperature

  • 00:21:12 and classifier free guidance variables.

  • 00:21:15 I asked them to the ChatGPT and there are some information

  • 00:21:19 written on this GitHub readme file that I will share

  • 00:21:23 in the video as a link, in the description

  • 00:21:25 of the video and also in the comment section of

  • 00:21:28 the video.

  • 00:21:29 So you can read this and learn more

  • 00:21:31 about it.

  • 00:21:32 This is a general information based on the machine learning models.

  • 00:21:36 It is probably pretty

  • 00:21:37 accurate as well.

  • 00:21:38 Okay, 40 seconds.

  • 00:21:40 Currently I am doing tests with only default parameters that

  • 00:21:44 the

  • 00:21:45 developers has set, but you can change them and

  • 00:21:47 see what kind of impact they are making.

  • 00:21:50 By the

  • 00:21:51 way, we are still recording video.

  • 00:21:53 Therefore, it is a little bit slower than what it should

  • 00:21:56 be.

  • 00:21:57 Okay, around 70 seconds.

  • 00:21:58 In the right side, you see the last duration it took to generate

  • 00:22:02 the

  • 00:22:03 music file.

  • 00:22:04 Okay, 85 okay, looks like more prompts increases the time it takes to generate a

  • 00:22:11 song.

  • 00:22:12 Okay, yeah, it's significantly increased the time

  • 00:22:15 that it takes.

  • 00:22:16 And wow, this time it is taking

  • 00:22:18 even longer.

  • 00:22:19 It is maybe probably because I am talking more.

  • 00:22:22 Yeah, okay, let's listen this one.

  • 00:22:55 I hope someone figures out how to generate more than

  • 00:22:58 30 seconds because this is amazing!

  • 00:23:01 And for

  • 00:23:02 downloading, click these three icons and click download.

  • 00:23:04 This is all for today.

  • 00:23:05 I hope you have

  • 00:23:06 enjoyed it.

  • 00:23:07 Please support me on Patreon.

  • 00:23:08 You can click here.

  • 00:23:09 You can connect with my LinkedIn from

  • 00:23:11 here.

  • 00:23:12 You can follow me from twitter from here.

  • 00:23:14 Please also subscribe, leave a comment, share,

  • 00:23:17 and please support me with joining on Youtube.

  • 00:23:19 I appreciate that very much.

  • 00:23:21 You will find the

  • 00:23:22 readme file link in the description of the video.

  • 00:23:25 Like here you see source GitHub file.

  • 00:23:26 This is from

  • 00:23:27 another video but the same logic and also in the pinned

  • 00:23:31 comment.

  • 00:23:32 You will also find the link of this

  • 00:23:34 readme file.

  • 00:23:35 This readme file I shared is extremely important.

  • 00:23:38 I will keep it up to date so if an

  • 00:23:41 error or something happens, I will write here based on your feedback.

  • 00:23:45 If there are another

  • 00:23:46 libraries that you need to install, I will write

  • 00:23:49 them here.

  • 00:23:50 Moreover, I have used pip freeze to

  • 00:23:54 list all of the installed libraries in my generated

  • 00:23:58 virtual environment file.

  • 00:24:00 This is also

  • 00:24:01 logged, written in the very bottom of the readme

  • 00:24:05 file so you can see all of the libraries with

  • 00:24:08 their versions.

  • 00:24:09 This is extremely useful because in future when you watch this video if you

  • 00:24:14 encounter a library error, you can see the version

  • 00:24:18 here and install specific version.

  • 00:24:21 How.

  • 00:24:22 For

  • 00:24:23 installing specific version you need to use the following

  • 00:24:26 format pip install and the library that

  • 00:24:29 you want to install then equal equal and the version.

  • 00:24:33 With this way you can install the specific

  • 00:24:36 version of each library.

  • 00:24:38 I hope you have enjoyed.

  • 00:24:40 Hopefully see you in another amazing tutorial!

Clone this wiki locally