Strawberry Phi - Fine-Tune OpenAI's Model on Your Own Data Locally

Published: Sep 14, 2024 Duration: 00:09:13 Category: Science & Technology

Trending searches: openai strawberry
hello everyone and welcome to the channel in this video I'm going to share with you a new project which is quite interesting that revolves around fine-tuning applications for open GPT models that's correct strawberry f is a fine-tuning application for GPT models the main objective of this project is to provide an easy to use interface for creating custom models tailored to specific needs the goal is to enable users to fine tune GPT models with their own data resulting in models that perform better on their unique tasks there are lot of other features around it it is open source it is ready for you to fine-tune your own agent 01 style models and 01 is a model which has just been released by openi so if you want to F tune the existing let's say GPT 40 mini on your own data in order to get the agentic and reflective features of 1 then you can get out of it you know that everyone is talking about um these gpt1 models especially around their reflection or Chain of Thought or reasoning capabilities and that is what this project is going to do so sty uses reflective agentic based systems to enable models to self-correct and improve their reasoning primarily it fine tunes gp4 o in much the same open AI dat with o1 similarly uh we can't say it for certain but seems like it it is compatible with GPT 40 mini and GPT 40 you can start tuning at fraction of the cost with no rate limits but still there will be a cost and in order to run this project you would need the API key from opena which you can grab from platform. open.com now that is a paid option and as we are just talking about GPT model so there's no question of any local stuff here it is uh as I said compatible with gp40 mini and that is why the cost is lesser than if you use the GPT 401 model it is um available at the moment which you can get it from GitHub repo and I will drop the link to it in video's description also as per the creator of this repo it is 95% cheaper than the latest models with no boundaries and also there is no throttling but I would highly highly um recommend you to do your own Dy Ence make sure that if you are using the API you set some budget so that you don't get any root surprises when it comes to cost okay before I show you how to install and use it let me give a huge shout out to M compute who are sponsoring the VM and GPU for this video If you're looking to rent a GPU on good prices I will drop the link to their website in video description plus I'm also going to give you a coupon code of 50% discount on range of uh gpus okay so that said and done let's try to get it installed locally and then we will see how it works okay so before I start the installation another thing is that this has been created mainly with node CHS so you would need to have npm and node installed and you can simply do this with NVM if you don't know what that is please search my channel I already have done a very simple easy to use video also it uses V react Tailwind CSS and open as API as I mentioned earlier okay so let me take you to my terminal where I'm running this sub2 22.041 GB of fream courtesy Mass compute as we will be using API based model so you really don't need any um GPU for this video you can simply use it with the CPU so so let me create a k environment not this one okay maybe I'll just quickly create the environment first then we will get clone this so that it just keeps everything separate so you see that I'm just creating a cond environment which is a virtual environment with python 3.11 and the name is SD let's wait for it to get activated the environment is created let's get CL the repo and I will drop the link in video description to it and we have cd into it now as I mentioned you would need a node install so let me quickly show you my node version and you should have npm installed and I have the recent versions of it installed now in order to install all the dependencies let's run this npm I command and then let's wait for it to finish it is going to take bit of a time not that much though and that is all done and now let's run net with npm runev and you can see that now the application is running at our local system on port 8080 so let me access it and there you go the project is launched this is a strawberry 51 let me put my API key here and save it as I mentioned earlier if you don't have it go to platform. open.com and you would need to get an API key from there that is a paid option so I have entered my key and saved it and by the way when you paste your key it is visible so make sure that if you're sharing the screen you don't share that key okay so that is all done now as I said it is simply a fine-tuning one fine tuning means that you take your own data and then you train the pre-trained model on that data so that the model would know more about your own data it will have more context around it that is the whole purpose of f tuning now there are various techniques of f tuning I'm not going to go into to the details of that fine tuning in this one if you're interested I have covered it in various videos so please search the channel in order to use it all you need to do is to just click on new job from new job you can upload your own data file it requires the data file into in a Json L format which is a Json entries and I will quickly show you let's click on upload file it says that this is our uh file here you could um I'm not sure why it is not letting me upload because when I click here I thought it will give me some option but it doesn't do anything so what I'm going to do I'm going to go here on my uh local system this is a Json file which I have just randomly created with few of the Json L entries you see every line is in the different line and all the entries are in Json format which is a JavaScript object object notation and I'm just going to paste it here and then once that's done you see that it says this so only Jon L format is accepted and minimum 10 example required I have given it around 30 plus and once I click on that continue button it is asking me to select the model when I do the drop down you see gp4 gp4 mini I'm just going to select the mini click on continue and then it is asking me to configure the job you just name your model my model and then learning rate I'll just keep everything as is I'm just going to go it with one don't want to spend more money than required and then click on start job it is creating the job and then I believe if I go to job status there is our job you can refresh it is validating the file and I'm sure it is uploading it to uh open AI if I go there it is running you can click on view details it is telling you what are the job details here okay I thought it is my key but no it's not a key it is just simply okay so you see it is it has given me some error it says a job failed due to invalid training file unexpected file format okay so because you know it's a simple Json file it requires in this prompt completion pairs but I'm not going to spend the time here like so this is the one it's failed and then you can once your model is ready you can do the testing here you can provide more data and then here from you can just select more and then you can just simply enter your prompt and test your model whatever the model is whatever data you have provided there you go so you can chat with it here like this this is a rendered this is a raw with the API call so yeah so that's it um okay thankfully the AP key is not being shown here you can also go with dark mode cool remove AP key that is done but that's it guys I hope that you enjoyed it let me know what do you think about this if you like the content please consider subscribing to the channel if you're already subscribed please share it among your network as it helps a lot thank you for watching

Share your thoughts