DAY-2: Introduction to OpenAI and understanding the OpenAI API | ChatGPT API Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so guys uh I think I'm Audible and visible to everyone can you confirm in the chat yeah so yep I think I visible also my voice is clear so please do confirm in the chat guys if my voice is clear clear okay great so let's wait for uh 2 more minute uh I think uh people are still joining so we'll start uh within 2 minute so we'll start by 3:10 uh p.m. ISD uh still people are joining so we'll wait for two more minute guys I think from my side uh everything is fine my uh Voice is coming my uh video is visible so please try to check from your side as well uh so you connected your headphone and all I think U uh let just check everything is working fine or not yes so I think uh we can start with the session now so yeah uh welcome again uh so you all are welcome in this uh Community session generative AI Community session uh yesterday we have started this uh generative AI Community session where we have discussed about the generative AI so there I have given you the introduction related to the generative Ai and large language models and here you can find out the video so this is the dashboard uh it's a free dashboard actually uh which we have created for all of you the same video actually it is available over the Inon uh YouTube channel as well if you will go in a live section so this uh same video you can find it out over there as well now uh let me show you uh that particular video so here is my YouTube now let me search over here ion and here guys uh go inside this uh live section and this is the video so the same video same lecture you will be able to find out inside the live section apart from this uh the same uh thing basically we are uploading over the Inon dashboard and here along with the video you will find out the resources so all the resources basically whatever I'm using throughout the session uh so whatever notes and all which I'm writing and whatever ppts and all or whatever code file I'm using throughout the session you will find out all the resources over here got it guys yes or no so do you have this dashboard do you have this dashboard tell me I think uh many people uh enroll yesterday uh for this a free community session and yes all the videos and all uh basically we are going to upload over here not even video and resources along with the video and resources you will find out the uh live uh you will find out the quizzes and assignment as well so already uh I have prepared the quizzes and assignment so soon it will be uploaded over here so in this particular video you will find out one more section so the section will be quizzes and assignments so there you will find out a u like uh a video related or a topic related quizzes and assignment got it yes or no so please uh give me a quick confirmation in the chat if this uh dashboard related thing and this uh video related thing is clear to all of you I'm waiting for your reply in the chat and if you have any sort of a doubt then you can ask me in the uh like chat section as well and don't worry my team will give you the link of the dashboard so if you haven't enroll so far so by using that particular link definitely you can enroll it you can enroll um inside the dashboard great all clear all clear great fine so here I got a confirmation now uh so let's start with the session let's start with the uh second uh day so in the first day actually so what I discussed I discussed about the generative AI so where I have uh like told you that what is a generative AI so this is the slide basically which I was using and here actually this was the agenda the complete agenda which I'm going to discuss this uh throughout this committee session and uh today is a second day where I will start from this open AI so in the previous session I was talking about this generative Ai and I discussed each and everything related to this generative Ai and I hope you got a clear-cut idea that what is a generative Ai and uh in the geni actually what all things comes into the picture where llms lies so if we are talking about this large language model so regarding the large language model also I have clarify each and everything I have given you the complete timeline of this large language model where I have discuss about the uh the complete history of the large language model from the RNN so first I have started from the RNN then I came to the lstm then uh I discussed about the uh different different sequence to sequence mapping I talked about the encoder and decoder and after that I have explained you the the concept of the attention and then I have discussed about the attention is all your need uh the Transformer architecture and I told you that whatever llms which you are seeing nowadays so those uh all the llms are using Transformer as a base architecture so I have explain you the the like whatever thing was there inside the Transformer architecture whatever component whatever segment was there each and everything I have discussed over there and apart from this generative AI I have talked about this llm also so there I have talked about that what is a llm why it is called large language model and uh why it is so powerful because this one uh because this one llm is able to perform lots of like task lots of uh one uh basically llm U we can use for the different different type of application so here I have written the couple of name like text generation summarizer translation or code generation and so on we all know about the chat GPT uh chat GPT is a application and uh chat GPT is using gpt3 gpt3 is a a base model so gbd 3.5 actually it's a base model so how uh it is how much it is powerful we all know about it and that is a example of the large language model which is capable to do so many things why because uh it is having a power so so that actually it can generate a it can generate a data based on a previous data it can understand the pattern and because of that only we are able to trans we are able to use this Transformer as a or whatever like Transformer based model we have we are able to use those Transformer based model as a transfer learning I have explained you the concept of the transfer learning and the fine tuning as well so here I was talking about this llm and then I talked about the few milestone in a large language model so here I have written couple of name bird GPT xlm T5 Megatron M2M so these are the uh like a few milestone in a large language model now this model has been trained on a huge amount of data now specifically we are talking about GPT so in a GPT Family itself you will find out of various model I will talk about it I will come to the open Ai and each and everything I will keep in front of you only and uh I will uh I will show you that how much it is powerful so we are talking about GPT so it's like really powerful and it it has been trained on a like huge amount of data and it is having a billions of parameter so here is few Milestone so in our back days in our history basically we are using this particular models now in a recent day we got so many architectures so many uh open source models and all so I will talk about uh regarding those model as well so here in the next slide I have shown you so what all encoder based architecture we have what all decoder based architecture we have if we are talking about encoder and decoder right so in which architecture you will find out both encoder and decoder we are talking about bird xlm Electra DTA so these all are these all the architecture actually it is based on an encoder we're talking about this GPT GPT family so it's a Bas on a decoder itself and the idea has been taken from the Transformer itself now here you can see this stei Bart M2M big but so these are the model which are which is using this encoder and decoder both got it so now here uh then I talked about the openi based llm model so here uh the very first thing comes into the picture that is a GPD itself GPT 3.5 which is a like base model behind this chat GPD chat GPD just a application it's not a model now here you will find out this Delhi whisper the there are many model I will be coming to that particular model and I will show you how you can get all the model from the opena itself and uh yes we'll try to use those model for our task for our like a uh for the for our like a like a requirements and all definitely we try to use this particular model like GPT GPT 3.5 I will show you how you can use GPD 3.5 turbo visper da in or other model as well like aming and moderation so apart from that uh this apart from this uh like uh Milestone whatever Milestone I shown you and this open ey based model here you will find out some other open source model like Bloom Lama 2 Palm is a model it's a very famous model from the Google side nowadays like most of the people are using this pal Falcon is a model cloud is there MP 30 MP is there uh this 30b actually it is showing a parameter right and here we have a stable Im so uh estable LM so there are like so many open source model so I will come to that also and I will show you how you can utilize those particular model and apart from that I have like kept some more slight over here inside this particular PP so you can go through with that and you can understand some other uh like concept like how this chat GPT has been trained and all so I hope guys till here everything is fine everything is clear now we can move to the Practical part so please do let me know in the chat if everything is clear so far in terms of theory guys I'm waiting for your reply uh just a wait so let me give you the link of the website and uh yes guys I'm waiting for your reply so if you can confirm in the chat uh uh like every everything is fine or not so that I can proceed with the Practical stuff yeah definitely this uh PP is already there so just try to enroll in this course the dashboard basic basically which we have created this is our dashboard which you will find out over the Inon website so just try to log to your Inon website first of all if see if you are a new person so what you need to do you need to sign up after sign up uh you will login and after login you will search uh regarding this dashboard so here actually what is the name of the dashboard so the name of the dashboard is generative AI Community Edition so just click on this dashboard and here after clicking on this dashboard you will it will ask to you whether you want to enroll or not so yes uh you will click on the enroll and it is completely free so it won't ask you any sort of a money and after enrolling into this particular course uh you can get the videos and you can get the resources as well so all the resources we have uploaded over here inside this resource section got it clear great so I think everything is fine everything is clear now let's start with a uh let's start with a practical implementation so first of all guys uh let me clarify the agenda that what all thing we are going to discuss in today's session so for that what I'm going to do I'm going to open my Blackboard and here I will try to explain you each and everything uh like what what whatsoever we are going to like cover in this particular session so let's start uh let me write it down all the thing step by step now first of all I can write it down over here a day to community session and then I will begin with the topic so here guys are day two of the community session now uh yesterday actually I talked about the introduction part I talked about the introduction of the Gen Ai and the llm now now today I will be more focusing on the open AI so here I will be discussing about the open AI so first I will give you the U like a complete walk through of the openai website of the openai documentation after that I will come to the openai API that how you can use this openai API how you can use this open API and this API we are going to use by using this python so guys if you you know python so definitely uh like uh you will be able to write a code along with me uh and don't worry I will show you how to do the entire environment setup and all each and everything I will try to uh I will try to do in front of you uh from very scratch so uh you all can do along with me now over here I will come to this openi API and there I'm going to use Python and we have couple of more option like nodejs on all so if you are familiar with the JavaScript or maybe some with other language so in that case also you can use this openi API after that I will uh I will come to the openi playground so here uh they have given you very specific feature or very uh like uh very interesting feature that is what that is a openi playground so over here I will explain you that uh how you can use a different different model how you can uh like uh pass a different different prompts and how you can generate output how you can set up your uh like a different different sentiments and all regarding the system that okay so my system should behave like this or that so each and everything I will explain you over here and after that what I will do I will show you the chat completion API so I will use this chat completion chat completion and by using this chat completion actually uh we can call the GPT model so whatever uh like uh we can call the like openi API and with that definitely we can use any sort of a model like GPT model or any other model so first I will uh start with the openi API we'll use we'll be using a python over here and I will show you how you can generate the open key and after that I will come to the playground and assistant and then chat completion API and then I will explain you the concept of the function call function call now this is the agenda for today's session this is the agenda for today's Community class now before starting with the openi I will uh I I will explain you that why open ey is this much important why not other other like things or if we have like a other competitor of the open that why we are not using that instead of this open and if we are going to use that then how we can do that okay and one more thing I would like to explain you over here so along with the open a I will uh talk about the hugging phase so see over the hugging face actually hugging pH is has provided you one uh hugging face hub for all the models so there you will find out all the open source model so directly you can generate a hugging face API key and you can utilize all sort of a model whatever is there over the hugging face Hub yesterday I have shown you that let me show you again uh that particular Hub so guys here once you will write it down so over the Google so once you will search uh once you will write it down hugging face model Hub so there uh you will get a link and you just need to click on that so here you will uh and then basically it will be redirecting to you to this particular model Hub now here you will find out all the open source model from a different different organization so yesterday I was talking about this Orca 2 now here you will find out other model as well like whisper large V3 now from the Facebook side there's a seamless okay now here you will find out other model as well so see from The Meta side there is a llama lamb 2 so I will show you how you can utilize these particular model for the different different task according to your requirement getting my point so we will not restrict it uh we will not restrict to ourselves to the till the openi itself apart from that we'll try to explore few other model few other open source model and yesterday actually I have shown you one more platform and here's the platform AI 21 studio so it it gives you one model this Jurassic model so we can utilize that particular model also and this all are called large language model this IDE this thing is clear to all of you yes or no so uh what is the difference between hugging face and open AI so openi is a different organization hugging pH is a different organization and over the hugging face up see uh if you have heard about this Docker or this GitHub so first of all let me show you this GitHub so if I'm searching about this GitHub so here actually over the GitHub you will find out uh like see this is my GitHub and uh you all have the GitHub ID right you all have log to the GitHub and all and first you sign up and then you log in and whatever course and all you are having and definitely you are going to upload it over here uh in terms of repository now let's see if I if I have to find out something so what I will do here let's say if I'm going to write it down GitHub machine learning uh linear regression so GitHub machine learning machine learning linear regression so here if I will search uh like this the definely I will get a link and here you can see so it has suggested me one repository and you will find out uh this uh code and all whatever code and all has been uh uploaded by this particular person and definitely you can download it and you can use it similarly we have a Docker Hub similarly we have a Docker Hub so let me show you the docker Hub so the docker Hub actually you will find out all the images and all so let's say uh like uh you downloaded Docker in your system you did setup and all now uh you don't you don't want to install it from scratch you want to run it by a Docker so yes there is a Docker Hub and there you'll find out different different images and all so you can uh like uh you can pull that image and definitely you can run it inside your container so similarly we have a hugging face Hub there uh like it is uh it it is going to provide you a different different model actually on a single place so yes uh just uh you just need to log in over there and after that you need to generate a API key and directly you can use those particular models whatever is there like over the hugging face Hub now similarly we have openi it's other another organization so yes by using the openi API we can access the openi model as well so here uh okay so if you will find out if you will see to this openi this one this is the openi right now I will show you what all models this openi is having it is having a different different model various model I will come to that I will show you from very scatch so till here everything is fine guys everything is clear so uh just give me a quick quick confirmation so that I can show you the entire setup related to this opena API and we can run a couple of uh like couple couple of line of code as well so please do let me know in the chat if uh everything is clear so far yes we'll talk about the fine-tuning and all so how we can uh do the fine tuning regarding a different different model uh it's not a like easy task it's a a very expensive thing so we'll talk about it yes hugging face model are free yes correct for building a model uh so for using uh if you want to use that particular model so either I can use openi so or else I can use hugging phase see whatever model is there over the hugging Force definitely we can access that but let's say open a is having there uh like a uh it's a separate platform right so so whatever model is there over the open AI so we'll be able to access those model only from the open AI not all the model which is there inside the hugging face also but hugging pH actually is having all the models open source and all whatever model is there and some of the model from the open ey side as well but open ey actually it's a specific a specific one a specific organization clear yes or no so please do let me know if uh this thing is clear to all of you so that I can proceed with the uh next part next section great so people are saying sir it is clear clear clear okay great yeah the model is already created over the hugging pH and open ey they already trained the model we don't have all the models in the ging phase that's why we are learning this open a great so I think uh all the thing uh like each and everything is clear to all of you now let's start with the uh like uh next part of this session so here I have uh discussed about this open a and this hugging phase and I clarify the agenda that what all thing we are going to discuss but before starting with the openi so let me give you the brief introduction of the open AI that why this open AI is too much important so for that what I did I have created one small PP so with that actually you will get some U uh some basic idea uh regarding this open AI so here uh let me start uh let me start the slideshow so over here guys you can see about the open a if we are talking about the open AI so what is the open a openi is a leading company in the field of AI it was founded in 2015 as a nonprofit or organization by same Alman and Elon Musk as we know about the uh founder of the like open so yes uh I think we are we are aware about uh with this particular names right same Alman and this Elon Musk and it has founded in 2015 as a nonprofit organization just for the research purpose now here in the next slide I have kept the name so he's a like he's a uh CEO of the open a same Alman and and uh yes I think you know about the Sam ultman he was fired by the openi board we'll talk about that also what what might be the reason behind that so we will discuss about that uh as well now over here you can see uh openi founded in uh 2015 and the company founded with the goal of developing and promoting friendly AI in a responsible way that was a logo of the open AI so with a focus on transparency and open research and he was the and they are the founder member of of the like open a so Elon mus Sam Alman Greg Brockman okay this guy is a like great researcher and vak and zon so these are the founder founding member of the open AI now over here our open AI goal so there are some goals of the open a related to the AI and all now open a milestone so I was talking about that why this open a is too much important why not others because if you will look into the market there are other uh there uh there are you will find out other organization as well uh so we have a Google and Google is having their separate Department Google uh AI research and all so Microsoft is also having their own department for the AI research even meta is having that even IVM so all the like big big giant so they they are having their own research uh like Department related to this Ai and all and they are working on that and they were working on that actually but why this open a is too much popular and why we should start from the openi itself so you know about the openi in 2020 actually they have launched the Chad GPT and guys believe me it was the Milestone and it was the major breakthrough in the history of the AI because before that also we are having so many llm model and it was able to do uh some sort of a thing but not like to not similar like to this GPT this GPT actually the GPT model which is a backbone of this Chad G P application uh it was a a breakthrough in the history of the NLP and because of this this open AI came into the Limelight and uh apart from the GPT then uh uh like they have shown or they have released the other different different research so here here I have written couple of name basically so a generative model is one of the Milestone of the openi now apart from that you will see that they are going to uh they are going to participate in the robotic research and all and here here uh like other uh like other few more thing basically so solving uh robic Q with a robot hand and here multimodel neurons and artificial neural network you can search about uh this particular things and yes uh this open actually it become uh very uh important uh basically because of this uh like GPD and all because of this uh chat GPT application and uh yes they were using a different technique for training this uh G GPT model which we are using for the chat GPT and the idea from where they took the idea uh for training this GPT model there we have unsupervised learning we have a supervised learning and we have this reinforcement learning so they took from the ULM fit research paper yesterday I have shown you that which has been published in 2018 and in 2019 in 2020 actually they have released this GPT chat GPD got it now here you can see building with open AI API so these are couple of name giup copilot keeper text Bible dingo so these are some application which is using this open API and apart from that you will find out so what's the open a vision so the vision is like uh promote a friendly AI in a way that benefit all the humanity and all so this is a vision of the openi now feature so chat GPT Delhi whisper alignment so these are the feature of the open AI Chad GPT is a a milestone Delhi is also the Del 2 recently they have they have released the Del 2 whisper is uh one of them whisper actually it is a very good model for generating a transcript and all so whatever like text we are giving or whatever like videos we are giving to this particular model it is able to generate a transcript from that and here uh alignment is there startup fund so these are some feature of the open AI now guys uh before starting with the open a API I think you got enough amount of idea uh regarding this open AI yes or no please do let me know in the chat if uh this part is clear so I will proceed with a uh open a API so how you can generate a key and all and how you can utilize that yes are you getting guys whatever I'm explaining you over here uh if you have any sort of a doubt anything so you can ask me in the chat section I will reply to all of your doubts so step by step we'll try to proceed uh and uh so each and everything will be clarified great so clear yes waiting for your reply uh if you can write it on the chat so then I will proceed what is the learn to what is the aim to learn open AI so that I can utilize the same capability same AI capability in my my application whatever model has been trained by the open so that I can use the same model in my application for a different different task great so I think I have uh discussed each and everything related to the open now this is the website of the open so if you will search open definitely will get a website of that so so in the website itself they have mentioned everything so latest update whatever uh latest update and all it is there so they are mentioning over here and Sam Alman return as a CEO of the open a I think you know about this controversy of the open a so let me uh give you some sort of a glimpse of that uh if you know about the open a so it was founded as a nonprofit organization but uh in 2019 actually they have uh started with their uh for-profit organization as well if you will search about the for-profit organization of for-profit organization of this open a so in 2019 actually they have started this a for-profit organization and uh it was doing uh lots of work uh regarding this Ai and all and they collected uh like uh funds from different different companies and all from a big big giants and uh they were working on the GPD model itself okay now after that uh this chat GPD has been released and in 2022 actually 2022 or 23 basically so uh they started work on a uh like a different type of project so the project name was the qar the uh basically the project name was the qar and it was more specific to it was more specific to towards this AGI so may I know guys what is the full form of the AGI if if you know uh the full form of the AGI so please write it down in the chat what what you uh understand with this AGI so the full form of the AGI is please write it down the chat if you know about the full form of the AGI please do it yes artificial Journal intelligence correct so the full form of the AGI is artificial Jour intelligence actually see if we talking about this chat GPD now this particular application it's not it is not representing a journal artificial intelligence it is a restricted one it's a specific one getting my point so let's say there one side there is a Chad GPD and one side there is a human so definitely this Chad GPD can answer in a better way it can generate answer in a better way compared to this human but still it is not like a human so still we are not on that particular level where we can achieve a artificial intelligence like a human that is called artificial general intelligence and the project name was was given by this open the project name was the qar and that was happening in the for-profit organization this is the subsidary of the opena itself getting my point now because of that uh so there was a conflict in between the board member and uh this Sam Alman was fired and now again he joined the company uh there is a long story but yeah I have given you the Glimpse you can search over the internet and you can uh read about it uh okay so if you like to read the AI news and all AI related news news and all so definitely uh you should check it on a daily basis because on a daily basis there's something is happening on a tech side on a like organization side uh whatsoever so over here guys uh here you can see the open a website now if I will scroll down so you will find out each and everything over here itself that what all research is there uh what all upcoming models is there uh on whatever applications they are working so each and everything actually you will find out over here itself so here uh recently they have released this delhi3 so in October uh 2023 3rd of October 2023 they have released this Delhi 3 there was a GPT 4 GPD 4 Vision where we can uh upload the images and we can do a lots of lots of task related to the images and all getting my point so here you will find out a research whatever latest research is there from the opening side no need to go anywhere everything you will find out over here itself if you want to start from the openai if you are using this open a in your organization if you want to use it and before that if you want to explore it so please go through with the website and here you will find out each and everything now guys here is a question I told you that why uh what is the open now why we are learning it I have to give you the specific answer of this particular question if you will ask me sun why we are learning this open a what is the main Aim so now let me tell you that so first of all guys after opening this opena website what you need to do you need to log in it you need to log to this particular website and here you will get two option so the first option is a chat GPD and the second option is a API so we all know about this CAD GPT I think uh we all have used this chat GPT and I think we are using it on a daily basis now we are not going with this chat GPT we are going with this API so I will click on this API option and once I will click on this API option so I will G get this type of interface so I believe guys you all are getting this particular interface after clicking on this API please do let me know in the chat if uh everything is uh uh like going fine uh like me so please do let me know in the chat great so yes I think uh people are doing along with me now see guys here is what so here is a uh like open a API uh so once you will click on that you will get this particular interface now just uh over your mouse left hand side and here you will get a different different option or various option now what you need to do guys so here first of all you need to click on this documentation so just click on this documentation and you will come to this particular page now here you will find out this overview so here they have given you the complete overview about the openi API that what all things they have and uh for what all applications we can use this openi API now here you will find out the introduction section as well so in the introduction section they have defined some sort of a thing related to a different different task like text generation embedding assistant tokens and all now here you will find out the quick start so let's say uh you want to explore this openi API so what you will do at the first place so after opening this this openi uh a openi API and after opening this uh after opening this particular documentation you just need to click on this quick start so after clicking on this quick start you will get all the code which initially you need to run inside your system getting my point if you want to use this openi API if you want to use this openi API and you want to run the code if you want to start then for that what you need to do you just need to click on this quick start and over here you will find out different different option so let's say you know the nodejs so here you can click on this nodejs and you will find out entire setup related to this nodejs how to install the package how to uh set the key and all now here you'll find out the different different uh like Windows different different operating system related option and here you will find out the code snipp it so directly you can run it and you can use it now if you are a python lover if you know the python only in that case yes they they have given you the option so you just need to click on this uh Python and here you will find out the complete setup guide so how to install a python how to install how to create a virtual environment how to install this openi Library so and after that you will find out this uh setup uh openi key uh regarding this Mac OS and windows now here you'll find out how to uh request to your openi uh API how to request to the different different models so here is a code s snippet so we are going to use this particular process uh if uh so yes you can use the same process don't worry I will show you how you can do the entire setup and all and how you can call the different different model now over here you will find out a model now guys this model actually this model is a uh like a very important part of the openi API now here they have given you the various model like GPD 4 GPD 4 Turbo gbd 3.5 Delhi is there TTS is there whisper is there aming moderation GPD 5 is there GPD 3 which is a legacy now and here you will find out some deprecated models so here they have given you some deprecated model like uh GB 3.5 Turbo with this much of tokens and here you will find out this text Ada Ada text weage text cury text DaVinci so these are the deprecated model you can use it if it is required definitely you can use it so here you will get a complete list of the model whatever model you want to use for your task for your particular task now over here uh this is the uh like overview regarding the model now if I'm clicking on this GPD 3.5 so once I will click on this GPD 3.5 so here I will get a complete detail regarding this particular model now here is a what here is a model name so what is the name of the model GPT 3.5 turbo 1106 okay now over here you will find out two two things so the first is what context window now in the context window you will find out the number of tokens now guys this tokens actually the number of tokens this plays a very very important role if we are talking about this tokens so really it plays a very very important role and I told you if we are giving a input to our model to our llm model so we'll give in the form of prompts and prompt is nothing it's a collection of token so whatever input and output we are getting we are getting in the form of prompts right so we are giving a prompt to our model and we are getting a prompts from our model and this prompt is nothing it's a collection of tokens now we'll talk about this tokens and all then how much token is uh so as a return actually how much token you can get as a output as a free one actually this uh Chad this open a actually it stopped the free services now so before actually uh uh you would be getting this uh let me write it down over here so $20 of credit so earlier if you have used this uh open AI so you must have seen that uh if you are uh like uh if you are going to create a open API key so in that case it was giving you this $20 free credit now they have stopped this particular service now they are not giving to you so first of all what you will have to do so first of all you will have to add the method a payment method actually so you will have to add your credit card or debit card details and after that you will have to set your limit let's say $20 $50 $100 or whatever uh like limit um actually you find out it is fine so inside uh in that basically in that particular limit uh my work will be done so first of all uh you need to add the payment method and you need to set the limit and then only you can use this openi API so recently they have updated this particular thing now we have alternative also so we have this AI 21 lab so I will uh show you this uh thing as well where we have a Jurassic model and it it gives you the $90 fre free credit $90 free credit but you won't be able to use this GPD 3.5 because it is only the it is only available in this open itself if you want to use this GPD 3.5 model GPD 3.5 turbo or gbd4 so it is only available in the opena itself and they haven't open source it and for this one you will have to pay if you want to use it in your organization in uh with respect to your task so definitely you will have to pay for that getting my point now over here guys see uh it return a maximum of 4096 output token so regarding this particular model now here you can provide this much of tokens actually so this much of tokens as a uh input as a input basically and you will get this much of token as a output if you are going to use this particular model now here GPD 3.5 turbo So currently point to GPD 3.5 turbo 0613 will Point GPD format turbo 11 starting datee this is this is the starting date and here this is the token size now here this is the token size basically they have given to you so you can uh provide this much of token and here you will be getting output in uh like as uh this is the maximum token size actually uh with respect to this particular model so you can go and read more about this model and all and here you will find out this training data so this uh model has been trained up to 2021 September 2021 and here uh these all are the model so I will uh use use any sort of a model from here itself and I will show you how you can hit it by using this P open python API now apart from that uh you will find out some other uh thing so let's say if I want to do a text generation so they have given you the complete detail regarding that and here they have given you the API endpoint as well so you can click on that and here in this particular way actually you need to write uh prompts and all you need to define a prompts and all so actually this is the uh rade assistant uh as of now it is not working so you can click on that or you can use it this API endpoint inside your application so uh here they have given you the code that if you want to perform this particular task this text generation task so directly use this Uhn code snippet after setting up the environment and all after generating the openi key and you can perform this text generation over uh text generation if uh this is required according to your uh like application and all now over here you will find out the other option so uh embedding is there so embedding is nothing uh embedding actually you are just going to be uh convert your text into a uh some numeric numbers and here uh this eding comes into a picture and this this is very robust model from the open side and definitely you should use it uh I will show you how you can utilize this particular model and you find you will find out the complete code in spp it and all and yes you can generate an Ming regarding your test Ming is nothing it's just a numeric representation of your text now here uh if you want to do a fine tuning so regarding that also you will find out a complete detail so how you can do a fine tuning and all now image generation is also there so if you want to do a image generation so which model you should use from here Vision related to The Vision also there is a gp4 now a vision related facilities it is there inside the gp4 itself text to speech speech to text moderation so no need to train your uh no need to train your model your uh NLP model from scratch now so they are giving you everything you just need to call the API and you can utilize it now many people are asking to me that sir what is the aim to learn behind this openi and all so the aim is very very simple if you want to use this particular model for your uh uh different different task the task basically which they have mentioned over here you can directly use it you no need to like train it by yourself because this model has been trained on a huge amount of data now that's why it is called llm I told you clearly right yesterday what is the meaning of the llm and yes in most of the cases in 99% of the cases it will work fine if let's say if you want to do a fine tune this particular model so definitely you required a higher resources and in that case you will have to pay to the openi as well getting my point so here you can read uh entire detail regarding this fine tuning and all so once I will come to this fine tuning part I will explain you this uh thing as well how to do the fine tuning and all regarding this model definitely I'm not going to do it uh in the live class but yeah I will give you the uh quick guidance regarding uh this fine tuning so I hope guys uh this model related thing model related part and this quick start and this introduction and what of capabilities is there so this thing is clear to all of you if it is clear then please do let me know in the chat yes or no so waiting for your reply please do let me know in the chat what what are the job opportunity after this particular course so after that you can apply as a NLP engineer uh you can work on a gen related project you can work as a uh gen a engineer so if you are going to complete this particular course so after that you can join uh the company uh like whatever designation I told you on that particular designation and here in an interview do they ask from the scratch inside of using API no they won't ask you that you need to like uh you just show them like how to use the API and all no they won't ask you this particular thing uh they you just need to tell you what was your use case which model you have used and uh what was the cost regarding behind that particular model uh how you you have designed your prompt template how many tokens basically there uh you were uh defining inside your prompt in U basically inside the input input prompt and how much tokens basically you are getting inside the output prompt okay so these are the thing uh like uh they may they might ask you regarding this uh uh like open AI API and all and openi models uh they won't ask you that uh generate this key that key or whatever do we need to learn all the underlined math behind the model hugging face and open ey yes the architecture should be clear so the architecture part should be clear uh architecture means what so uh the base architecture Transformer architecture they definitely they might ask you the Transformer architecture in one of the interview they they have asked to me that uh can you explain me the transform architecture what is the meaning of the positional uncoding why we are using a skip connection over there and can you code it as well so if you want to use this Transformer in the python how you can do that which uh like which Library you will call or can you write it down the code from scratch so this type of question you might face if they are going on an architecture level they won't ask you the uh they won't ask you the architecture of the different different model which is there over the hugging face and all no they won't ask you that so can we proceed now if uh this part is clear tell me guys fast yes or no I given you the complete walk through of the open uh website open API now I will show you how you can utilize it and don't worry guys I will uh show you the advanced thing as well I will show you the Advanced part as well uh I will show you this function uh calling and all and uh first let me complete this uh uh chat completion and after that I will come to the function calling great so here uh I think this thing is clear now let's try to start with the Practical implementation so for the Practical implementation first of all uh what you need to do so let me uh write it on the step all the step so here uh the first thing what you need to do see uh you should have uh you should have this uh Anaconda inside your system I think you know about this anakonda what is this anakonda it's a package uh it's a package manager for the data science projects and all so you should have this uh Anaconda inside your system the second thing uh python must be installed python must be installed now here uh whatever practical which I'm going to do so I'm going to do by using the jupter notebook so here let me write it down uh the Jupiter notebook now whatever practical and all whatever I'm going to do I'm going to use uh basically I'm going to do by using this jupyter notebook in the next class uh I'm going to uh create an end to end project first of all uh before starting with the end project I will come to the Len chin and there I will explain you that each and every concept of the Len chin that how it is different from the openi and why we should uh why we should use it and after that once I will come to the end to end project then I will I will start from the vs code itself vs code Visual Studio code so any ID you can use I'm not restricting you for the ID and all so if you are familiar with a py Cham you can use that also if you are familiar with the like any other ID you can use that but yeah I love this vs code so uh for the project for the end to end project I will use this VSS code as of now I am going to use the Jupiter notebook uh just for the uh like open a uh python API uh so guys if you have this two thing this three thing actually inside your system so after that what you need to do you need to create one virtual environment so uh here by using this cond by using this cond you need to create one virtual environment I will show you all the step don't worry so here you need to create a virtual environment there inside and after creating a virtual environment you need to activate it activate this virtual environment and here you need to install all the packages all the required packages inside this this virtual environment so here you need to install all the required packages so let me write it down over here install all the required packages now uh required packages means what required packages means so you need to install this open AI as of now and we have other packages also like pandas numai and all so if I will be uh if I will be having any sort of a requirement uh regarding the pandas numine or regarding any other packages so definitely I will install that also in my virtual environment now after installing all sort of a thing so after like creating a virtual environment after activating it and after installing all the packages then what I will do I will be starting with the Practical implementation so guys in my system I already having Anaconda so you can uh download it by searching this Anaconda so just go through with the Google and search over here Anaconda download so on once you will search this Anaconda download so here you will get the website uh here you will get a link so just click on that and here you will get a option for downloading this Anaconda now uh it is giving you the option based on your operating system so if you are using Windows if you using Mac or Linux according to that you can download this Anaconda now apart from that uh one more thing will be required so if you don't have python in your local system so you need to download that as well so python uh download so here I'm going to write down the python download and and yes uh this is a website of the Python and here you need to uh here basically you can download the python by clicking on this particular website I would suggest you uh download this 3.10 or 3.11 don't download the latest version this 3.12 or this 3.13 actually uh it is having some sort of a like issues so better uh okay don't download this 3.11 also either download the 3.10 or 3.9 it will be working fine or you can download this 3 3.8 also this all three version is a stable version fine now after downloading this anaconda and this python inside your local system then what you need to do so once you are ready with the Anaconda and this python after downloading installing and all you need to search Anaconda prompt so here uh you will find out the uh like Anaconda prompt so once you will search over here in the search box Anaconda prompt so there itself you'll find out the Anaconda prompt now this is what this is my anaconda prompt guys this one now here actually this is what it is it is showing me a base environment as of now this base is a by default environment now here what I need to do I need to create a virtual environment how I can do that how I can create a virtual environment so for that we have a command now here the command is what cond create so cond create hyphen n and here I need to write it down my environment name so here my environment name is what testing open AI so testing open AI this is what this is my my environment name you can give any XY Z name over here I don't have any issue now you need to mention the python version so here you need to write it down the python equal to 3.8 now guys here I'm going to use 3.8 you can use 3.9 3.10 don't use 3.11 12 and 13 3.8 7 9 10 these are the stable version and you can use it for your project now as soon as I will hit enter so yes I will be able to create an environment so yes let me hit the enter and it is creating an environment so are you doing along with me if you are doing along with me then please do let me know in the chat guys yes I okay so people are saying yes we are doing it can we do so using API as well as our make model if you have trained your own model then definitely you can do it great so many people are doing a lot with me I think now here you can see so uh this is what uh this is my base environment sorry this is my base environment and here I have created a virtual environment and this is my virtual environment if I want to activate it so for that this is the command so here you need to copy this command and just paste it over here and so you will be able to find out that I have uh I'm able to activate my environment now you can clear the screen so for that you just need to write it down the CLS and here is what guys here is my virtual environment now here what you will do see uh first of all you need to check that what are libraries is available inside your virtual environment so for that you can write it down the command the command is what the command is PIP list so once you will write it down this pip list here you will find out all the library whatever is there as of now inside your virtual environment so these are the library which is there inside my environment and here I uh still I haven't uh downloaded this uh openi open a package because by using the open by downloading the openi package only by using that open Package only I can hit the API getting my point yes or no so don't worry I will give you the entire step whatever step I'm following over here now here first of all you what you need to do see I told you over my Blackboard that after creating a virtual environment you need to activate it and then you need to install the required package and before that I told you one thing that everything I'm going to do inside the jupyter notebook so guys here in this particular environment in this virtual environment you need to download or you need to install the jupyter notebook and for that we have a command so let me write it on the command pip install Jupiter notebook so here I can write it down g u p y t r i o t e b k so this is the command pip install jupyter notebook and with that you will be able to to download the Jupiter notebook n o t so this is the correct spelling let me rewrite it again yeah so is installing a jupyter notebook are you doing along with me tell me yeah so here let me write down the command in the chat section so cond create hyph n and you can write it on environment name whatever you want to write it down so let's say testing open a and here python version is what 3.8 so this is the command uh you need to run this particular command for installing the sorry for creating a virtual environment now let me give you one more command so here you can check all the listed uh Library uh all the like Library whatever is there inside the virtual environment pip list is a command now let me give you one more command so here is one more command pip install Jupiter notebook so pip install jupyter not notbook so these are the three command did you get it uh please do uh confirm in the chat please give me a quick confirmation in the chat see if you're not installing this jupyter notebook in your current virtual environment in that case it will launch the jupyter notebook from your base environment so it is a better practice if you are creating a virtual environment then please install the jupyter notebook or please install the uh ipnb kernel over there so now if you will find out uh now if you will search pip list over here so just search pip list now once you will search pip list then you will find out lots of libraries or lots of packages which came along with the jupyter notebook now see here you can see all the packages and all after installing the jupyter notebook now once I will write it down the jupyter notebook on my anaconda promt so here let me write down the Jupiter notebook and it will open the notebook so once I will write it down the Jupiter notebook and you will see that yes it has opened the Jupiter notebook so got it guys yes or no please do let me know in the chat if you are able to launch your jupter notebook if you are able to launch the Jupiter notebook then please do let me know in the chat yes or no yes and after that you need to launch your file so you need to launch your notebook so click on this notebook and here is what guys here is your notebook so this is your notebook and each and everything we are going to do here itself inside this particular notebook now uh just make sure that you have this python uh Python 3 over here uh this uh ipynb kernel if you don't have that so please try to select this Python 3 ipy kernel and I think now everything is ready so let's try to let's start with the openi API so test open API and now let me rename it so here guys you can see this is my test openi API uh this is my file actually this is my notebook I hope you all have created this particular notebook if you have any doubt then please do let me know in the chat everything is clear everything is sorted please guys go ahead so just be a little interactive uh please write it down the chat if I'm asking something so if you if you can if you will write it down the chat so definitely I will get motivation great so now let's start with the uh like open a API so first of all what you need to do so here is what here is my notebook so let me do one thing let me keep it uh keep this notebook over here itself and this is what this is my Jupiter notebook so first of all just go through with the openi website so here is your openi website guys this one now here you need to click on this quick start here what you need to do here you need to click on this quick start after clicking on this quick start so here they have given you the option the option is what python so here they have given you the three option call Python and node.js so click on this Python and here they have given you the complete instruction so first of all guys what you need to do you need to install a python so yes uh I think you already have installed this python you need to set up a virtual environment yes we set up the virtual environment and why this virtual environment is required so see uh for uh one particular project we have a lots of dependency if I want if I want to if I want to segregate all those dependency project to project okay so for that only we create a virtual environment so what is the requirement of the virtual environment because we have a several dependency on a single project if I want to keep it apart for that only we create this virtual environment got it so here they have created a virtual environment directly by using this python uh en and you can use this also for creating that but I'm using the Anaconda now here after that you need to install this open AI so here uh what you need to do guys so here you need to install this open package and then only you can hit the open API getting my point point so just copy this particular command and install this open Package in your virtual environment so here is what here is my virtual environment let me open that particular environment uh just a second what I can do here I can keep it this to my same T fine now over here guys what you need to do you need to open your anaconda prompt see here actually I have launch this jupyter notebook so you cannot stop the server of this jupyter notebook so I'm opening a new Anaconda prompt so here you just need to write it down this Anaconda prompt and you will be able to launch a new Anaconda prompt now guys just tell me what is my environment name testing open AI so here uh you just need to write it down uh cond EnV list so once you will write it down this cond EnV list cond EnV list so let me write it down this cond EnV list so you will get all the all the environment name so here guys you can see this is my all the environment which I have created in my system by using this Anaconda now uh here uh this is my environment testing open I want to activate this particular environment so I can write it down over here cond activate and here I can write it down my environment name testing open AI so once I will write down this and if I will hit hit enter so I will be able to activate my environment I'm going to uh I'm going to do a uh transition from base environment to this testing openi environment this is what this is my virtual environment this base environment is a default environment now over here what I will do I will I'm going to write down the CLS for clear the entire screen now over here I will just paste this particular command pip install hyphen iph upgrade open AI now once I will hit enter so yes uh I'm able to install this open AI inside my virtual environment so are you doing along with me are you able to install this open inside your virtual environment if yes then please do let me know in the chat in the virtual environment you need to install the jupyter notebook by using this pip install jupyter notebook command if you're not doing it in that case it will be taking a jupter notebook from the it will be launching a jupter notebook from the base environment many people now people are saying yes we are doing it how how many of you you are doing along with me please do let me know in the chat how many of you you are doing along with me yes yes yes okay great yes please write it down the chat if you are doing along with me then if you uh launching uh jupyter notebook from the base environment it will take all the packages from there itself that's why I want a fresh one that's why I'm uh installing jupyter notebook in my current environment now over here I think I have already installed it so yes it is done now and if I want to check it so for that I'm uh I'm opening my jup notebook again and here you need to write it down uh import open a so just write it down this import open Ai and here guys you can see we are able to import this open AI if you are done till here then I will proceed with the further python code so please give me a quick confirmation in the chat if you are able to import this open a I'm just I'm waiting for 1 minute I'm waiting for uh 1 minute uh to okay so please uh give me a confirmation in the chat if you are able to import this open AI inside this jupyter notebook we are ready to go great now uh let's start with the uh openi API that first of all guys we need to understand that what is what is this openi API so for that what I did I kept I return like uh some sort of a like uh um wait let me do one thing over here let me copy and paste yeah so here guys what I did I written some sort of questions and answers and here the first question is what the first question is what is openai API so by uh uh like uh so here by using this particular question so by reading this particular answer actually we can understand that what is this open a API so this openi API has been designed to provide developer with seamless access to stateof Art pre-trained artificial intelligence model like GPD 3 GPD 4 Delhi whisper ambing Etc so what is the meaning of it so if you want to use if you want to use the same model whatever model has been trained by the open AI so these are the different different model uh the name basically I have written over here gpt3 GPT 4 Delhi is a model whisper is a model aming there are different different models model right if you want to use this particular model inside your application so that uh so then basically you should use this open API now over here by using this openi API you can integrate Cutting Edge AI capabilities so this model actually it's a large language model and it is having a lots of capability in terms of a different different task as I explain you so by using this particular models you can uh like utilize uh that capability you can utilize the capability and uh you can utilize that particular capability and you can integrate inside your application getting my point and regardless the programming language so here they have they have given you two option so the first one is a Python and the second one is a nodejs so uh what is this openi API so this open API is nothing it provide you the seamless exess of a pre-trained artificial intelligence based model uh for your uh like a different different application whatever application you are are going to create and let's say if you are going to create any individual application which is based on NLP use case yes directly you can uh use this particular model instead of trading your model from very scratch now here so the conclusion is what so the conclusion is by using this openi API you can unlock the advanced functionality and you can enhance the intelligence and performance of your application so let's say there is Inon website and the Inon website you must have seen the chatbot option so in the chat board actually uh you are doing uh you are connecting with our expert so let's say there there's one person who is having a doubt so now this person what he is doing he is going to be connect with a uh like expert so here is the expert which is sitting behind this particular chatboard now he is asking the question and he's getting a reply yes or no now guys just see over here so here uh like you have integrated this chat board and this chat board is a uh it's not a like EI related chatboard so the person so here uh in the behind behind behind to this chatboard actually when expert is sitting he is giving you the answer now you want to uh like uh what you want to do guys over here so you want to use some sort of a AI now here you want that that type of model which will be able to answer all of the answer basically whatever the person is asking like chat GPT so in that case you cannot train your own model if we are talking about if we are talking about about like the llm model so in thata in that case basically you cannot train your own model because it's a very very expensive let's say if you if you are just a startup okay or let's say if you are just a Learner in that case in that case you cannot invest this much of amount for training this particular model because it's a expensive process if you are going to set up the infrastructure if you are going to uh like if you are like hiring a developer ai ai developer and all mlops engineer so in that case definitely the cost will be around 1 to 10 CR because in that case you will have to create a distributed setup you will have to purchase a gpus there should be a team but proper team okay for the monitoring and all for each and everything there there will be a developers so the cost will be very very high in that case what you will do if you want to uh take an advantage of this AI uh cap if you want to take a leverage of this model whatever model has been created or trained by this openai what you will do you will use this openai API you will uh call this openi API and by using this openi API you will be able to access this GPD model and directly you will be able to uh like append this model inside your chatboard so whatever person is asking definitely your GPT will be replying in that case and let's say any escalation is is happening in that case so definitely you can uh write it down your logic your code in uh in such a way that this request will be moved to the expert and now the it will be handled by the expert itself so like design you can like this B basically you can design your system this is just a one example which I have given to you great I think uh everything is clear now over here so what is open API this part is clear now the second question is what the second question is generate a openai API key so here what I have to do I have to generate a openai API key what I need to do guys I need to generate a open API key without this I cannot use the open API without this particular key so for that what I need to do what is the process let me tell you that so if I want to generate if I want to generate a open a API key so just go through with the openi website so here is your openi website and here just over your mouse uh on this particular side on the left hand side now here is a option this API key so just click on that and here guys you will find out a option to generate or to create a new secret key are you getting this option are you getting this particular option please do let me know in the chat if you're getting it then after logging in to the open website then only you will be able to find out this API key option and guys uh you cannot generate a openi key without adding any sort of a payment method so first of all you will have to add the payment method and don't worry in the next class I will show you how you can use hugging face API key for the s same thing for the same task definitely we won't be able to access other models like gbd3 GPD 3.5 turbo or GPD 4 and all but yes uh we'll be having access of a different model different open source model or whatever model is available over there in tomorrow session I will show you how you can utilize the hugging face API [Music] key you can finetune the model again it will be an expensive task Vishnu great so here you can see we have a like option to generate a like here basically what we can do we can generate a API key now for generating a API key you just need to click on this create a new secret key and here you need to give the name so let's say I'm going to write down the name uh my API key so this is the name of my API key once I will click on this create secret key so yes uh definitely I will be able to generate it now guys over here you can see this is my key uh definitely I will delete it right after the session otherwise you will exceed uh the limits and all all right so here I have generated my key and after the session I will delete it so no one will be able to use it so I have generated a key now what I will do I will paste it down in my Jupiter notebook over here so here is what guys here is my key so this is what this is my key basically which I have generated so here uh let me uh paste it down this particular key this is what this is my key now you have to generate your own key okay and don't share your key with anyone else so here this is what this is my key now what I need to do after generating this open AI key I have generated the open a key and I have kept it over here now after that I need to call the open AI API so how we can do that so for that we have a couple of a couple a couple of line of code so let me paste it over here or let me write it down over here and then I will show you how we can hit any sort of a model now for that uh basically what I did so over here uh just a second yeah so first of all let me show you the list of the model as well now over here I can write it down uh on line of code so open a uh do API key API uncore key and here I need to write it down my key here I need to write it down the variable basically where I have kept my key so once I will run it so here you can see open AI open AI API key yes I'm able to set my key now here I will call one method so my method name is what open EI dot model model underscore uh model. list so once I will call this particular uh method so here you will be able to find out your all the model see there is all the model basically which is available as of now in the openi plateform now here you can see it is giving me some uh it is giving me output in a different way so what I can do I can convert it into a list so over here what I can do I can convert this uh particular output this particular response in a list so here uh this is my all the models so I can create a variable allore models and here I can pass this thing to my list method now see guys uh I will be getting all the model all the models uh whatever model is there inside the open so the first one is a text search web page uh doc 001 and here is a date actually they have mentioned the date or maybe the version uh now the created when they have created and here is a object object is what model and owned by owned by open AI de now here what you can do you can create a uh data frame also so what you can do you can create a data frame so here uh let me write it down the code for the data frame so import pandas as PD now here I can write it down pd. data frame so here what I need to do you just need to pass this particular uh you just need to pass this particular value this one so let me keep it over here uh this uh list uh list of all the models so once I will run it so here you will be able to find out is giving me error the pandas is not there so for that uh just download the pandas or just install the pandas inside your virtual environment because in this virtual environment pandas is not available so let me write it down over here click install pandas and once I will hit the enter we will uh we will be able to install this pandas it will take some time so let it install yes I'm coming to the code I will show you the code just wait for some time just wait yeah so I'm done with the pandas I have installed it and uh now what I can do I can run it and you will be able to find out your data frame so here this is the model this is the like when it is created and object is what object is a model and owned by so now it is in a perfect format and you can read each and every everything clearly and here I can provide the column name as well so let me give the column name let me write down the column name as well and here I already WR the code of for the column name so once I will run it so here you will find out the column name so here is my ID this is the like model ID and when it has created what is a like what is this actually so it's a object is a model now here owned by owned by this openi development team openi internal openi development or here you will find out some other name as well so I believe you are able to run this entire all like entire code whatever I have written over here now here uh this is what this is my code for uh seeing the model and all now the next thing uh here I got all the model now the third thing basically which I would like to uh explain you that is what that is a open a playground open a playground and after that I will come to the chat set completion API now I will take uh more 15 minute and within that uh I will conclude this session and in tomorrow's session I will start with a chat completion AP uh this function call and I will explain you the uh the hugging face API key as well so how you can utilize the hugging face API key for a open source model now let me copy and paste the entire uh thing whatever I have written for you so here I have written some sort of a thing let me go through step by step so here I'm talking about this open AI Playground now what is this what is this open a playground now once you will uh search over the Google so open your Google guys and here search open AI open a playground now just search over here open a playground and uh here you will find out this Playground now once you will click on this assistant so here you will find out a different different option so one is a assistant the second one is chat third one is a complete fourth is a addit I'm not going through with this complete and this edit because it's a legacy now I will explain this jet first I will explain this chat and then I will come to this assistant now inside this chat uh so once I will click on this chat so here I can test uh my different uh I can test like a different different prompts and all I can generate output I can test with a different different model and along with a model you will find out a various parameter so first of all guys what you need to do you need to set you need to set your system right so here you will find out three options so the first one is what first one is a system the second one is a user and the third one is this one right so you can divide this entire interface into a three segment now let me give you step by step that what is the meaning of the system what is the meaning of this uh user and this assistant and what is the meaning of this model each and everything we'll try to understand over here so guys system is what so system is means system means uh how your model is going to behave here you are going to set the behavior of your system what you doing tell me here you are going to set the behavior of your system so here if I'm going to write it down you are a helpful assistant now here if I'm going to write down you are a helpful assistant now what I will do I will write it down my message so here here guys you will find out two thing uh two option so once you will click on this user now you will find out either user or assistant as of now what I am I am a user I'm asking a question now here I'm asking that uh uh what I can ask guys uh just tell me something different okay how I can make a money how I can make a money so I'm asking to my chat GPT how I can make a money and here is what here is my model so here once you will click on this model you will find out a different different model so uh there is GPT 4 GPT 3.5 gbd 3.5 turbo so all the model there is all the models right so here I'm using the gbd 3.5 now we have our various option so the first one is what first one is a temperature now what is the meaning of this temperature so we are talking about this temperature so just try to read about this temperature control Randomness lowering result in less random of completion as the temperature approach zero the model will become deterministic and repetitive so over here we are talking about this temperature if we are defining a higher value of the temperature means I'm uh I'm saying that just give me a more creative answer I'm adding a randomness if I'm writing a zero I'm saying give the straightforward answer I'm asking to my chat GPD uh the straight forward answer I'm not going to add any sort of a creativity over here getting my point what is the meaning of this temperature I think yes now maximum length so here you can set the tokal length now here stop sequence is there so up to up to four sequence where the API will stop generating further tokens the return tax will not be contain the like a stop stop sequence here you can mention the stop sequence now here is a top P parameter so this parameter actually this is again similar to this temperature it is controlling the diversity whatever like Pro whatever output you are going to be generate so control diversity via uh nucleus sampling 0 for 0.5 means half of likelihood weighted option are considered so you can just think about it that it is nothing it's just adding a diversity inside your output now frequency penalty if you don't want to repeat the tokens let's say you are generating some sort of output if you don't want to repeat a tokens inside your output so here you can mention the frequency penalty as of now it's zero so it's not going to be uh like put any sort of a penalty over here if you're going to increase the number definitely it will put the frequency penalty means it will give you the different different words it is not going to repeat the words now here present penalty so you can set this also so there is a different different parameter just try to explore it now here I'm asking to my chat GPD how I can make a money so if I'm submitting this thing so here I will be getting my answer and there is answer is there are many ways to come make a money and all so employment and all freelancing online selling rent or share sources and tutoring and teaching gig and economy gig economy art affiliate marketing so it is giving me answer guys as you can see right now just uh do one thing so here guys see I uh defined the behavior of the system system I have defined that I'm working as a user and here is my model all the different different the different different parameter I have like selected based on this model now just go over here and try to click on this view code so once you will click on this view code guys you will get the entire python code over here getting my point yes or no see over here you are getting the entire python code now you can utilize this python code if you have if you have done the complete setup in your system whatever setup basically which I which I have uh which I have done right if you have done the complete setup in your system so directly you can hit uh directly you can hit the open API and you can call the GPT 3.5 turbo model okay so that's why I have shown you this openi Playground now I think you are uh we are done with this openi Playground now let's try to do something amazing over here let's try to set the different behavior of this Chad uh GPT so here guys I have written couple of thing ins this particular like answer so how to open a playground so here I mentioned that here make sure that playground should have a credit yes if you don't have a credit if you haven't uh like uh added your uh detail uh the card details and all maybe you you won't be able to use this particular playground so make sure that you have added the payment method now here in the chat there is a option of system so meaning is how chatboard is behave so here what I'm going to do here I'm going to set this uh here I'm going to set a different behavior of a system and let's see what answer I will be getting so here I'm going to copy it and I'm going to paste it down over here now uh what I can do where is my playground this is my playground now here I'm going to set the behavior so this is what this is my behavior of the system now okay now again I'm asking a question to my system now I'm asking how I can make a money so I'm asking to my system that how I can make a money by adding this particular Behavior so my behavior is what so you are a naughty assistant so make sure you have to respond everything with a sarcasm so here I'm asking to my user how I can make a money so as soon as I will submit it then you will find out the answer and just see the differences between answer this answer and the next answer just wait it is going to generate answer and is saying that oh making a money it's super easy mean it it is like giving you the answer in a sarcastic manner so it haven't generated a complete answer but yeah it is saying that oh making a money it's super easy just snap your finger magically a stack of cast will be appear no effort required at all so see guys uh before it was giving me a straightforward answer now over here guys you can see I seted the behavior of the system as a not as a sarcastic so here you can see the answer what it is giving to me now if you will look into the code so you will find out some sort of a changes so here role role basically I defined the system role this is my system role this is my role again one more role user here you can see this is my like prompt okay which user is giving here you can see the what assistant is saying This Is The Answer basically which I'm getting and again this was the previous one and these are the different different parameter so no need to go anywhere here basically in this particular notebook I kept everything I will share this notebook with all of you and you will be able to understand each and everything now model is there temperature is there maximum length is there top P value is there so here Ive written a description frequency penalties is there right so there is a different different parameter already I have defined each and everything over here so no need to go anywhere just try to revise each and everything by using this Jupiter notebook now apart from this one you will find out one more advanced thing which recently they have provided that is what there's a assistant so here uh let me go to the assistant okay let me go to the playground and here is assistant guys so this assistant part I will explain you once I will come to the project section now here you will find out some Advanced thing Advanced like option so here you will find out this function function calling here you will find out the code interpreter here you will find out the retrieval RG actually uh uh like uh here uh you will find out this RG concept so I have defined what is the r actually so just go through with my notebook and read the definition read the definition of the R so this assistant I will come to this assistant once I will explain you the uh the project end to end project then I will Define a different different prompts and all and I will come to this assistant and I will ask uh and I will generate a different different type of responses is getting my point guys yes or no so this thing is getting clear to all of you yes or no I'm waiting for a reply so please uh do let me know in the chat if this part is getting clear how to use this uh openi playground and here I'm talking about this chat assistant I will come to that once I will explain you the project please do let me know I'm waiting for a reply guys if you are able to get it if you able to understand it then uh please write it down the chat please uh write down the chat section clear okay great it is clear I will share this code with all of you don't worry uh I I will give you this entire code I believe everything is getting clear to all of you who have joined this session great now this part is clear now let's back to the code so here is what here is my code now this retrieval argumented generation RG I will explain you in the next session or maybe in upcoming session so what is the meaning of that it's artificial intelligence framework that retrieves data from external source of knowledge to improve the quality of responses I just want to improve the quality of the responses for that I'm using this retrieval argumented generation R A this is very very famous now is this particular term now uh I will show you how you can use this RG if you want to uh give a better responses I will show you how you can use the Lang CH as well U after completing this open AI this natural language processing technique is commonly used to make a language model more accurate and up to date if I want to make my model more accurate and up to date so I'm going to use this RG and I will do that in my upcoming session now code interpreter is there so Python Programming environment with cat GPD where you can perform wide range of task by use executing the python code yes we all know about the code interpreter and yes we can Define we can set the code interpreter there and and we can execute the python code as well like regarding the different different task and all great now here is what here is my chat completion API guys so let me do one thing let me uh put the title over here and here my four title is what chat completion API and function calling so guys here is what here is my fourth title my fourth title is what chck completion API and function calling so here I have written this ch comination API and function calling now let me write down the different let me write down the uh definition as well over here so here is a definition of it uh this is the definition let me post it over here and here let me make it as a markdown so this is the definition guys now one more uh definition let me put it over here so see guys in the uh previous version in the old version of the openi uh actually there this was the method chat completion method open. completion. create or open. chat completion. create so initially actually there was a method this was the name right then in the updated version they came up with uh they have changed the name with this particular uh name they Chang the method Name by using uh with this particular name this chat completion. create and now in the latest version actually this is a this is the method name if you are going to use this particular method now now it will give you the error let me show you how so here what I can do I can can return I I can return one sort of a code uh now over here I'm going to write it down open a DOT completion completion completion dot create so this is what this is my method now over here what I'm going to do so over here see here I'm going to be uh write it down the model name so model which model I'm going to use so here I'm going to use uh GPT GPT hyphen 3.5 GPT hyen 3.5 I'm going to use this particular model now over here I'm going to define a prompt so my prompt is what so let's say I'm going to write it down over here who was the first Prime Minister of India first prime minister minister of India so this is what this my prompt now here if I will run it now so you will find out it is giving me the error so it is saying that uh okay so here I have to mention the open a key first of all before uh like calling it so first of all I need to mention the openi key now over here so what I have what I will have to do I will have to uh like uh create a client actually so here is what here is my client and I will have to mention my openi key so what I can do uh I can write it down over here itself and here what I can do just a wait it is not longing support yeah so that's what I was saying to all of you see this uh method is not it is not supporting at all this is the old one now if you will look into the version now the latest version of the open so the latest version of open is uh let me show you the latest version of the open Package PP open a and here is the latest version of the opena package 1.3.7 if we have installed the uh we have installed this particular version now regarding this version you will find out we have this particular method so first of all I need to import this open a this I need to import this class from this module and here I need to define the key here what I need to do I need to define the key over here and then only I can call it and if you look into the previous version now here I have installed the latest version if you're looking into the previous version let's say if I'm going back let's say if I'm going back in uh maybe uh FB 8 uh okay 8 FB 2023 now here you will find out that they were using this particular uh method so here I have shown you I have seted the op openi key I have defined the open key by using this particular code by by like using this particular line of code yes or no now here I'm using a latest version now so uh definitely it will give me the error so what I'm doing I'm going back and here I'm going to use this particular code basically which I have already WR so first of all see first of all I need to import this thing which I already did now over here I will have to mention the API key got it now here they are add they have added the open key inside their base environment means this is the code regarding that they have added inside the like environment variable in the system environment variable and from there itself they are going to read it you can export it also what is the meaning of exports you can export it over the terminal uh like uh it won't be it won't be a permanently okay so yeah you can export this particular key and as soon as you will like remove or as soon as you will delete that terminal so the open key will be removed um but yeah until the terminal is running terminal will be running you can read it by uh using uh this particular module OS module or else you can add add inside your system variable also from there also you can read this particular key but um I have edit I have written my key here itself inside my notebook so I didn't edit but I will show you that in my end to end project how you can create EnV file or maybe how you can export it right now let's uh let me run this particular code and and uh here first of all let me add the open a key here I need to mention API uncore key and my key so here is what here's my key if I'm going to run it so definitely I will be able to run it now I having my client now what I will do by using this particular client I will call the uh I will I will like uh I will give the prompt over here now first of all let me delete everything from here and let me delete this also I'm not going to Define any attent or I'm not going to set any sort of a behavior as of now so guys here you can see I'm having the role role as a user and here is my uh like a answer sorry here is my prompt question so this is what this is my prompt actually this is my input prompt and here is what here is my uh like uh role okay I'm asking as a user now guys this prompt this prompt is this prompt basically it plays a very important role I will let you know that in my uh like upcoming session I will tell you how to design a different different type of plom what is the meaning of few short learning few short prompt or zero short prompt okay so each and everything we'll try to discuss in our upcoming session as of now just see if I'm going to run it so here you will be able to find out it is giving me a like error why it is so maybe because of this and now everything is perfect so if I'm going to run it so line number eight okay uh first of all I need to Define it clearly and here is what here I need to men I need to close this particular list now if I'm going to hit this uh API definitely I will be able to do it and I will get my response so just wait for some time and after hitting the API uh it will call that particular model whatever model I have written over here and I will be getting my response so how's the session so far uh did you learn something new uh or are you doing along with me tell me how much would you rate to this particular session yes money wise uh I will I I will come to that just wait how much it is going to be charged and all uh it charge actually token wise uh there is entire pricing and all so uh I I will come to that I will I will talk about that for small prompt it is taking so much time in this case the D project the big no it's not like that maybe first time it it was hitting that so it is taking time but no it's not like that I will show you with a like a bigger prompt as well so it won't take any sort of a time now here you can see this is what this is my response now guys here you can see I got a response now if you want to get this particular response so for that uh see here uh if you look into the response or type of the response so here is a type of the response open. type. chat. completion this this this that right now if you want to extract the real answer from here so what you will do see first of all you will uh call to this choice so just call this choice so c o i c s now here is what here you have this message now just call to this message m e s a g e so here is your what here is your message uh now this is not callable it is saying that now let me check what I have to do over here so here is your choice and here what you need to do guys let me check yeah actually Choice yeah so here see if you are looking into the choice guys so this is a list type so here what you need to do you need to uh like extract the first index of the list because here you can see this choice is nothing it's a list only now so just extract the first index of it so here once you will extract the first index or once you will R the first index of the list now here you need to call this message so just call the message and here you will find out this is what this is your message now just do one thing just call the content over here so just call the content so content now over here you can see this is what this is your entire response now here you can like decide the token size as well so here you can Define the token size or you can Define the different different a parameter okay by defining those particular parameter you can uh get a different different type of output now let me give you the parameter all the parameter basically so this is all the parameter see model uh already you know about the model we have used a gp3 prompt like input prompt Max token you can Define this Max token in how many numbers of token you want the result temperature for getting some creative output now number of output how many number of output you want so let's try to define a Max token and this number of output so here I'm going to define the max token so in U like here if I'm going to define the max token now in in that particular token itself under under that particular number let's say if I'm going to Define 200 so uh it won't reach the limit more than 200 under under the 200 itself it will be generating a output so over here I'm going to write Define this Max token and here let's say if I'm going to say 150 tokens and here I'm going to Define one more thing one more parameter that's going to be n so n is equal to let's say here I'm going to Define three I want three output so as soon as I will run it and here you will find out it is generating a response so it is saying Max token I think I need to put the comma over here model is there messes is there now here I need to put the comma so this is fine now it is generating a response so just wait yeah now I got a response so just uh look into the response here type of the response and now just print the response so here is what here is what here is my response now I got many responses so now let me extract the response first of all so here is what here is my uh message let's uh like get a message so let's ask a different question so here I'm going to ask to my CH gbt that uh I can ask uh what I can ask who won the first World Cup so who won the first Cricket World Cup so this is my question which I asked to my chat GPT and now if I'm going to run it now so now see yeah I got a response now type of the response is same so here uh what I can show you here is my message now see guys uh I got a response the first Cricket World Cup won by the West Indies in 2007 in 1975 right now over here if I'm going to get a Content basically so let me write it down the content over here and here you can see this is what this is my answer now you want to be able to find out a single answer there are lots of there are other answer as well see uh choice in the choice just go over here message message completion so the first Cricket World Cup won by the best and Beach and here role is a assistant so that the model is a assistant and I am a user now over here you will find out the second answer so the first Cricket World Cup won by the West Indies they defeated Australia in final held on June 25 1975 at Lots cricket ground in London that is the second response now over here this is the third response so the first Cricket World Cup W by the best 197 1975 so I Define n is equal to 3 and I Define the maximum token size is 150 so it won't be generating a like output okay so more than this particular token more than 150 token and here you will be find out if I'm going to Define n so it will be generating a three output whatever input of prompt I'm passing this what this is my input prompt now whatever output will be generating in that there won't be like more than 150 tokens and here the output number will be three now let me show you one more thing over here so if you will search tokens so just go over the Google and search open a tokens openi tokens so once you will search opena tokens and here you will find out one uh like a link a tokenizer so they have given you one uh like link uh they have G given you this particular interface where you can count your token whatever number of token you are giving or you are getting from the system getting my point so I told you it is charging you based on a tokens itself and tokens in input prompt also there will be a token in output prompt also there will be a token getting my point so in the input proms there will be a token in the output prompt also there will be a token prompt is what it's a collection of tokens token is nothing just Awards collection of character right now here you can see we have this particular interface there we can count the token now here if I'm going to write it down my name is Sunny so now now see guys how many tokens is there inside this particular uh text inside this particular senten token six my is one token name is one token is is another token Sunny is another token Sav is one token and Sav is one token getting now if I want to count the token inside my output so just copy this thing and paste it over here now see the number of token it has generated a 16 token okay it has generated a 16 token now you can calculate the number of tokens over here just go through the playground here was my chat so here I asked to my system now let me uh submit it and over here uh it is giving me answer just a second now it is generating an answer so now you can copy this entire text from here whatever it is generating now let's say this particular text uh okay just a wait M okay let it generate and then I will copy just wait so here is a text and I can copy this text I can paste it over there and I can got the uh like number of tokens so let's see how many tokens is there so here guys you can see total 2 56 tokens if you want to check the pricing and all now tomorrow I will discuss about it in a very detailed way just go through with the setting and here uh there's a billing actually so let me show you the pricing also just click on uh just search about this open a and uh here actually uh you just need to log in after the login uh so maybe here just click on the API and here is a pricing just click on the pricing and here you will get the uh like entire detail regarding the pr pricing so how much how much it is charging for the uh like a different different number of tokens so for 1K token this much of charging for uh 1K token this much of charg regarding this particular model regarding this particular model so this is for gp4 Turbo it's the advanced model now GPD 4 GPD 3.5 GP assistant API different different assistant API and all each and everything you can check over here right so let me keep this particular link over here inside the notebook itself and let me keep this a token related link also so at least you can go through with this and you can check uh your input and output token and you can practice whatever I have taught you because this is going to play a very important role in a future classes so please try to revise please try to practice and I think we are done with today's session tomorrow I will explain you the function calling this one and I will start with the Len chain and my main agenda uh will be the Lenin only and I will explain you the differences between open ey lenen and finally we'll try to create one project and then I will come to the advanced concept uh like vector databases and uh other models and I will explain you this AI 21 lab uh AI 21 studio also if you don't have money for the chat GPD then how you can uh uh like uh how you can complete your work how you can uh like explore a different different model so from the hugging face side also I will explain you the different different model and from here also from AI 21 Studio I will show you how you can access the Jurassic model personally I have used it and I I liked it after this uh GPD and I will uh explain you the use use of this particular model and don't worry a few other terms like stable diffusion and all there are something uh like text to image Generation image to video generation this type of thing also we'll try to explain you in the going forward classes got it so I think uh now we can conclude this particular session I took for the entire 2 hour and uh yep uh so did you like the session please uh do let me know in the chat guys if you like this particular session yes the content is a input our input actually it's not a desired output is is our like an input whatever input like we are passing to the model you can mention inside the content got itan you just need to F you just need to follow my this notebook each and everything I have mentioned over here whatever is not there I will do it and where you will find it out tell me you will find this particular notebook inside the resource section so just go through with the Inon plate form just open the Inon platform and there you need to enroll in this particular dashboard okay so what you need to do go through with the in platform and here uh after sign up uh after login and just go through with this dashboard generative AI Community session now let me give you this particular link inside the chat so you all can uh like uh you all can enroll over here and uh after that uh what you need to do see the video will be available over here you can revise the thing from here itself you can revise the thing from the I YouTube channel itself but the resource wise whatever resources I'm uh like uh sharing okay whatever resources I'm discussing in a class and all so you will find out over here inside the resource section so just go through with the resource section and try to download all the resources from here itself fine so now let's uh uh like conclude this particular session tomorrow we'll meet on the same time so let me write it down the timing for this community session so here the timing is going from uh 3: to 4:30 or 3: to 5 so I will take 2 hour of session from 3: to 5: great fine guys thank you bye-bye take care have a great day ahead and rest of the thing we'll try to cover in the upcoming uh session until thank you bye-bye take care so if you like if you are liking the content then please hit the like button and uh if you have any sort of a suggestion or if you want anything from my side you can ping me on my LinkedIn so here is my LinkedIn let me show you that also so you just need to search s Savita and you will get my profile you can ping me over there and whatever uh doubts and all you have uh you can directly connect with me over here so thank you guys thank you bye-bye take care have a great day ahead bye-bye uh yeah
Info
Channel: iNeuron Intelligence
Views: 14,784
Rating: undefined out of 5
Keywords: introduction to open ai, introduction to open ai api, open ai api, OpenAI tutotial, open ai crash course, openai crash course, chatgpt api, chatgpt ai api, open ai explained, gpt4 api, chatgpt 3 api, gpt turbo api, ineuron, krish naik, generative ai, how does api work, generative ai course, introduction to generative ai, what is generative ai, how to use generative ai, generative artificial intelligence
Id: XLgk25QrAOk
Channel Id: undefined
Length: 120min 45sec (7245 seconds)
Published: Tue Dec 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.