Full Transcript

·YouTLDR

Generative AI Full Course – Gemini Pro, OpenAI, Llama, Langchain, Pinecone, Vector Databases & More

30:18:04EnglishBy freeCodeCamp.orgTranscribed Jul 27, 2026
Analyze another video with Pro30-day money-back guarantee
0:00

this massive course about foundational

0:01

generative AI was originally recorded

0:04

live we've put it all together into this

0:06

one video this course offers insights

0:09

into generative models and different

0:12

Frameworks investigating the production

0:14

of text and visual material produced by

0:18

AI the course is taught by three

0:20

experienced instructors okay I think uh

0:23

we can start with the session so hello

0:25

everyone good afternoon to all uh this

0:27

is the very first session for the uh

0:29

generative AI uh from today onwards we

0:32

are going to start with a community

0:34

session of generative AI so uh yes in

0:38

today's session we'll be talking about

0:40

that what all thing we are going to

0:41

discuss uh throughout the sessions and

0:44

uh this session actually it will be

0:46

happening for uh upcoming two weeks and

0:50

uh it will be on the same time I'm going

0:52

to take the session from uh 3:00 p.m.

0:54

onwards uh maybe 3: to 5 so here in this

0:58

uh committee session we'll try to to

1:00

discuss many more thing regarding the

1:02

generative AI so we'll start from very

1:05

basic and we'll go to the advanc there

1:07

we'll try to develop different different

1:10

type of applications as well uh first of

1:12

all I will start with the theory uh so

1:15

there I will uh discuss about the

1:17

theoretical uh uh like stuff and all

1:19

that what is generative AI what is a llm

1:22

and after that I will uh like go with

1:24

the open a Lang and don't worry each and

1:27

everything I will discuss in a very

1:28

detailed way and and uh I will show you

1:31

the dashboard as well where all the

1:33

lectures and all will be uploaded and

1:35

apart from that I will uh show you the

1:38

uh like uh where you can find out all

1:40

the videos quizzes and uh assignments

1:43

and all because along with the session I

1:45

will give you the different different

1:46

assignment different different quizzes

1:48

so at least you can practice with the

1:50

concepts got it guys yes or no so are

1:53

you excited please do let me know in the

1:55

chat if you are excited

1:58

then

2:11

great so I think we going to start and

2:14

uh so first of all guys what I will uh

2:16

do I will give you the uh the detail

2:19

introduction of the course that what all

2:21

think we are going to discuss in this

2:23

committee session and uh here basically

2:26

this is our dashboard so let me share

2:29

this link with all of you so uh don't

2:31

worry my team will share the link of

2:33

this dashboard in the chat so from there

2:36

what you can do you can enroll it is

2:38

completely free you no need to pay

2:40

anything for this uh committee session

2:42

and all the lectures and all the

2:44

assignment and quizzes will be uploaded

2:46

over here don't worry I will come to the

2:48

curriculum also so here first of all let

2:51

me show you the homepage uh this is the

2:53

homepage guys uh this is the homepage of

2:55

this dashboard and there uh uh like you

2:59

can enroll in this particular dashboard

3:01

and don't worry uh each and every video

3:03

you will find out over the Inon YouTube

3:06

channel as well so all the recorded

3:08

video and all it will be available

3:10

inside the Inon YouTube channel uh

3:12

definitely this video is going to be

3:13

record after the session so this video

3:16

will be available inside the I YouTube

3:18

channel as well as uh over the dashboard

3:21

so here guys this is the dashboard I

3:22

think you got a link of the dashboard so

3:26

there you can enroll and then uh like

3:29

you can start your journey of the

3:31

generative AI so here guys uh me and buy

3:35

both are going to take this particular

3:37

session so there we are going to discuss

3:40

in depth uh about the generative AI

3:43

about the llm we'll try to discuss about

3:45

a various application various recent

3:48

model llm models and all uh we have so

3:50

many things uh to discuss about the

3:52

generative AI we have planned for the

3:54

two weeks but uh maybe uh more than 2

3:57

weeks uh we'll try to uh take if we are

4:00

not able to cover and like all the

4:02

curriculum whatever we have defined

4:04

whatever we have thought uh so

4:06

definitely we'll be extending the date

4:08

as well but yeah we will make sure that

4:10

within 2 week whatever curriculum we

4:12

have defined we'll try to complete it so

4:14

here guys are me and uh buy so if you

4:17

don't know about me guys so my name is

4:19

Sun my name is s Savita I'm working in

4:22

Aon from past three year and I have I'm

4:25

having an expertise in data science uh I

4:28

have explored U every aspect of the data

4:31

science like machine learning deep

4:33

learning and advanced deep learning like

4:36

computer vision NLP I have worked with

4:38

the mlops as well uh there I have

4:40

designed a various applications and all

4:43

got it so yeah uh you can search me

4:45

about more over the LinkedIn uh there

4:47

you will get uh you will you will get

4:49

got my profile and you will uh like uh

4:52

get each and everything in a detailed

4:54

way so here guys uh what you need to do

4:56

so first of all you need to enroll to

4:58

this particular dashboard uh you no need

5:00

to pay anything over here and if you are

5:03

going to login after login what you need

5:05

to do uh so uh you will be redirect

5:08

redirecting to this uh particular

5:10

dashboard and uh so let me show you the

5:14

dashboard first of all this is the

5:15

dashboard guys as of now there is no

5:17

such videos and all uh definitely after

5:19

the session we'll uh upload the videos

5:22

and assignment and quizzes so definitely

5:24

along with the sessions and all you can

5:27

practice so this thing is clear to all

5:29

of you yes or no have you enroll uh

5:32

through this dashboard did you get this

5:34

Dashboard please do confirm in the chat

5:36

I'm waiting for your reply please do it

5:57

guys great so I can see uh uh many

6:00

people are saying yes so definitely now

6:03

uh we can discuss about the curriculums

6:05

and all so whatever thing we are going

6:06

to discuss throughout this committee

6:08

session first of all I will give you the

6:10

detail uh like uh detail introduction of

6:13

the uh syllabus uh what all topics we

6:16

have uh we'll try to more focus on the

6:19

re recent Trends I'm not going into the

6:21

uh classical uh machine learning and the

6:23

Deep learning basically so I will focus

6:26

more Focus basically on the open Ai

6:27

langen and all so don't worry

6:29

I will give you the detail introduction

6:31

of the syllabus uh that whatever thing

6:33

we are going to discuss inside this

6:35

committee session so the first thing

6:37

what you need to do guys you need to

6:38

enroll inside this dashboard and uh

6:42

whatever like videos and all you will

6:43

get uh you will like go through and

6:46

basically you can watch it over here

6:48

itself directly now let's discuss about

6:50

the curriculum and all that what all

6:52

thing we are going to discuss and uh for

6:55

that basically I have created one PPT so

6:57

let me show you that particular p PPT uh

7:00

just a

7:10

second so here is a PPT guys can you see

7:13

this PPT yes or no please do confirm in

7:15

the chat if it is visible to all of

7:28

you

7:39

great I think uh this uh PP is visible

7:42

to all of you now guys uh we can discuss

7:45

uh that uh what will be our uh like

7:47

topics and all uh that what all thing

7:49

basically we have to discuss throughout

7:50

this committee session so here uh first

7:53

of all I will start from the generative

7:55

AI so there I will give you the detail

7:57

overview of the generative AI that what

7:59

is a generative AI uh why uh we should

8:02

use a generative AI uh what all type of

8:04

like application we can create and uh

8:07

each and everything each and every every

8:09

theoretical stuff we try to discuss

8:11

regarding the generative Ai and after

8:13

that after the generative AI I will come

8:15

to this uh large language model so just

8:18

a second let me open my uh pen as well

8:22

so I can write it down um each and

8:28

everything

8:31

yeah so here guys uh we can uh I can

8:34

write it down as well now so here the

8:36

first thing basically first I'm going to

8:38

start from the generative AI there uh

8:41

definitely I'll will be talking about

8:42

each and everything each and every

8:43

aspect of the generative AI then after

8:45

that I will come to this large language

8:48

model there I will try to discuss this

8:50

llms large language model in a very

8:52

detailed way we'll try to see the

8:54

complete history of the large language

8:56

model that what is a large language

8:58

model what types of model we have what

9:00

was the classical model and uh what is a

9:03

recent model okay so each and everything

9:05

we'll try to discuss regarding this llms

9:08

and after that after completing this uh

9:10

theoretical part theoretical of this uh

9:13

stuff and all regarding the generative

9:14

AI regarding this llms I will come to

9:17

this open AI open Ai and this lenen so

9:21

there uh we'll try to discuss in a very

9:23

detailed way that what is the open AI

9:25

what is the open AI API and inside the

9:28

open AI API we have a different

9:30

different them right so in OPI openi

9:33

itself you will find out a various model

9:35

that like openi open has created a

9:38

various model uh that different

9:40

different version of the gpts okay so it

9:42

is having some uh like a old model as

9:45

well some legacies and all and some

9:47

upcoming models so each and every model

9:49

will try to discuss I will give you the

9:50

walk through regarding those particular

9:52

model and I will discuss about the

9:54

python API python uh API uh that uh how

9:58

you can uh use utilize those particular

10:00

model by using the python getting my

10:02

point and apart from that apart from the

10:05

python API and all will try to discuss

10:07

that uh like if we are going to be uh if

10:10

we are going to use the Lenin right so

10:12

how it is different from the open AI so

10:14

at the first place I will give you the

10:16

uh detailed differences between this

10:18

open Ai and this lenen that how it is

10:20

different to each other that why this

10:22

Lenin is required then I will come to

10:24

the Lenin and then again we'll try to

10:26

create uh again basically we'll try to

10:29

Define the lenen and all uh by using the

10:31

python we'll try to uh use the lenen or

10:33

different different like a component of

10:35

the Lenin like memory chain agents and

10:38

all and yes after that I will try to

10:41

create one

10:42

application okay so here uh basically

10:45

we'll try to create one application and

10:48

with that uh definitely we'll be able to

10:50

justify the knowledge whatever actually

10:52

uh we are going to learn regarding this

10:54

llm open lenion by using uh that by

10:57

creating that particular project

10:59

and after that I will uh come to the

11:02

advanced part Advanced part like uh

11:04

Vector databases uh we'll try to discuss

11:06

about a different different Vector

11:08

databases and first of all we'll try to

11:10

discuss the need of the vector database

11:14

that why it is required what is the

11:15

meaning of the embedding uh how we can

11:18

uh like uh save the embedding how we can

11:21

retrieve that and how this a vector

11:23

database this a vector database plays an

11:26

important role whenever we are going to

11:28

create any application related to this

11:31

llms okay so there we'll try to discuss

11:34

about the vector databases and then I

11:36

will come to the some open source model

11:39

so uh first of all I will come to this

11:41

uh llama uh and I will discuss about the

11:44

Llama indexes what is the Llama index

11:46

and we have a like couple of Open Source

11:48

model which is a very very famous so

11:50

we'll try to talk about those model as

11:52

well like we have a llama to itself we

11:55

have a falcon we have a bloom there are

11:57

various model and we'll show You by

11:59

using those model how you can create uh

12:03

like a how you can create your end to

12:04

and application uh you can solve any

12:07

sort of a task just take a name don't

12:08

worry I will give you the detail

12:10

overview about the NLP and all that what

12:12

all task does exist what all task

12:14

basically we have what all task we can

12:16

solve by using this llm each and

12:18

everything we'll talk about and then

12:20

finally we'll create one more end to

12:22

endend project there we'll try to uh use

12:25

the entire knowledge uh whatever we are

12:27

going to be learn uh like this Vector

12:30

databases different different open

12:32

source model and a length CH open a

12:35

llama indexes and finally we'll try to

12:37

deploy that model by using the amops

12:40

concept so did you uh like this syllabus

12:44

yes or no please do let me know guys

12:47

please do let me know in the chat if you

12:49

like the syllabus yes or

12:54

no the agenda is clear to all of you if

12:58

you can write it down the chat I think

12:59

uh that would be

13:20

great great so I can see many yes in the

13:24

chat and many people are saying yes they

13:27

are

13:29

able to get yes don't worry we'll give

13:32

you the PPT and all each and everything

13:33

will be there in a uh resource section

13:36

so from there you can download this PP

13:38

you can download this entire thing

13:40

whatever I'm uh like I will be using

13:42

throughout the

13:43

session yes uh so fine I got a

13:46

confirmation now uh the first thing uh

13:49

many people are asking the prerequisite

13:51

what will be the prerequisite if you are

13:52

starting with this committee session so

13:55

prerequisite wise uh if you have a basic

13:58

knowledge of the Python if you have a

14:01

basic knowledge of the Python if you

14:02

know about the core python uh in a core

14:05

python actually we have uh uh like a

14:09

ifls for Loop and uh different different

14:11

type of data structure and the knowledge

14:15

of the database exception handling if

14:17

you are uh if you know about the basic

14:20

python the basics of python then

14:21

definitely you can proceed with this go

14:24

along with that if you have a like some

14:26

basic knowledge about machine learning

14:28

and deep learning so you will understand

14:31

uh the concept basically whatever uh

14:34

like we are going to teach you in a

14:36

better manner in a better way because

14:38

here I'm not going to talk about the

14:39

classical uh ml or the basics of the

14:42

deep learning like uh artificial NE

14:45

Network CNN and all definitely I will

14:47

give you the overview about the transfer

14:48

learning fine tuning and all but here uh

14:51

uh I won't talk about the neural network

14:54

and this recurr neural network lstms and

14:56

all so uh if you have a basic

14:59

understanding of machine learning and uh

15:02

deep learning so definitely you will

15:04

understand the concept in a very well

15:05

manner otherwise basic python knowledge

15:08

is fine for creating application basic

15:10

python knowledge is uh like fine okay so

15:14

you no need to worry about it uh

15:16

whatever thing actually I need to

15:17

explain you definitely I will do that uh

15:19

in the class itself and uh we'll do the

15:22

live implementation I'm not going to

15:24

show you any uh pre-written code and all

15:26

uh definitely I will write it down each

15:28

and everything in front of you only got

15:30

it so prerequisite is clear so

15:33

prerequisite nothing just a python or uh

15:35

I can write it down over here basic

15:37

knowledge basic knowledge of ML and DL

15:41

if you know this much then definitely uh

15:44

like uh you will be able to understand

15:46

each and everything in a well

15:50

manner great so yes we'll talk about the

15:53

RG approaches and all each and

15:54

everything diffusion model is there

15:56

there are some recent model in l each

15:59

and everything will talk about and you

16:00

will be capable so uh let's say if you

16:03

are working in your company or maybe you

16:05

are trying to switch into the generative

16:06

AI or maybe you are fresher in every uh

16:10

case right so this community course will

16:12

help you definitely if you if you are

16:14

going to attend every session if you are

16:16

going to learn along with me definitely

16:18

you can build anything after learning

16:21

all sort of a thing got it great so I

16:25

think uh this uh introduction is clear

16:27

to all of you now I already discussed

16:29

about uh about the dashboard and all so

16:32

uh I given you the walk through of the

16:34

dashboard so link you can find it out

16:36

inside the chat inside the chat and from

16:39

there itself you can enroll now the

16:41

syllabus is clear dashboard is clear

16:44

each and everything is fine so I think

16:47

we can start with the introduction of

16:49

generative AI generative Ai and llm

16:52

because from today's on uh from

16:54

tomorrow's onwards I I will be like move

16:56

to the Practical part and there I will

16:58

be talking about the open a how to

17:00

generate a open key how to use the open

17:03

API and uh we'll try to understand the

17:06

chat completion API functional API and

17:09

uh we'll try to understand the concept

17:11

of the token also that what is a token

17:14

uh like how many token should I use

17:17

whenever we are giving any sort of a

17:19

prompt what is a different different

17:20

prompt template and all there are lots

17:22

of thing which we need to understand so

17:23

today's session actually it will be uh

17:26

like completely introduction session and

17:29

in this particular session uh we'll talk

17:31

about the generative Ai and the history

17:33

of the large language model so guys uh

17:35

are you ready can I uh get a quick yes

17:37

in the chat if you are ready

17:45

then yeah definitely we'll talk about

17:47

the uh like use cases of the generative

17:50

and all u in today's session itself I

17:52

will like give you that uh particular

17:54

idea that where you can uh utilize this

17:57

generative AI in a real time

18:01

yes definitely this course content and

18:03

all whatever you are seeing over here

18:05

this one definitely it will be available

18:07

over the dashboard as well so this is

18:08

our dashboard we'll update it over here

18:11

inside the course syllabus section so

18:13

each and everything uh like uh we'll try

18:15

to update in the dashboard

18:18

itself here is a class timing and all

18:20

and uh I will make sure that the uh the

18:23

link also okay so uh we are not going to

18:26

uh we are directly streaming over the

18:28

YouTube so directly you can uh join

18:29

through the YouTube so for that you just

18:31

need to subscribe the channel and you

18:33

will get a notification in that

18:36

case great so people are saying yes sir

18:38

we are ready ready ready

18:52

great yeah definitely Wy we'll try to

18:54

discuss the applications and all and uh

18:57

I will explain you all the thing and

18:59

that uh specific way only don't

19:06

worry we are going to build AI

19:08

application by using the AI

19:10

tools AI based

19:18

application great so I got uh many yes

19:22

in the chat now I think uh we can start

19:25

with

19:26

a uh with the introduction of generative

19:29

Ai and the LM so guys uh first of all

19:32

tell me that how many of you you are uh

19:35

you have started with the generative Ai

19:36

and all already means uh you have

19:38

learned something at least you have

19:40

learned the basics in all uh so if you

19:42

can write down the chat so that would be

19:45

great means you are starting from very U

19:48

like a scratch or you have some sort of

19:57

idea

20:16

great so many people are saying uh so

20:20

some people are saying they know about

20:21

the basics and some people are saying uh

20:24

they're starting from the scratch don't

20:26

worry so uh basically I will start from

20:28

the scratch only now here guys uh you

20:31

can see I have created One PP for all of

20:33

you so let me uh first of all let me go

20:35

through with this particular PP and

20:37

later on what I will do I will again I

20:39

will give you the revision by using this

20:40

PP only and in between I will use my

20:43

Blackboard also for explaining you some

20:45

uh Concepts and all so here is my

20:47

Blackboard so here I will be writing

20:49

down uh the whatever basically thing I

20:53

need to explain you and in between I

20:55

will be using the ppds and all so first

20:57

of all let me go through this particular

20:59

PP and here you can see so uh I have

21:02

written some sort of a name uh so in the

21:05

generative AI whenever we are talking

21:06

about the generative AI or a large

21:08

language model so couple of name are

21:11

very famous nowadays and in in those

21:14

name actually this chat GPT is a uh like

21:16

very very famous so here I have written

21:18

this chat GPT it's a product of the open

21:21

AI as we know about this Chad GPT

21:24

everyone knows about the chat GPT yes or

21:26

no I think yes now if we talking about

21:28

this Google bar so it's a product of the

21:30

Google and we talking about this meta

21:33

llm 2 so this meta llm 2 it's a product

21:37

of the Facebook got it guys yes or no so

21:41

yes uh nowadays actually everyone using

21:44

this chat GPT Google B meta lm2 is it

21:47

it's also a platform similar to this

21:49

chat GPT uh where you can uh chat or

21:52

where you can ask a specific question

21:54

which you uh which you do in a chat GPD

21:56

itself So Meta lm2 it's a a model from

21:59

the Facebook site now here guys if we

22:02

are talking about the generative AI or

22:04

we are talking about the large language

22:06

model so in our mind the first image

22:08

which comes into the picture that is a

22:10

chat GPT Google B and meta llm 2 yes or

22:13

no tell me guys yes because of that only

22:17

uh because of this chat GPT Google B and

22:20

like the other the different like

22:22

whatever application you are seeing

22:24

nowadays right so mid journey is one of

22:26

the application or maybe Delhi uh or

22:29

different different application because

22:30

of that only I think you are learning

22:31

this uh particular uh thing this

22:34

particular course this generative AI

22:35

course yes or

22:40

no yes so but guys this generative AI is

22:44

having their own Roots it's not all

22:46

about the chat jpt Google B and some

22:48

other uh application which you are

22:50

seeing chat jpt is just a application of

22:53

this generative AI chat GPT or this

22:55

Google B is just a application of this

22:58

uh like llm large language model

23:00

basically we are using this large

23:02

language model in a back end U like

23:04

whatever application you are seeing like

23:05

chat GPT and all in the back end but

23:08

apart from this this generative Ai and

23:10

this llm is having their own Roots so

23:13

first of all what I will do I will

23:15

explain you the concept of the uh like

23:17

first of all I will uh start from the

23:20

deep learning itself means I need to

23:22

explain you few uh terms and terminology

23:24

regarding this deep learning so let me

23:26

uh back to the Blackboard so there I

23:29

will be talking about the basics of the

23:31

deep learning So within uh 5 to 10

23:33

minutes I will be discussing the types

23:34

of the neural network and all and then I

23:36

will directly move to the uh like LMS

23:40

and this uh genem so here guys uh you

23:44

can see uh what I can do I can uh draw

23:47

one box over here so this is the uh you

23:51

can think this is what this is the

23:53

neural uh uh basically if we are talking

23:55

about the okay so first of all let me

23:57

start from the deep learning itself so

24:00

uh if we talking about a deep learning

24:01

so uh we can uh divide this deep

24:05

learning into three major segments so

24:07

let me write it down over here this a

24:10

deep

24:16

learning so guys this deep learning

24:18

actually we can divide into three major

24:20

topic so the first topic actually which

24:22

is called artificial neural

24:25

network artificial neural network netork

24:28

the second topic is called convolution

24:31

neural network

24:33

CNN the third one basically which is

24:36

called recurrent neural network so we

24:39

have a three types of the neural network

24:42

and we can divide this a deep learning

24:44

into this three major section apart from

24:47

this you will find out other uh like

24:49

topics as well so let me write down

24:51

those uh thing over here so the fourth

24:53

one uh which I can write it down over

24:55

here that is a uh reinforcement learning

24:58

and uh the fifth one we generally talk

25:01

about it uh so that is what that is a

25:03

gain so this gain also it comes under

25:06

this generative AI I will talk about it

25:08

I will talk about this game I will like

25:10

give you the glimpse of this uh

25:12

generative advisal Network that what is

25:14

this and how the architectures look like

25:17

of this gains and why I'm saying that

25:19

this gains comes into the generative AI

25:22

so if we talking about thisn so let me

25:25

draw the box now so if we are talking

25:27

about this n so here guys see we have an

25:30

input layer inside this Ann actually

25:32

what we have we have a input layer and

25:35

uh you will find out the output layer

25:38

and in between actually in between this

25:40

input and output we have a hidden layers

25:42

so just a wait now over here guys see we

25:45

have a input layer and we have a output

25:48

layer now in between actually you will

25:50

find out a hidden layers various hidden

25:52

layer so let me write it down over here

25:54

input and here you'll find out the

25:56

output now here in between this input

25:59

and output you will find out of various

26:01

hidden layers so let me write it down

26:03

the hidden over here so this hidden

26:05

layer actually it is nothing it's a

26:06

hyper parameter so we can have as many

26:09

as hid layer we can have as many as node

26:11

inside the hidden layer we all know

26:13

about the artificial neural network I'm

26:15

assuming that thing now if we talking

26:18

about this uh CNN actually so the CNN is

26:21

nothing so in the CNN uh one more thing

26:23

you will find out in terms of this CNN

26:26

that is what that is a convolution we

26:28

always perform the convolution in terms

26:31

of this CNN so here if we are talking

26:33

about this enn so uh we are using the uh

26:36

like structure data where we have a like

26:39

different different features numeric

26:41

feature or categorical feature and uh we

26:43

try to solve the regression and

26:45

classification related problem but

26:47

whenever we are talking about this CNN

26:49

so here uh the CNN actually specifically

26:52

we use for the image uh related data

26:55

image or video related data you can say

26:57

that uh we use the CNN and all for the

26:59

grid type of data okay so we use the CNN

27:03

for the grid type of data and there uh

27:06

like you will find out one more

27:07

component that is what that is a

27:09

convolution so here uh let me write it

27:11

down so the component name is what

27:14

component name is a convolution so in

27:16

the convolution actually you will find

27:18

out a various step so uh we have a

27:20

various step in the convolution itself

27:22

so the very first step which we perform

27:24

what we do guys tell me we perform the

27:26

feature X section by using a different

27:29

different filter after that what we do

27:31

we perform the pooling and then we

27:34

flatten the layer so there are different

27:36

different like uh uh steps you will find

27:39

out inside the convolution itself and

27:41

after that what we do we apply the fully

27:43

connected layer so that is nothing that

27:45

is my Ann itself so over here I can

27:48

write it down we have this convolution

27:50

and we have a artificial neural network

27:52

so this is my first architecture which

27:54

is a like uh which is the Ann itself and

27:57

and this is my second one that is what

27:59

that is a CNN now if we talking about

28:01

the third one which is a very very

28:03

interesting that is called recurrent

28:05

neural network that is called recurrent

28:07

neural network so this enn we generally

28:10

use for the structured data where we

28:12

have a numerical column or categorical

28:15

column and in the Target column like it

28:18

will be a numeric or categorical one and

28:20

based on that basically we are going to

28:22

decide whether it will be a

28:24

classification problem or a regression

28:25

problem now if we talking about this CNN

28:27

so already I told you if you're talking

28:29

about this RNN so the name is what the

28:31

full form what the full form is the

28:33

recurrent neural network so this RNN

28:35

actually we are using for the sequence

28:38

related data so wherever we have a

28:39

sequence wherever we have a sequence so

28:42

this RNN we used for the sequence

28:44

related data now let me do one thing let

28:47

me draw the architecture of this RNN so

28:50

over here guys in the RNN what you will

28:51

find out so let's say this is my uh box

28:55

and here is what here is my input so

28:57

this is what guys tell me this is my

28:59

input now here is what here is my output

29:02

so let me draw the output one more time

29:05

this is what this is my output got it

29:07

now here guys see uh this is my input

29:10

this is my output and this is what this

29:13

is my hidden layer now in the hidden

29:15

layer actually you will find out one

29:17

thing one concept and the concept is

29:19

nothing the concept is called a feedback

29:21

loop okay so whatever output I'm getting

29:24

from the hidden layer actually again we

29:26

are passing that output to hidden layer

29:28

until the entire time stem so that thing

29:31

actually uh we learn or we learn in in

29:35

the RN itself actually this RNN is

29:37

nothing it's a special type of neural

29:39

network and there you will find out the

29:42

feedback loop feedback loop means what

29:44

so whatever output we are getting from

29:46

the hidden layer again we are passing

29:48

the same output to the hidden layer

29:50

until we are not going to complete the

29:52

entire time stem that is what that is

29:54

the RNN now uh you are uh we are talking

29:58

about the llm so why we are uh why I'm

30:01

discussing this RNN and all because this

30:04

llm actually somehow it is connected to

30:06

this RNN itself before starting with a

30:08

llm a large language model we'll have to

30:11

understand the concept of the RNN lstm

30:14

attention uh like encoder decoder and

30:17

then attention self attention and all so

30:19

here I'm not going to discuss in a very

30:20

detailed way I'm just giving you the

30:22

glimpse of that that what is a like RNN

30:26

what is the lstm what the Gru and then

30:28

what was the sequence to sequence

30:30

mapping and where this attention comes

30:32

into a picture then how they have

30:34

invented the self attention then how

30:36

they started the using this transfer

30:37

learning and this finetuning in terms of

30:41

this uh in terms of this large language

30:44

model why we are calling it is a large

30:45

language model why we are not calling it

30:47

a model okay so each and everything

30:49

we'll try to discuss now uh you all know

30:52

about this uh reinforcement learning and

30:54

all so in the reinforcement learning uh

30:57

you will find out one agent environment

30:59

regarding that particular agent you will

31:01

find out a different different state

31:03

getting my point and then you will find

31:05

out the feedback so that actually it

31:07

comes inside the reinforcement learning

31:09

and that is also part of the deep

31:11

learning only now if we are talking

31:13

about gain so gain is uh nothing

31:15

actually so in the gain again you will

31:17

find out a neural network uh which we

31:19

are using for generating a data and that

31:21

also comes in under inside the

31:23

generative Ai and we have a different

31:25

different types of game so first of all

31:28

tell me guys uh this uh uh like types of

31:31

the neural network this is clear to all

31:33

of you please do let me know in the chat

31:35

if uh this thing is clear then uh I will

31:37

proceed with the next

31:40

topic use cases wise I will come to the

31:43

use case and I will uh try to discuss a

31:45

different different use case I will come

31:46

to the use case then I will tell you the

31:48

applications of that and then I will

31:50

come to the domains as well then in what

31:52

all domains you can apply those use

31:54

cases so don't worry each and everything

31:56

we'll try to discuss over here

32:00

yes I will directly come to the

32:02

generative a itself but before that I

32:04

will give you the timeline don't worry

32:06

from Tomorrow onwards I'm going to be

32:07

start uh I'm going to start from the uh

32:10

like uh from the open ey itself uh like

32:13

complete practical and all so no need to

32:15

worry about it s Prasad I think you got

32:19

your

32:26

answer

32:28

I think uh this basic introduction is

32:31

clear

32:35

now yes coming to the generative only

32:37

don't

32:38

worry yeah it's going to end to end uh

32:41

we'll try to discuss end to end thing

32:42

don't worry about

32:53

it if you have any questions and all so

32:55

you can directly ping into the chat

32:57

uh so I will reply to you don't

33:21

worry okay so I think now we can proceed

33:25

so guys here uh in the uh PP itself I

33:28

was talking about the generative AI then

33:30

I given you the uh like uh uh the types

33:33

of the neural network and I just explain

33:35

you the uh like the regarding the

33:37

artificial neural network and the CNN

33:39

and this RNN so here in the generative

33:42

AI uh you'll find out that I have like

33:44

included a few slides and all so let's

33:47

try to understand a few uh thing from

33:49

here and then again we'll go back to the

33:52

uh the Blackboard and then I will try to

33:54

discuss few more concept so over here uh

33:57

we have seen the chat GPT like I was

34:00

talking about the different different

34:01

application like chat GPT Google B and

34:03

metm and all now let's talk about the

34:06

generative AI that what is a generative

34:08

AI now here you can see the definition

34:11

of the generative AI uh which I have

34:13

written over here uh that is what that a

34:15

generative AI generate new data based on

34:17

a training sample right so the name is

34:21

uh the name is self-explanatory right so

34:24

the name is explaining everything

34:25

generative AI the AI which is generating

34:28

something now what all thing we can

34:30

generate so here if we are talking about

34:31

the generative AI so you can generate

34:33

images you can generate text you can

34:35

generate audios you can generate videos

34:38

as a output you can generate anything uh

34:40

so uh this image text audio video it's

34:44

nothing it's a type of the unstructured

34:46

data and definitely it is possible by

34:48

using the generated AI we can uh

34:50

generate this type of data by using the

34:52

generative AI now if we are talking

34:55

about the generative AI so uh as I told

34:58

you that it is having their own Roots

35:01

okay so it is having their own roots and

35:03

if we are going to divide this

35:04

generative AI so we can divide into two

35:06

segment so the first segment is called

35:09

generative image model and the second

35:11

segment is called generative language

35:13

model and this llm actually it falls

35:16

into this particular segment into this

35:19

generative language

35:21

model are you getting my point yes or no

35:24

I think yes so if we talking about this

35:26

generative image model so I told you

35:28

when I I was talking about the Deep

35:30

learning uh like Ann RNN and CNN

35:33

reinforcement learning and there was a

35:35

gain so initially we were using the gain

35:38

for generating a data so let me show you

35:40

the architecture of the gain so the how

35:42

the architecture of the game looks like

35:45

so with that you will get some sort of

35:46

idea in the game we are using this uh

35:49

neural network only so let me show you

35:52

the architecture of the game so let me

35:54

search it over here over the Google game

35:57

architecture now uh here in the image uh

36:00

let me open the architecture of the game

36:04

so here guys uh just see so in the gain

36:07

actually we have two main components so

36:10

the first component is a generator this

36:12

is what this is a generator okay so uh I

36:15

think this is visible to all of you this

36:17

is what this is a generator and here you

36:19

will find out discriminator so this

36:21

generator and discriminator is nothing

36:23

it's a neural network so we are passing

36:26

this real data so here basically what we

36:28

are going to do we are going to pass a

36:30

real data and here we have a generator

36:33

which is generating some sort of a uh

36:34

like synthetic data and here we have a

36:36

discriminator based on that we are going

36:38

to discriminate between real data and

36:41

the synthetic data so this is the

36:43

architecture of the game and inside this

36:45

architecture you will find out we are

36:47

using two main thing we are using two

36:49

main component the first one is

36:51

generator and the second component is a

36:54

discriminator I think you're getting my

36:56

point and this generator and

36:57

discriminator is nothing it's a neural

37:00

network got it so this is also comes

37:03

under this generative AI so now let me

37:06

show you this generative AI now over

37:08

here I have written two points

37:09

generative image model and generative

37:11

language model so if you're talking

37:13

about generative image model so in our

37:15

previous days in our back back days

37:18

actually in our old days in 2019 18 so

37:21

this gain was very popular for

37:22

generating a data again uh this gain is

37:25

very uh like EXP uh like expensive in uh

37:28

terms of computation power and all so it

37:30

is very like very much expens uh like

37:33

expensive in terms of like uh

37:34

computation uh so over here you can see

37:37

so we were using this gain uh we were

37:40

using this gain for generating images

37:41

and all in our back days in 2018 and in

37:44

2019 and it was very very popular and we

37:47

have a different different uh variants

37:49

of the Gams if you'll find out the type

37:52

of the gain you will find out many types

37:54

now uh recently actually you will you

37:56

have find out the trend of the llm large

37:59

language model now guys here uh we are

38:03

uh we are talking about the game and

38:05

then uh this gain basically it was the

38:07

old concept it is a old concept

38:09

basically and there are different

38:10

different variants of the gain as well

38:13

now over here if we are talking about

38:14

this large language model so it become

38:16

very famous from the Transformer I will

38:18

come to the Transformer I will tell you

38:20

the complete history of the Transformer

38:21

as well now uh this image model and this

38:25

language model

38:27

but a recent days in a recent days what

38:29

I have seen in terms of this llm and all

38:32

even we can generate the images by using

38:34

this llm we got those llm basically

38:37

which is like that much powerful so by

38:39

using those particular llm we can

38:41

generate generat images as well okay so

38:45

we I will show you couple of models and

38:47

all uh regarding this uh like image

38:50

generation and definitely you will get

38:53

some sort of idea that how the uh those

38:56

part particular alms is working in terms

38:58

of image generation I can give you a

38:59

couple of example uh like Delhi so Delhi

39:02

is a example you can uh check over the

39:04

open a which is a model which is like a

39:07

uh like a famous for the image

39:09

generation now here uh if we are talking

39:11

about this image model so actually see

39:14

this image model basically it was

39:16

working for image to image Generation

39:18

image to image generation now this

39:21

generative model actually so if we are

39:23

talking about this generative model it

39:25

is working Tech uh it is working in

39:27

terms of text to image generation text

39:30

to image generation and text to text

39:32

generation so this two tasks definitely

39:35

we can perform by using this llm model

39:38

and this image to image generation

39:40

before we were doing it by using this

39:42

gain model in 2018 and in 2019 now uh as

39:47

I told you that we have those powerful

39:49

model in our recent Days by using those

39:51

particular model definitely we can

39:53

Implement image to image generation as

39:55

well that is also possible so uh

39:58

regarding that uh definitely I will show

40:00

you couple of model so we are having

40:03

four tasks here I have written it now

40:05

let me move to the next slide and let me

40:07

show you that what I have so here guys

40:09

you can see uh this cat is representing

40:12

a genitive model where you are giving a

40:14

prompt uh means where you are giving a

40:15

question and uh as a response U again as

40:19

a output basically you are getting a

40:20

response so in terms of uh see here we

40:23

are talking about generative model I'm

40:24

not talking about specifically this El M

40:27

okay so I told you this uh generative

40:30

model actually uh you can think it's a

40:32

super set this generative Ai and under

40:35

this generative AI you will find out

40:36

this llm and gang is also part of the

40:39

generative AI getting my point I think

40:42

this thing is getting clear so over here

40:44

we are talking about the generative

40:45

model so we are giving a input and we

40:47

are getting a like output now

40:50

specifically if I'm talking about

40:52

regarding this llm regarding this large

40:54

language model so this input actually

40:56

this is called input prompt and the

40:58

output actually it is called output

41:00

prompt so this cat you can imagine as a

41:03

generative model or as a llm model so

41:05

what we are passing as a input we are

41:07

passing input prompt and we are getting

41:09

as a output output prompt so this prompt

41:11

term is a very very important I think

41:14

you have heard about this uh prompt

41:16

engineering and all that uh uh like uh

41:19

prompt engineer is getting this much

41:21

that much and this prompt engineer plays

41:23

a very important role if uh we have to

41:25

design any sort of of a prompt now uh

41:27

different different types of prompt of

41:29

like zero short prompt few short prompt

41:31

few short learning and all we'll talk

41:33

about it as I will progress with the

41:35

like implementation and all in between I

41:37

will give you like idea regarding each

41:39

and everything now over here guys you

41:42

can see uh where this generative AI

41:44

exist so if you will look into the uh

41:46

look into through this particular slide

41:48

so here you will find out this

41:49

generative AI actually it lies inside

41:52

the Deep learning getting my point so

41:55

the generative AI actually it uh like

41:57

reside inside the Deep learning uh

41:59

initially only I have explained you that

42:01

uh we have a different different types

42:02

of neural network and it's a part of the

42:04

deep learning only now whether we are

42:06

going to generate an images by using the

42:08

llm or by using the gains or whether I'm

42:10

going to perform text to text generation

42:12

text to image generation or image to

42:14

text Generation by using the llm both

42:16

lies inside this generative Ai and this

42:18

generative AI is a part of the it's a

42:21

part of the tell me it's a part of the

42:23

deep learning now over here guys I have

42:26

written a couple of more slid so I will

42:29

try to explain you uh but first of all

42:31

let me give you the timeline of the llm

42:34

and then I specifically I will come to

42:36

the llm and all and I will be talking

42:38

about this discriminative Ai and the

42:40

generative AI as well so tell me guys uh

42:43

this part is clear are we going good are

42:46

you able to understand whatever I'm

42:48

explaining to all of you so if you are

42:51

getting it so please write down the chat

42:52

and you can ask me the questions as

42:55

well

43:15

if you have any uh type of Doubt or U

43:17

like if you're getting it or not getting

43:19

it whatever you can ask me in the chat

43:21

uh like chat section uh I will reply to

43:24

your questions

43:41

no reinforcement learning is not

43:42

required uh uh specifically we should

43:45

not go for the reinforcement learning

43:47

and

43:50

all yes this is a part of the uh like

43:53

this Genera way is a part of the deep

43:55

learning right

44:03

right yes llm model used in a generative

44:06

AI correct you got it uh

44:10

guys mathematical intuition so we will

44:13

talk about the mathematical intuition

44:15

and all but this uh more uh this course

44:18

this comp session is it is more focusing

44:20

on the applied side so I will create a

44:23

various application in between whatever

44:25

math iCal concept and all will be

44:27

required I will let you know that don't

44:42

worry great so I think uh people are

44:45

getting it and uh they are trying to

44:48

understand fine so whatever I have

44:49

explained you let me explain you the

44:51

like Blackboard uh and then again I will

44:54

come to this PP and we'll try to uh wrap

44:57

up the theoretical stuff and U then I

45:00

will explain you the applications and

45:01

all so over here guys see I was talking

45:04

about this Uhn CNN RNN RL and G now I

45:10

started from the generative AI itself so

45:14

I have started from the generative Ai

45:16

and I told you this generative AI is

45:18

nothing you can consider it as a super

45:21

set as a super set now inside this

45:26

generative AI you will find out many uh

45:29

like uh many uh concept many topics and

45:31

all so here uh regarding the generative

45:33

AI there is uh two main thing which you

45:35

will find out the first one is

45:38

gain gain that is a generative aders

45:42

Network the second is what

45:44

llms llms large language model now we

45:48

have a various task so here let me write

45:51

down the task as well so the task wise

45:53

so here I told you the different

45:54

different task basically so the first

45:56

task which I can write it down over here

45:58

that is a image to image Generation

46:02

image to image

46:05

generation now the second task was the

46:08

uh image to text uh text to text

46:12

generation text to text generation text

46:16

to text generation now the third task

46:19

was

46:21

the uh image to text

46:24

Generation image to text

46:28

generation and the fourth one was

46:32

the uh image to image generation sorry

46:36

uh text to text Generation image to text

46:37

and text to image generation so let me

46:39

write it down over here text to image

46:44

generation text to image

46:50

generation now if we are talking about

46:52

this image to image generation yes we

46:54

were able to do this particular thing by

46:56

using this

46:57

gain we have seen the gains now we are

47:00

talking about this text to text

47:02

generation yes it was possible by using

47:04

the lstm RNN and the uh different

47:07

different by using the different

47:08

different model as well but yeah this

47:10

text to text generation actually

47:12

nowadays you are seeing uh we are

47:14

preferring this large language model for

47:16

this text to text generation and you

47:18

this chat GPT is a biggest application

47:20

uh biggest like example for that the

47:22

chat GPD which we are seeing image to

47:24

text generation yes uh this is also

47:26

possible by using a different different

47:28

model like RNN lstm and Gru image

47:31

captioning if you have if you uh if you

47:33

have heard about this uh like image

47:35

capturing task so that is also possible

47:38

uh by using this uh like uh classical

47:40

model but yeah by using this llm also we

47:43

can perform it we can uh do it now if we

47:45

are talking about this uh text to image

47:48

generation so yes uh this type of task

47:51

nowadays it is possible by using the uh

47:54

llm so yes yes uh llm is able to do llm

47:59

is able to perform a various amount of

48:00

task uh whether it's a homogeneous or

48:03

it's a hetrogeneous now uh I was talking

48:06

about the uh llm uh sorry I was talking

48:08

about this generative AI so where it

48:10

exists so this generative AI actually it

48:12

exists uh in a u like a deep learning

48:15

itself so you can think that AI is a

48:17

superet machine learning is a subset

48:20

deep learning again is a subset of the

48:21

machine learning and this generative AI

48:23

is a subset of the deep learning because

48:25

as I already told you we have a

48:27

different different uh like other neural

48:29

network also in a uh like a deep

48:32

learning and this CNN is one of them

48:34

this a convolution neural network okay

48:37

so I think this part is clear to all of

48:39

you now let me draw the architecture uh

48:42

that where this uh generative AI exists

48:45

so you can think this is what this is my

48:47

AI this is one uh this is the like a

48:49

super set now here this is what this is

48:51

my machine learning this one now uh

48:54

inside that you will find out the uh

48:56

deep learning and inside the Deep

48:58

learning you will find out this

49:00

generative AI uh so let me take a

49:02

different color over here uh let me take

49:05

uh this color so here you will find out

49:08

the generative AI so this is what this

49:10

four circle is what this is the

49:11

generative AI got it now here uh you can

49:15

see why we are saying so why we are

49:17

saying this is a like a subset so I

49:20

think each and every explanation I have

49:21

given you over here uh you can uh prefer

49:24

this uh like a this particular slide

49:26

that why I'm saying this generative AI

49:28

is a subset of the deep learning so let

49:31

me write it down over here this is what

49:33

this is nothing this is a gen Ai and

49:35

it's a subset of the deep learning now

49:37

guys let me explain you the timeline of

49:39

the uh this llm so uh now you got it

49:42

that this uh llm is nothing it's a part

49:44

of the generative a itself this large

49:47

language model now let me talk about the

49:49

complete timeline of this large language

49:52

model so how it evaluate and uh uh I can

49:56

like talk about the complete history of

49:58

it and uh here guys you can see that

50:02

first I was talking about the RNN so as

50:05

you know that uh what is the RNN tell me

50:07

RNN is nothing it's a type of the neural

50:10

network it's a type of the neural

50:13

network so uh there basically we have a

50:15

feedback loop again we can pass the

50:17

information to our H layer now you will

50:19

find out a different different types of

50:21

RNN or some Advanced architecture in

50:24

terms of this RNN itself El the second

50:27

uh like thing which is a type of the RN

50:30

itself that is called lstm

50:33

lstm right so in the lstm actually uh if

50:37

we are talking about this lstm so here

50:39

you will find out the concept of the

50:41

cell state so in the RNN we just have a

50:43

Time stem and it is for the shortterm

50:46

memory it is for the shortterm

50:49

memory we cannot retain a longer

50:52

sentences by using this RNN it is not

50:55

not possible if our sentence is a very

50:57

very huge or it's a very very long so we

50:59

cannot retain that particular sentence

51:01

by using this RNN but if we are talking

51:04

about this lstm yes we can do it by

51:06

using this

51:08

lstm so in this lstm you will find out

51:10

the concept of the cell state so uh this

51:14

uh lstm is nothing it is for the

51:16

short-term dependency and it is for the

51:18

long-term dependency also it is for the

51:20

short like a memory short-term memory

51:23

and is for the long-term memory as well

51:25

if you look into the architecture of the

51:26

lstm so you will find out along with

51:28

this uh time stem so here we have the

51:31

time stem U like it's a hidden State

51:35

actually uh like on a different

51:38

different time stem along with that

51:40

you'll find out one cell state so it is

51:43

going to retain it is going to retain

51:45

the long-term dependency and in between

51:47

in this a time stamp in this short-term

51:50

memory and in this cell State you will

51:52

find out a connection the connection in

51:54

terms of gates so here you will find out

51:56

one connection uh like uh one gate

51:59

basically that is called forget gate so

52:02

here I can write down the forget gate

52:03

now here you will find out one more gate

52:05

actually so that is called input gate

52:08

here you are passing the input now here

52:10

you will find out one more gate over

52:13

here that is called output gate output

52:15

gate okay so we have three gates inside

52:18

the lstm for sustaining a long-term

52:21

dependency or for reminding a longterm

52:23

uh long sentences now uh you will find

52:26

out one more updated version of the lstm

52:29

so this RNN is a old thing this lstm is

52:31

also old thing now you will find out one

52:33

more updated version of the lstm that is

52:35

what that is a GRU so this Gru actually

52:38

they have invented in

52:40

2014 and they had they took the

52:42

inspiration from the lstm itself now

52:45

inside this Gru you won't find out the

52:47

concept of the cell State everything is

52:50

being done by the hidden State itself

52:53

and here basically in the gru we just

52:55

have two gate update gate sorry reset

52:59

gate and update gate and it's a uh Advan

53:02

or you can say it's a updation on top of

53:05

this lstm it's a updated version of the

53:07

uh like lstm itself now what is the full

53:09

form of the gru G and recurrent unit now

53:12

over here guys see this was the three

53:14

architecture which was very very famous

53:16

during 2018 and 19 in our old days now

53:20

here see uh one concept comes into the

53:23

picture if we are talking about this RNN

53:25

lstm and Gru so by using this particular

53:28

architecture what we are doing so by

53:30

using this particular architecture we

53:32

are going to process a sequence data yes

53:35

or no we are going to process a sequence

53:38

data now here one concept comes into a

53:41

picture sequence to sequence mapping and

53:44

for that only we are using this

53:46

particular architecture so we have a

53:48

different different type of uh like a

53:50

mapping technique so let me write it

53:51

down over here uh different different

53:53

type of mapping technique

56:09

uh now it is fine uh I think I'm audible

56:12

to everyone

56:15

now now I am audible guys please do

56:19

confirm in the chat I think there were

56:22

the issue from the mic side

56:29

now I'm audible so please do confirm in

56:31

the chat if I'm audible then and uh is

56:34

there any Eco or uh what

56:37

so guys are you facing any Eco in my

56:44

voice now it is

56:53

fine yeah it is perfect I

57:02

think great fine fine fine uh it's

57:23

clear great uh I think now I am audible

57:27

to everyone sorry I think there was a

57:30

issue from

57:40

the do let me know in the chat uh from

57:43

where I lost my

57:45

voice so this concept is clear this one

57:48

to many or one to one one to many many

57:51

to one many to

57:53

many

57:55

[Music]

58:10

yeah so I think uh I was there RNN lstm

58:14

and Gru now I think it is fine I'm

58:16

audible to everyone great so I was

58:18

talking about RNN lstm Gru and then U I

58:22

talked about the different different

58:23

mapping sequen

58:25

now uh this mapping sequences actually

58:28

we can Implement by using this uh RNN

58:32

lstm and

58:33

Gru so over here uh yes so 1 to 1 one to

58:38

many many to one many to many RN and LSM

58:41

and Gru this was the sequences actually

58:43

I was talking about now in 2014 actually

58:46

see this was the sequences by uh we can

58:49

Implement by using this different

58:50

different models getting my point now

58:53

over here uh if we talking about this

58:56

particular sequences definitely we can

58:58

uh like uh per we can uh create a

59:01

various uh application by using this

59:03

model but here basically we are having

59:07

some sort of a restriction uh as I told

59:09

you the different different application

59:11

like one to many many to one so many to

59:14

one means uh you can think that

59:16

sentiment analysis one to one to many

59:18

means what one to many you can say image

59:20

capturing many to many image uh sorry uh

59:23

language translation so there are

59:25

various application of the sequences now

59:27

see uh we are talking about the

59:30

sequences uh the sequence to sequence

59:32

mapping now uh we can definitely

59:34

implement it by using this particular

59:37

architecture so the problem we were

59:39

having the problem was actually uh we

59:43

cannot see let's say we are giving an

59:45

input in the input actually we have a

59:48

five words so whatever output we'll be

59:51

getting in the output also we should

59:53

have a five words

59:55

so it's a fixed length input and

59:57

output getting my point what I'm saying

1:00:00

so by using this particular mapping 1 to

1:00:03

one many to one or like many to many

1:00:06

specifically we are talking about many

1:00:07

to many so there was some problem there

1:00:09

was some issue the issue was fixed

1:00:12

length input and output so whatever

1:00:14

number of inputs we are passing in terms

1:00:17

of this many too many I'm talking about

1:00:19

okay so whatever number of inputs we are

1:00:22

passing so those many output on we can

1:00:25

get it over here in the output itself so

1:00:28

uh here actually one a research paper

1:00:31

came into the picture in 2014 you can

1:00:34

search about uh the research paper

1:00:36

sequence to sequence learning so inside

1:00:40

that uh paper they have introduced the

1:00:42

concept of the encoder and decoder in

1:00:44

the encoder and decoder actually the one

1:00:47

segment the one segment was the encoder

1:00:50

segment segment so let me uh draw it

1:00:52

over here so the one segment was the

1:00:54

encoder segment and the another segment

1:00:57

was the decoder segment this another

1:00:59

segment was the decoder segment and in

1:01:02

between actually in between we were

1:01:05

having in between actually we are having

1:01:08

the context Vector so here uh in between

1:01:12

this encoder so we are having the

1:01:14

encoder and we are having the decoder

1:01:19

decoder one part was the encoder and one

1:01:22

part was the decoder and in between we

1:01:24

having the context Vector means whatever

1:01:27

information was there whatever

1:01:29

information was there from encoder to

1:01:31

decoder we are passing through this

1:01:34

context Vector means we are wrapping all

1:01:36

the information in this context vector

1:01:38

and we are passing to the

1:01:40

decoder that actually the paper uh has

1:01:43

been published in 2014 you can search

1:01:45

about it you can search over the Google

1:01:47

sequence to sequence learning so let me

1:01:49

uh search in front of you only now over

1:01:52

here I can write it down sequence to to

1:01:55

sequence

1:01:58

learning research paper now uh over here

1:02:02

guys you will find out this uh

1:02:03

particular research paper now just try

1:02:05

to read this paper now here in this

1:02:08

particular paper they have clarify the

1:02:10

issue that what was the issue with the

1:02:12

classical mapping so that was restricted

1:02:15

to the input and output now over here

1:02:18

you if you will read this particular

1:02:19

research paper so easily you can find it

1:02:22

out the issue here itself in the

1:02:24

like introduction itself they have

1:02:26

mentioned they have mentioned this uh

1:02:28

despite their flexibility and power can

1:02:30

only be applied problem who inputs and

1:02:32

targets can be sensibly encoded with the

1:02:34

vector of fixed dimensionality it was

1:02:37

just for the fixed dimensionality and

1:02:39

basically there was we were having a

1:02:41

limitations so for solving that

1:02:43

particular limitation this a sequence to

1:02:45

sequence learning paper came into the

1:02:47

picture and there was three person Ilia

1:02:49

sasar and orol and this there was one

1:02:53

more person and this paper from the

1:02:55

Google side now here guys uh let me open

1:02:58

this uh Blackboard again so there was a

1:03:01

context Vector but this uh encoder and

1:03:03

decoder also was not able to uh perform

1:03:06

well for the long uh longer sentences so

1:03:10

here in the research basically they have

1:03:12

proved if my sentence is going uh is

1:03:15

going uh like above from 30 to 50 words

1:03:18

right if it is longer than 30 to 50

1:03:20

words so in that case it was not able to

1:03:23

sustain the context it was not able to

1:03:26

sustain the context if we are using this

1:03:29

encoder decoder architecture now you

1:03:31

will ask me sun what we were having

1:03:32

inside the encoder and decoder so we are

1:03:35

talking about the encoder so again here

1:03:36

we were using the either RNN lstm or uh

1:03:42

lstm and we were using this Gru and here

1:03:46

also in the decoder also we are using

1:03:48

this rnl we are using the lstm and we

1:03:51

were using this

1:03:53

Gru got

1:03:55

it I think you got the problem now and

1:03:58

you got to know about the encoder and

1:03:59

decoder so we have started from the RNN

1:04:02

then now we came to the lsdm Gru and

1:04:05

then we have a different different

1:04:06

mapping and for solving this particular

1:04:08

issue which is related to this many to

1:04:10

many uh like uh mapping many to many

1:04:13

sequence mapping and this uh uh this

1:04:16

language translation is one of the

1:04:17

example if you will search over the

1:04:19

Google translate uh just search over

1:04:22

there anything let's say in the in H you

1:04:24

are saying that or whatsoever so it will

1:04:28

generate output so this input word and

1:04:30

output word will would be a mismatch but

1:04:33

that was a restriction with this uh like

1:04:35

with the classical mapping so for using

1:04:38

this encoder and decoder architecture we

1:04:40

can solve that particular problem now

1:04:42

here also we are having the issue that

1:04:44

we cannot proceed a longer

1:04:47

sentences we cannot proceed a longer

1:04:50

sentences so here One More Concept comes

1:04:53

into a picture inside this context

1:04:55

itself and that was the

1:05:00

attention that was the attention so uh

1:05:04

here neural translation

1:05:10

with just a second let me search about

1:05:14

the neural trans TR a NS relation with

1:05:20

attention yes this was the paper and uh

1:05:24

this was the first paper let me search

1:05:27

about the research paper yeah now guys

1:05:31

uh this was the paper in this particular

1:05:33

paper they have introduced the concept

1:05:34

of the attention and just try to

1:05:37

download it you need to download this

1:05:39

particular paper and uh then you can see

1:05:44

there so just a second let me show you

1:05:47

this paper as well and this is the main

1:05:50

uh like main papers uh basically which

1:05:52

you will find out uh while you will be

1:05:54

learning this deep learning and all so

1:05:56

this paper actually this has been

1:05:58

introduced in

1:05:59

2015 I think in 2015 or 16 now here they

1:06:02

have introduced the concept of the uh

1:06:05

attention actually so just try to read

1:06:07

uh this particular paper at least try to

1:06:09

read the introduction of it uh there we

1:06:12

have uh there they have defined that uh

1:06:14

what was a problem with the encoder and

1:06:16

decoder and where this attention comes

1:06:18

into the picture and what is the actual

1:06:20

meaning of the attention they have

1:06:21

introduced each and everything over here

1:06:24

inside this particular paper inside this

1:06:26

particular paper they have introduced

1:06:28

each and everything regarding the

1:06:29

attention see this is the architecture

1:06:31

of the attention model and uh before

1:06:33

going through with any blog any website

1:06:35

or any tutorial try to uh go through

1:06:37

with the research paper and try to

1:06:39

understand the motive of that research

1:06:41

paper now see guys uh here I'm not going

1:06:44

into the detail of the attention because

1:06:47

this attention itself uh is a longer

1:06:49

topic but I can uh like give you the

1:06:51

glimpse of that that uh uh what what

1:06:54

they were doing in the attention so they

1:06:56

were mapping so let's say we have a five

1:06:58

words in the sentence so they were

1:06:59

trying to map each word whatever word we

1:07:02

have a input we were trying to match

1:07:04

each each input word with the output

1:07:06

word means this input and output this

1:07:10

encoder and decoder if we are talking

1:07:11

about this decoder actually so this is

1:07:13

having the uh information each and every

1:07:15

information of the Hidden State whatever

1:07:18

like in the encoder like you will find

1:07:19

out this RNN lstm or whether it's a GRU

1:07:23

so uh we have a hidden State actually

1:07:25

right so uh this decoder part is having

1:07:28

the information regarding those

1:07:30

particular hidden State all the hidden

1:07:32

State and because of that it was able to

1:07:35

uh it was able to predict so whatever

1:07:38

like sentence and whatever words or

1:07:40

longer sentences or like U like uh the

1:07:43

longer sentences and all which uh

1:07:46

whatever basically we were passing it

1:07:47

was able to predict okay so this word is

1:07:49

related to that particular sentence so

1:07:51

what I will do I will create a like a

1:07:53

one dedicated video on top of it there I

1:07:55

will try to discuss uh this attention

1:07:57

mechanism but yeah here I'm just giving

1:07:59

you the timeline U and with that um you

1:08:02

can clearly understand so uh here we

1:08:05

were having the attention mechanism now

1:08:07

guys by using this attention mechanism

1:08:10

by using this attention mechanism in

1:08:12

2018 Google again Google published one

1:08:16

research paper and the research paper

1:08:18

name was

1:08:22

attention about this encoder in the

1:08:25

encoder and this decoder we were using

1:08:29

what we were using guys tell me we were

1:08:30

using this LSM either we are using the

1:08:33

lstm RNN or maybe Gru now uh there also

1:08:39

we are having the lstm maybe RNN or

1:08:42

maybe you are having the Gru and uh if

1:08:45

we are talking about the attention so

1:08:46

whatever uh information we are passing

1:08:48

from here to here so you are having the

1:08:50

context Vector context Vector now on top

1:08:53

of that we are having the attention

1:08:55

layer attention layer and it was nothing

1:08:58

it was just a mapping from input words

1:09:01

to out output word now here actually

1:09:05

they have published one paper in 2018

1:09:08

and the paper name was attention all

1:09:11

your need attention all your need now

1:09:16

this paper actually it was a

1:09:17

breakthrough in the NLP history this

1:09:20

paper has been published in

1:09:22

2018 and here

1:09:27

actually

1:09:29

decoder but there is one uh there is one

1:09:32

thing basically in terms of this encod

1:09:34

and decoder you won't be able to find

1:09:36

out this lstm RNN and Gru they are not

1:09:38

using any RNN cell any lstm cell or any

1:09:41

Gru cell so here actually they were

1:09:44

using something else and here the what

1:09:47

is a uh name of the research paper so

1:09:49

they were saying that attention all your

1:09:51

need only attention is required for

1:09:54

generating us let's say we are passing

1:09:56

any sort of an input means any longer

1:09:58

input so from that particular input only

1:10:01

attention is required for generating

1:10:03

output now how let me show you

1:10:09

that this Transformer architecture or

1:10:12

let me show you the attention all your

1:10:14

need research paper so attention all

1:10:17

your need research paper so guys this is

1:10:22

a very uh prestigious paper in our NLP

1:10:24

history and uh this changed the complete

1:10:27

history of the NLP and whatever llm and

1:10:29

all whatever you are seeing like

1:10:31

nowadays so they have used this

1:10:35

Transformer architecture as a base model

1:10:37

I will come to that and there I will try

1:10:39

to uh discuss that uh what is the

1:10:41

encoder and decoder again I'm not going

1:10:43

into the depth of the mathematics but

1:10:45

yeah definitely I will try to give you

1:10:47

some sort of a glimpse so over here uh

1:10:49

let me zoom in first of all this paper

1:10:53

and and here guys the paper name was

1:10:55

attention is all your need so this was

1:10:58

the researcher asish Nome Nikki Jacob

1:11:01

you can uh search about these particular

1:11:03

people and here is the abstract uh you

1:11:06

can see and this is the introduction at

1:11:08

least try to read the introduction try

1:11:10

to read this particular background and

1:11:12

the model architecture so this was the

1:11:14

model architecture which has been

1:11:16

introduced by the uh by the Google

1:11:18

researcher and the architecture

1:11:20

basically which you will find out inside

1:11:22

this research paper I think everywhere

1:11:24

you will find out this uh this

1:11:26

particular architecture in uh whatever

1:11:28

NLP tutorial or if you are going to

1:11:30

understand the attention mechanism and

1:11:32

all so this is the architecture now in

1:11:34

this particular architecture let's try

1:11:36

to understand that what all things we

1:11:38

have so see first of all we have a

1:11:41

input okay try try to understand try to

1:11:44

focus over here so we have a input over

1:11:46

here then we have a input embedding so

1:11:48

this is my first thing input and this is

1:11:50

what this is the input embedding the

1:11:52

third thing which we have that is a

1:11:53

positional encoding getting my point and

1:11:56

then after that you will find out the

1:11:58

multi-headed attention then we have a

1:12:00

normal uh normalization and all and then

1:12:02

we have a feed forward Network now guys

1:12:06

just tell me this is what this is a

1:12:07

encoder part this is what this is a

1:12:09

encoder part and this is what guys this

1:12:11

is this is a decoder part this is the

1:12:14

decoder part got it getting my point so

1:12:17

here also we have a two segment first

1:12:19

was the encoder and the second was the

1:12:21

decoder but here we are not using any

1:12:23

RNN cell lstm cell or maybe Gru cell

1:12:27

here actually we are using something

1:12:28

else some other concept and the concept

1:12:31

actually I think this is not a new thing

1:12:32

for you this embedding and all uh this

1:12:35

embedding attention already I talked

1:12:37

about the attention that what it is

1:12:39

mathematically it is having a like uh

1:12:41

like a some different explanation but

1:12:43

yeah I think you got to know the idea

1:12:45

now here we have a feed forward neural

1:12:47

network you know like what is a like

1:12:49

artificial neural network what is a feed

1:12:51

forward neural network so it's not a

1:12:52

like a new thing for all of you and by

1:12:55

assembling all those thing they have

1:12:57

created one cell one architecture and

1:13:00

the name is called this uh Transformer

1:13:04

so this architecture itself is called a

1:13:06

Transformer what is this guys tell me

1:13:08

this is a Transformer now here guys just

1:13:10

see uh this uh Transformer if we are

1:13:13

talking about this Transformer and all

1:13:16

so let me uh tell you few things

1:13:18

regarding this Transformer uh so first

1:13:20

of all guys this is a uh fast compared

1:13:23

to the classical architecture if we are

1:13:25

talking about this RNN lstm and all so

1:13:28

there we are passing the input based on

1:13:30

a Time stem based on a Time stem but if

1:13:34

we are talking about this Transformer

1:13:35

guys so here what is the importance or

1:13:38

what is the like plus point which we

1:13:40

have inside the Transformer it is a

1:13:41

faster why because we can pass the input

1:13:44

in a parallel manner we can pass all the

1:13:47

inputs all the tokens in a parallel

1:13:49

manner in a parall actually we can pass

1:13:52

the input now over here see we have a

1:13:54

input embedding we are doing an

1:13:55

embedding over here and then we have a

1:13:57

positional encoding means we are

1:13:59

arranging a sequence sequence of the

1:14:01

sentence then we have a multi-headed

1:14:03

attention again we are trying to uh

1:14:05

figure out the uh meaning see let's say

1:14:08

uh the sentence is what I am Sunny now

1:14:12

uh here it is trying to find out the

1:14:14

relation I with M and sunny is trying to

1:14:16

find out the relation M with uh this I

1:14:19

and sunny it's time to find out a

1:14:21

relation this sunny uh and this m and

1:14:24

this I so it is trying to find out a

1:14:26

relation with each and every word so it

1:14:28

is doing the same thing inside the

1:14:29

multi-headed attention then you will

1:14:31

find out this feed forward Network

1:14:33

neural network actually and yes uh this

1:14:36

is what this is my encoder part as I

1:14:38

told you this is what this is my encoder

1:14:40

part now if you will look into the

1:14:42

decoder side so again we have a same

1:14:44

thing so here we have a outputed output

1:14:46

embedding means in uh uh like whatever

1:14:49

uh like a sequence uh in whatever like U

1:14:52

am format I want output so that is uh

1:14:56

this particular thing this output Ting

1:14:58

and then again we have a like

1:14:59

multi-headed attention and we are

1:15:01

passing this thing uh to the next one to

1:15:03

the next layer and again we have a feed

1:15:05

forward neural network over here on top

1:15:07

of this you will find out the soft Max

1:15:09

and finally we are getting a output

1:15:11

output probability so don't worry I will

1:15:13

try to discuss this Transformer

1:15:15

architecture mathematically in a

1:15:17

detailed way in some other video but as

1:15:19

of now I'm just giving you the GL

1:15:20

Glimpse because whatever llms we are

1:15:22

going to discuss

1:15:25

okay as a base architecture they are

1:15:27

using this

1:15:29

Transformer so guys until here

1:15:31

everything is fine everything is clear

1:15:33

please do let me know in the chat yes or

1:15:47

no yes you can uh let me know in the

1:15:49

chat uh then I will proceed with the pp

1:15:51

and all and uh we'll try to wrap up the

1:15:54

uh introduction of this llm and all and

1:15:57

in tomorrow's session we'll try to talk

1:15:58

about the open a and we'll discuss about

1:16:01

the open API and all and a different

1:16:03

different models of the

1:16:07

openi any doubt anything so if you have

1:16:09

any sort of a doubt please do let me

1:16:11

know guys please do let me know in the

1:16:12

chat uh I will try to clarify that uh

1:16:15

those doubt and

1:16:22

uh

1:16:24

so did you get a timeline timeline of

1:16:26

the llm I will come to the llm now the

1:16:28

specific word and

1:16:32

uh after deep learning an NLP what is

1:16:35

the topic uh for generative AI please

1:16:38

give up uh so after the Deep learning

1:16:42

and see after the Transformer actually

1:16:44

by using this particular Transformer

1:16:46

people has created a different different

1:16:47

llms and all large language model now I

1:16:49

will come to that by using the slide I

1:16:51

will try to show you that

1:16:53

I think this

1:16:57

is pry much clear now let me go back to

1:17:00

this uh uh notes and here you can see so

1:17:05

I started from the deep learning then

1:17:07

generative VI and all then you got to

1:17:09

know that where generative a lies then

1:17:11

Alm Gru different different mapping

1:17:13

encoder decoder attention and finally

1:17:16

attention all your need now let's try to

1:17:19

understand uh like rest of the thing by

1:17:20

using the slide so here guys uh one more

1:17:23

thing I think we were uh trying to

1:17:26

understand this particular part where

1:17:28

this generative AI exists and I hope you

1:17:30

got a clearcut idea now let me go back

1:17:33

to the uh let me like come to the next

1:17:35

slide so in this slide you can see uh

1:17:37

I'm talking about the generative versus

1:17:39

discriminative model so what is the

1:17:41

difference between this generative and

1:17:42

discriminative model so we are talking

1:17:44

about this discriminative model so

1:17:46

whatever you have learned so far in a

1:17:48

classical machine learning and deep

1:17:50

learning so uh let's say uh I'm I'm

1:17:53

talking about this uh any classification

1:17:55

based model let's say I'm talking about

1:17:57

this uh RNN so here actually see uh you

1:18:01

are training your model on a specific

1:18:02

data so this is your data this is your

1:18:04

input and here is your output what you

1:18:06

are doing guys tell me you are

1:18:07

performing a supervised learning you are

1:18:10

performing a supervised learning by

1:18:11

using this recurrent neural network

1:18:14

there is a classical model or we have

1:18:16

like other classical model and all you

1:18:18

can use any uh uh like a machine

1:18:20

learning based model as well like na

1:18:22

buers and uh different different

1:18:24

variants of the nap bias or maybe some

1:18:26

other model you can uh use that

1:18:28

particular model also uh so over here we

1:18:31

have a model and we are going to train

1:18:33

this model by using the supervis machine

1:18:35

learning there we are going to pass a

1:18:37

specific type of data to this particular

1:18:39

model and here we have a different

1:18:41

different output like a rock this music

1:18:44

is belong to the rock music classical

1:18:45

music or maybe ranting so here we are

1:18:49

passing this uh like music to my model

1:18:51

and finally it is going to predict

1:18:53

something like that this is a

1:18:54

descriptive model now if we are talking

1:18:56

about a generative model so this is a

1:18:59

little different compared to this

1:19:01

discriminative model how it is different

1:19:04

uh compared to this discriminative model

1:19:05

so here guys see we are training this

1:19:08

see first of all the if we are talking

1:19:11

about the generative model if we talking

1:19:13

about the generative model so the

1:19:14

training process is a little different

1:19:16

if we are talking about the large

1:19:18

language model if we are talking about

1:19:20

the llms so uh the proc of training this

1:19:24

llms is a little different compared to

1:19:27

this discriminative model now over here

1:19:29

we are talking this discri this

1:19:30

generative model basically so we are

1:19:32

passing the input to this generative

1:19:34

model and we are getting an output how

1:19:37

how so here basically we have a

1:19:39

different different step for Gen for

1:19:41

like training this generative models so

1:19:44

gain wise I already told you that what

1:19:45

is a like process if you want to like

1:19:47

train uh any gain model if we are

1:19:49

talking about llm large language model

1:19:52

so at the first first place there will

1:19:53

be unsupervised learning unsupervised

1:19:55

learning then at the second place we'll

1:19:57

be having a supervised fine-tuning and

1:20:00

at the third place uh basically we have

1:20:02

a reinforcement learning reinforcement

1:20:04

learning they have recently used inside

1:20:06

the chat uh in the GPD model itself uh

1:20:09

which we are using for the chat GPD but

1:20:11

before that whatever llm model they have

1:20:13

created they have created they have

1:20:15

trained on a large amount of data so for

1:20:17

that first they have performed the

1:20:19

unsupervised learning and then they have

1:20:20

performed the supervised fine tuning

1:20:23

so because of that that model were able

1:20:25

to understand each and every pattern

1:20:27

which was there inside the data and

1:20:29

because of that it was able to generate

1:20:31

the output so this generative model is

1:20:34

nothing in that basically we have a data

1:20:37

on top of that particular data we are

1:20:38

training a model and for that we have a

1:20:41

various step and uh basically then only

1:20:44

we are going to do a prediction so what

1:20:46

it is giving me as a prediction so

1:20:47

whatever input we are passing so that

1:20:49

input it is taking and finally it is

1:20:51

generating uh the output related to that

1:20:54

particular input means it is generating

1:20:56

a new

1:20:58

data getting my point I think this part

1:21:01

is clear to all of you how this

1:21:03

generative model is different from this

1:21:05

discriminative model discrimin model is

1:21:07

a classical model like supervised

1:21:08

learning uh we are performing The

1:21:09

supervis Learning now right so here we

1:21:12

are having the RNN and we are passing a

1:21:14

data and all and we are trying to train

1:21:15

it generative model various step we have

1:21:19

like for the training and all and it is

1:21:21

responsible for generating a new new

1:21:22

data that's it so I hope guys this uh

1:21:25

thing is clear to all of you now I have

1:21:27

kept couple of more slide regarding uh

1:21:30

this particular concept just try to note

1:21:32

down the uh the headings and all and try

1:21:34

to remind uh this particular thing this

1:21:37

discriminative versus generative model

1:21:38

and all now here uh the same thing

1:21:41

unsupervised supervised learning which

1:21:43

is related to this uh discr model got it

1:21:46

and here uh you can see uh this is the

1:21:49

generative like model so in the

1:21:51

generative model what we do first we

1:21:53

perform the unsupervised learning we are

1:21:54

doing a grouping and all and then we

1:21:56

discri we perform the supervised

1:21:58

finetuning supervised learning so that

1:22:00

is a like process for training a uh like

1:22:04

any sort of a llm model which comes

1:22:06

under inside the generative AI itself

1:22:08

and again wise I already talked about it

1:22:11

now here actually uh we're going to talk

1:22:13

about this uh llm so let me give you the

1:22:17

quick idea about this llm and all that

1:22:19

is what that is a large language model

1:22:21

so for that all Al I have created one

1:22:23

slide and there specifically I kept the

1:22:26

thing related to this uh llms only so

1:22:30

let me start from the very first slide

1:22:32

uh let me give you the overview and uh

1:22:35

from tomorrow uh actually in tomorrow

1:22:37

session I will give you the detail uh

1:22:39

like overview uh with respect to

1:22:41

different different models and all

1:22:42

whatever we have as of now just a quick

1:22:45

introduction now what is the llm so llm

1:22:48

is nothing it's a model it's a large

1:22:50

language model which is trained uh like

1:22:52

U it's a large deep uh it's a large

1:22:55

language model which has been trained or

1:22:57

a huge amount of data and it is behaving

1:23:00

like it is generating something right so

1:23:03

actually by using this uh llm we can

1:23:05

generate any uh like a sort of a data

1:23:08

like Text data or maybe image data and

1:23:11

that is a like uh that is a advantage or

1:23:14

that is a like uh uh one uh very uh like

1:23:18

a very famous uh thing regarding this

1:23:20

llm and all now if we are talking about

1:23:22

this why this is called llm why this is

1:23:24

called large language model so here guys

1:23:27

if we are talking about this large

1:23:29

language model so because of the size

1:23:31

and the complexity so here specifically

1:23:34

I have mentioned regarding this large

1:23:36

language model regarding this llm why

1:23:39

this is called this uh this large

1:23:40

language model so here because of the

1:23:42

size and because of the complexity of

1:23:45

the neural network uh neural network

1:23:49

neural network as well as the size of

1:23:50

the data set uh which has has been uh

1:23:53

which is trained on actually this is

1:23:55

trained on the huge amounts of data

1:23:57

because of that only actually it is

1:23:59

called a large language model so here uh

1:24:02

if we are talking about this uh L large

1:24:04

language model so uh actually before we

1:24:08

were not having the huge amount of data

1:24:11

so uh recently actually uh you know uh

1:24:13

this uh data generation and all uh Big

1:24:16

Data actually came into the picture and

1:24:18

this companies and all generated a huge

1:24:20

amount of data and this Google also

1:24:22

Google Facebook and the other companies

1:24:24

is having a huge amount of data so uh

1:24:27

they uh they are able to like find uh

1:24:30

means uh actually they have uh gathered

1:24:33

that particular data and on top of that

1:24:35

data they have uh like as I told you

1:24:37

they have performed the unsupervised

1:24:38

learning and all and they have

1:24:40

categorized a data and they have

1:24:41

provided to a different different model

1:24:43

which U like has been created like GPT B

1:24:45

and all and because of that uh like they

1:24:49

were able to predict the next next

1:24:51

sentence and that is a like a main thing

1:24:53

main advantage of this large language

1:24:55

model now over here you will find out so

1:24:58

in the next slide uh I have mentioned

1:25:00

that what is the what makes llm so

1:25:03

powerful so here by using one single

1:25:05

model by using one single llm actually

1:25:08

we can perform a different different

1:25:10

type of task like text generation

1:25:12

chatboard uh we can create a chatboard

1:25:14

also we can uh do the summarization

1:25:16

translation code Generation by using a

1:25:19

single LM we can do that particular

1:25:22

thing

1:25:22

now here uh if you will find out so

1:25:25

already I told you that what is the base

1:25:27

architecture of the llm so here this

1:25:30

Transformer is what it's a base

1:25:31

architecture behind this llm behind this

1:25:34

large language model and I have already

1:25:37

explained you the concept of the uh

1:25:39

Transformer that what we having inside

1:25:41

the Transformer now here guys uh this is

1:25:43

a few Milestone which we have in terms

1:25:46

of the llm like bird is there I think

1:25:49

you know about the bird if we are

1:25:51

talking about the uh we are talking

1:25:53

about the like a bad days right or old

1:25:55

days in 2018 19 or 20 when uh chat GPD

1:26:00

was not there just uh this uh GPT was

1:26:02

not there GPT 3.5 and all the recent

1:26:05

model which we are using inide of chat

1:26:07

GPT so there were few Milestone and we

1:26:09

were using this thing in our old days

1:26:11

like B was there GPT uh actually GPT is

1:26:14

having a different different variant it

1:26:15

is having a complete family GPD 1 2 3

1:26:18

and 3.5 and recently GPD 4 came into the

1:26:21

picture and other variants as well so

1:26:24

xlm is also there uh cross lingual

1:26:27

language model pre-training by uh this

1:26:30

particular guy now T5 was also there

1:26:32

this a text to text

1:26:34

transfer text to text transfer transform

1:26:37

Transformer and it was created by the

1:26:39

Google Now Megatron was also there so

1:26:41

Megatron actually it was created by the

1:26:43

Nvidia now M2M was there so it was the

1:26:46

part of the Facebook research so there

1:26:48

were many uh like uh there was the uh

1:26:51

like many model actually actually okay

1:26:53

and this was a milestone in uh this uh

1:26:56

in terms of this large language model

1:26:58

now over here guys see this bird GPT xlm

1:27:01

T5 they are using a base architecture as

1:27:04

a Transformer one only now if you will

1:27:06

see in the next slide so I have

1:27:08

categorize this thing so they are using

1:27:10

a base architecture as a Transformer one

1:27:12

only but in that you will find out some

1:27:14

of the model are using a encoder and

1:27:17

some of the model are using a decoder

1:27:20

and some of the model are using both

1:27:22

encoder and decoder now here I have

1:27:24

categorized this particular thing that

1:27:26

uh this is the model like B Roberta xlm

1:27:30

Albert Electra DTA so these are the

1:27:34

model they are just using the encoder

1:27:36

only and if we are talking about this

1:27:38

decoder uh if we are talking about the

1:27:40

GPT GPT uh 2 gpt3 GPT new or like the

1:27:44

entire family of the GPT so they are

1:27:46

using this decoder so we have a two

1:27:49

segment of the Transformer architecture

1:27:51

few of models they are using an encoder

1:27:53

side encoder part and few model

1:27:55

basically they are using a decoder and

1:27:57

uh here guys you will find out some

1:27:59

model which is which are using both

1:28:01

encoder as well as decoder so this T5

1:28:05

Bart M2 m00 Big B so these are the model

1:28:08

actually they are using both encoder and

1:28:10

decoder in the Transformer architecture

1:28:13

if you'll find out we have a two segment

1:28:15

so this is a this segment basically this

1:28:17

one is called an encoder segment and

1:28:19

this particular segment this is called a

1:28:21

decoder segment so here uh like I think

1:28:24

you got to know uh you got to know the

1:28:26

idea that uh this is what this is a like

1:28:29

uh transform this is the encoder segment

1:28:32

and this is what this is a decoder

1:28:33

segment and this model this T5 B M2M and

1:28:37

big but they are using both and we have

1:28:39

other models as well I just written this

1:28:41

uh couple of name over here now apart

1:28:44

from this you will find out some openi

1:28:46

based model open a based llm model so

1:28:48

GPD 4 is there GPD 3.5 is there GPD

1:28:51

based is there Delhi Biser iddings okay

1:28:55

so these are the different different

1:28:56

model which you will find out over the

1:28:58

open website itself and uh here uh

1:29:01

definitely GPT is uh one of the

1:29:03

prestigious model or this is one of the

1:29:05

very important model which uh people are

1:29:08

using uh nowadays for creating their

1:29:10

like applications and all and it is it

1:29:12

can perform any sort of a task related

1:29:15

to a generation okay now over here uh

1:29:19

this is the openi based model which I

1:29:21

have written now apart from this you

1:29:23

will find out other open source model so

1:29:26

this is the model from the openi side so

1:29:28

if you are going to hit this model so

1:29:29

definitely open is going to charge you

1:29:32

regarding the tokens regarding the uh

1:29:34

regarding like how many tokens and all

1:29:36

whatever you are using according to that

1:29:38

it is going to charge you but here we

1:29:40

have some couple couple of Open Source

1:29:42

model as well and I have written the

1:29:45

name like Bloom Lama 2 Palm Falcon Cloud

1:29:49

amp okay stable LM and so on we have a

1:29:52

various model various open source model

1:29:55

and uh yes but I I will show you that

1:29:58

how you can use this particular model if

1:30:00

you are going to create your application

1:30:02

so definitely I will let you know I will

1:30:04

show you that how you can utilize this

1:30:05

model as well I will show you the use of

1:30:07

the Falcon I will show you the use of

1:30:09

the Llama 2 if you don't want to use

1:30:11

this GPT uh GPT 3.5 GPT 3.5 turbo I will

1:30:15

show you the use of this llama and this

1:30:17

Falcon and some others open source model

1:30:19

as well I think you are getting my point

1:30:22

now here uh if we are talking about what

1:30:26

can llm be used for so if we are talking

1:30:28

about llm that what it can do so it can

1:30:32

uh we can use this llm for any sort of a

1:30:34

task like classification text generation

1:30:37

summarization chat board question

1:30:39

answering or maybe speech recognization

1:30:41

speeech identification spelling

1:30:42

character so this uh llm actually uh if

1:30:46

we are talking about this L LM so first

1:30:48

of all it's a model it's a large model U

1:30:51

it's a language anguage model and it's a

1:30:52

large model it's a large language model

1:30:55

and what is a like what we can do by

1:30:58

using this large language model we can

1:31:00

generate the data okay it can identify

1:31:03

the pattern of the data it is having

1:31:05

that cap cap uh that uh that much of

1:31:08

capacity so it can identify the pattern

1:31:10

from the data and by using those pattern

1:31:14

we are we can perform a various amount

1:31:16

of

1:31:17

task okay that's why this llm is too

1:31:20

much powerful

1:31:22

and here we can use this llm for any

1:31:24

sort of a task and yes uh we know about

1:31:28

this it and already I have uh like I

1:31:32

explain you this thing I hope this

1:31:34

introduction is clear to all of you now

1:31:36

coming to this uh prompt design so

1:31:38

prompt design and all uh definitely I

1:31:40

will talk about it uh once I will come

1:31:42

to this open a API there will try to hit

1:31:45

the uh different different models of the

1:31:47

open a and uh we have a different

1:31:50

different type of prompts so as as of

1:31:52

now you can think that the prompt is

1:31:53

nothing whatever input we are passing to

1:31:55

the model uh that is called input prompt

1:31:58

and whatever output we are getting from

1:31:59

the model itself that is called the

1:32:02

output prompt and here how cat GPD was

1:32:05

trained so generative of pre-training

1:32:08

supervise fine tuning and this

1:32:10

reinforcement learning there was three

1:32:12

step which I have mentioned so I will be

1:32:14

talking about this also and not in

1:32:17

today's session in the like next session

1:32:20

uh I'll be talking about this uh how CH

1:32:22

GPT and all it was stained uh okay now

1:32:26

what I can do so over here guys uh I

1:32:29

think uh we should uh conclude the

1:32:32

session so how was the session please uh

1:32:35

do let me know in the chat it was good

1:32:37

bad or what so did you uh understood

1:32:41

everything did you understand everything

1:32:43

whatever I have explained you uh

1:32:45

regarding this uh regarding this llm and

1:32:47

this generative AI the complete

1:32:49

introduction because uh I want that

1:32:52

before starting with any sort of a

1:32:54

practical the basics should be

1:33:04

clear everything did you

1:33:07

understand amazing

1:33:10

great to what is the

1:33:14

topic

1:33:17

yes fine uh if you have any doubt and

1:33:20

all so you can ask me I will try to

1:33:22

answer for that now before concluding

1:33:24

with uh like uh before concluding the

1:33:28

session let me show you few more things

1:33:30

over here so see uh here first of all

1:33:33

what you need to do uh first of all you

1:33:35

need to like uh go through with the open

1:33:37

a and you need to generate a open a API

1:33:40

and all so that uh basically don't worry

1:33:43

I will show you while I will be doing a

1:33:44

practical and all so you need to like at

1:33:47

least you need to create an account and

1:33:49

uh and you need to login it over here so

1:33:51

so once you will log in guys here you

1:33:53

will get two option first is chat GPT

1:33:55

and the second is API just go through

1:33:57

with this API and generate this API key

1:34:00

generate the API key from here don't

1:34:02

worry in the next session in the next

1:34:04

class again I will show you this thing

1:34:06

and here I see we have a different

1:34:08

different model so let me show you those

1:34:10

model and whatever open source model and

1:34:13

all is there so you will find out over

1:34:14

the hugging phase so let me show you the

1:34:17

hugging face models hugging face Hub and

1:34:21

uh here you will find out the model Hub

1:34:24

so guys uh here actually we have a model

1:34:27

Hub just a second yeah models now you

1:34:31

will find out a different different type

1:34:33

of model see these are the models which

1:34:36

is a open source and uh uh you'll find a

1:34:38

complete description let's say this uh

1:34:40

we are talking about this Orca 2 so this

1:34:43

updated 12 days ago and it's a recent uh

1:34:45

llm model uh which has been published uh

1:34:48

by the Microsoft now over here you can

1:34:52

see so it like you will find out the

1:34:54

complete description or complete detail

1:34:56

regarding this model and like uh how to

1:35:00

use it and uh each and everything

1:35:02

basically definitely we'll talk about it

1:35:04

now for what all task basically we can

1:35:06

use it okay so according to that also

1:35:09

you can uh like select the models so

1:35:11

just go through with the hugging phase

1:35:13

models and there you will find out many

1:35:15

uh like a different different models

1:35:18

okay and yes for sure openi is also

1:35:20

having uh different different llm model

1:35:22

so we'll talk about that we'll try to

1:35:24

understand the concept of this uh we'll

1:35:26

try to understand this uh assistant

1:35:28

actually and we'll try to talk we'll try

1:35:30

to understand the chat U actually so

1:35:33

what is this and how to use it how to

1:35:35

use this chat option and this assistant

1:35:37

option and here if you will go inside

1:35:39

the documentation so you will find out

1:35:41

of different different models over here

1:35:43

this GPT GPT 3.5 Del TTS whisper

1:35:47

embedding moderation GPT W gpt3 right

1:35:51

right different different models we have

1:35:53

and uh apart from that you can find out

1:35:55

the different different task according

1:35:57

to that also they have given you the

1:35:59

model so text generation so they have

1:36:00

given you the complete code and all so

1:36:02

just try to visit it just try to go

1:36:03

through it uh by yourself now uh we have

1:36:07

other uh platform as well so if you are

1:36:10

not going to use the uh maybe J uh if

1:36:14

you don't want to use this uh GPT and

1:36:16

all so here uh I can show you one more

1:36:19

uh like option so

1:36:23

AI 21 okay so AI 21 Labs AI 21 Labs so

1:36:27

this is the Recently I figured it out

1:36:29

actually this is the uh like alternative

1:36:32

of the GPT so we'll talk about this also

1:36:34

if you don't want to pay to this uh if

1:36:36

you don't want to pay for the GPT so you

1:36:38

can use this AI 21 lab uh and it will

1:36:42

give you the uh like a uh one model one

1:36:45

llm model so you can use it uh like

1:36:48

freely actually it gives you the $90

1:36:50

credit so so yes I will show you how you

1:36:53

can use this AI 21 lab uh so let me show

1:36:56

you the documentation and let me show

1:36:57

you the models as well so here you will

1:37:00

find out the uh model basically which is

1:37:03

there so Jurassic 2 is a model and it's

1:37:05

like a pretty amazing model and uh uh

1:37:09

yes definitely I'll be talking about it

1:37:11

and along with that uh the applications

1:37:13

of it which is very much required that

1:37:15

for what all task we can use it whether

1:37:17

if you are going to create a chat board

1:37:19

or maybe if you are going to do a

1:37:21

question answering or text generation or

1:37:24

like sentiment analysis for what type of

1:37:27

task we should use it and how to design

1:37:28

a prompt and all regarding the specific

1:37:31

task got it so we'll talk about this

1:37:34

also so uh yes many things is there and

1:37:37

definitely uh uh like from Tomorrow

1:37:40

onwards I'm going to start from the open

1:37:42

a lure and step by step I will come to

1:37:44

the uh different different models and

1:37:47

all so I hope guys this is uh clear

1:37:53

yes practical implementation will be

1:37:55

there don't

1:37:58

worry yes recording will be available

1:38:00

over the

1:38:05

YouTube yes all the uh all the topic

1:38:07

will be covered in the upcoming session

1:38:09

uh all the discussed topic and

1:38:15

all yes definitely this will be

1:38:18

available in the dashboard you can go

1:38:19

and check uh your dashboard this uh

1:38:21

video along with the video you will find

1:38:23

out the assignment you will find out the

1:38:25

quizzes and regarding the particular

1:38:42

topic fine I think uh we can conclude

1:38:45

the session

1:38:48

now is gener andm are also used in

1:38:51

computer vision based project so for

1:38:54

computer vision based project we have a

1:38:56

uh like others model we have a different

1:38:58

models uh because uh the task is

1:39:00

different over there so the task wise we

1:39:03

are talking about the computer vision

1:39:04

related task like object detection

1:39:06

object segmentation tracking OCR object

1:39:09

classification and for that we have a

1:39:11

different model and definitely we can

1:39:13

use a transfer learning of finding over

1:39:15

there now uh by using this L llm um like

1:39:20

this llm is for the like a different

1:39:22

task it is related to the language

1:39:23

related task it is not related to that

1:39:27

detection or a segmentation or tracking

1:39:30

it is not related to that particular

1:39:31

task it is related to the language

1:39:34

related task and uh here see let me show

1:39:37

you one uh one more paper one more

1:39:39

research paper so here I can show you

1:39:42

this uh ULM fit now see uh so just try

1:39:46

to go through with this particular paper

1:39:48

universal language model find tuning for

1:39:51

text classification now here in this

1:39:54

particular paper you will find out that

1:39:56

see uh this uh if you know the Deep

1:39:59

learning so in the Deep learning we have

1:40:01

uh two major concept so the one one

1:40:04

concept is uh called transfer learning

1:40:07

transfer learning the second concept is

1:40:09

called fine tuning F transfer learning

1:40:11

means what so you are transferring the

1:40:14

information from uh from one state to

1:40:17

another state okay or like you can I can

1:40:21

give you very simple example for that

1:40:22

let's say you know like how to how to

1:40:25

write the cycle so for you like for if

1:40:29

you know how to write the cycle

1:40:31

definitely you can use that information

1:40:33

and you can write the motorcycle also so

1:40:36

that is the same thing basically which

1:40:37

we uh do inside the transfer learning

1:40:40

let's say we have trained the model uh

1:40:42

like let's say we are talking about the

1:40:44

computer vision so inside that uh you'll

1:40:47

find out uh we have a various Tas like

1:40:49

detection classification tracking and

1:40:51

all so let's talk about the model let's

1:40:53

say YOLO so or we have other model also

1:40:56

like faster rcnn rcnn and all SSD SSD

1:40:59

and all like a different different model

1:41:02

related to a detection so the model

1:41:03

already has been trained on some sort of

1:41:05

a data some amount of data on some

1:41:07

Benchmark data so by using that

1:41:09

particular information we can uh like

1:41:11

perform the detection and all for our

1:41:13

specific task if we are not able to do

1:41:15

it then definitely I will fine-tune my

1:41:17

model but how we can use the same thing

1:41:21

in NLP because in NLP actually we have a

1:41:25

task uh the task is very specified we

1:41:27

have a specific task let's say we are

1:41:29

talking about um if we are talking about

1:41:33

a task let's say uh ner name entity

1:41:36

recognization or let's say we are

1:41:38

talking about the task let's say a

1:41:40

language gener language translation

1:41:43

language

1:41:44

translation language translation or

1:41:46

maybe sentiment analysis so these are

1:41:48

the specific task specific task ask

1:41:51

means regarding to the specific uh

1:41:53

regarding to the specific topic let's

1:41:55

say if I want to do a sentiment analysis

1:41:57

so not for the entire data whatever

1:42:00

there in the world for the specific uh

1:42:02

let's it for the Twitter data only means

1:42:04

whatever TW tweets and all we are

1:42:06

getting now if we are giving any other

1:42:08

data un any other like a task related

1:42:11

data so it won't be able to perform that

1:42:13

so actually in this particular paper you

1:42:15

will find out that how we can use this

1:42:18

uh language model language model

1:42:21

for uh like for the universal task and

1:42:24

there only this llm comes into a picture

1:42:26

L this llm actually it came from the

1:42:28

language model itself okay because we

1:42:31

are training this uh language model on a

1:42:33

huge amount of data that is why it is

1:42:35

called llm large language model because

1:42:37

we have we have trained this data on a

1:42:39

huge amount of we have trained this

1:42:40

model on a huge amount of data got it so

1:42:43

here in this particular paper they have

1:42:45

like shown you that how to use this

1:42:48

transfer learning because uh in before

1:42:51

2018 uh actually we were using this

1:42:53

transfer learning in the computer vision

1:42:55

only in the uh like in a different

1:42:58

different tasks of the computer like

1:42:59

object detection or segmentation you

1:43:01

will find out the image data so on top

1:43:05

of that data we have trade like a Ben

1:43:06

model and directly like like vgg rset

1:43:10

and all and directly we are using those

1:43:11

particular model for our like a other

1:43:14

task so here if we are talking about the

1:43:16

NLP so we are not able to do it before

1:43:19

this Transformer and all so actually see

1:43:21

we got a Transformer we got this

1:43:23

particular concept like how we can use

1:43:25

this transfer learning and all in the

1:43:27

like NLP field so this two concept came

1:43:30

together transfer learning and the

1:43:32

architecture like Transformer self

1:43:34

attention and all and from there itself

1:43:36

this uh llm came into the picture llm

1:43:38

means large language model which has

1:43:40

been train on a huge amount of data

1:43:42

which is able to perform the transfer

1:43:43

learning and we can do it uh we can find

1:43:46

T it also and the main uh like uh

1:43:51

the main cap or the main uh role of the

1:43:54

llm is what it is able to generate a

1:43:56

text text generation got it so fine I

1:44:00

think we are done with the session now

1:44:02

so rest of the thing we'll try to

1:44:05

discuss in the uh tomorrow session and

1:44:07

we'll try to more focus on the Practical

1:44:08

side so all the recordings and all it

1:44:11

will be updated on a dashboard and uh

1:44:14

yeah that is it yes so I think uh we can

1:44:17

start with the session now so yeah uh

1:44:20

welcome again again uh so you all are

1:44:22

welcome in this uh Community session

1:44:24

generative AI Community session uh

1:44:26

yesterday we have started this uh

1:44:28

generative AI Community session where we

1:44:30

have discussed about the generative AI

1:44:32

so there I have given you the

1:44:34

introduction related to the generative

1:44:35

Ai and large language models and here

1:44:39

you can find out the video so this is

1:44:40

the dashboard uh it's a free dashboard

1:44:43

actually uh which we have created for

1:44:45

all of you the same video actually it is

1:44:47

available over the Inon uh YouTube

1:44:49

channel as well if you we will go in a

1:44:51

live section so this uh same video you

1:44:53

can find it out over there as well now

1:44:56

uh let me show you uh that particular

1:44:59

video so here is my YouTube now let me

1:45:03

search over here I neon and here guys uh

1:45:07

go inside this uh live section and this

1:45:10

is the video so the same video same

1:45:13

lecture you will be able to find out

1:45:15

inside the live section apart from this

1:45:17

uh the same uh thing basically we are

1:45:20

uploading or the in neuron dashboard and

1:45:23

here along with the video you will find

1:45:24

out the resources so all the resources

1:45:27

basically whatever I'm using throughout

1:45:29

the session uh so whatever notes and all

1:45:32

which I'm writing and whatever PPS and

1:45:34

all or whatever code file I'm using

1:45:37

throughout the session you will find out

1:45:39

all the resources over here got it guys

1:45:42

yes or no so do you have this dashboard

1:45:45

do you have this dashboard tell me I

1:45:48

think uh many people are androll

1:45:51

yesterday uh for this free community

1:45:53

session and yes all the videos and all

1:45:57

basically we are going to upload over

1:45:58

here not even video and resources along

1:46:01

with the video and resources you will

1:46:03

find out the uh live uh you will find

1:46:06

out the quizzes and assignment as well

1:46:07

so already uh I have prepared the

1:46:10

quizzes and assignment so soon it will

1:46:12

be uploaded over here so in this

1:46:14

particular video you will find out one

1:46:16

more section so the section will be

1:46:18

quizzes and assignment so there you will

1:46:20

find out a uh like uh a video related or

1:46:24

a topic related quizzes and assignment

1:46:27

got it yes or no so please uh give me a

1:46:30

quick confirmation in the chat if this

1:46:32

uh dashboard related thing and this uh

1:46:34

video related thing is clear to all of

1:46:36

you I'm waiting for your reply in the

1:46:38

chat and if you have any sort of a doubt

1:46:41

then you can ask me in the like chat

1:46:43

section as well and don't worry my team

1:46:45

will give you the link of the dashboard

1:46:47

so if you haven't enrolled so far so uh

1:46:50

by using that particular link definitely

1:46:52

you can enroll it you can enroll U

1:46:55

inside the

1:46:57

dashboard great all clear all clear

1:47:12

great fine so here I got a confirmation

1:47:16

now uh so let's start with the session

1:47:19

let's start with the uh second day so in

1:47:22

the first day actually so what I

1:47:24

discussed I discussed about the

1:47:25

generative AI so where I have like told

1:47:28

you that what is a generative AI so this

1:47:30

is the slide basically which I was using

1:47:32

and here actually this was the agenda

1:47:35

the complete agenda which I going to

1:47:37

discuss this uh throughout this

1:47:38

committee session and uh today is the

1:47:41

second day where I will start from this

1:47:43

open AI so in the previous session I was

1:47:46

talking about this generative Ai and I

1:47:48

discussed each and everything related to

1:47:49

this generative a and I hope you got a

1:47:52

clear-cut idea that what is a generative

1:47:54

Ai and in the generative AI actually

1:47:57

what all things comes into the picture

1:47:59

where llms lies so if we are talking

1:48:02

about this large language model so

1:48:04

regarding the large language model also

1:48:05

I have clarify each and everything I

1:48:07

have given you the complete timeline of

1:48:09

this large language model where I have

1:48:11

discussed about the uh the complete

1:48:14

history of the large language model from

1:48:16

the RNN so first I have started from the

1:48:18

RNN then I came to the lstm then uh I

1:48:22

discussed about the uh different

1:48:23

different sequence to sequence mapping I

1:48:26

talked about the encoder and decoder and

1:48:28

after that I have explained you the me

1:48:30

uh the concept of the attention and then

1:48:32

I have discussed about the attention is

1:48:35

all your need uh the Transformer

1:48:37

architecture and I told you that

1:48:40

whatever llms which you are seeing

1:48:42

nowadays so those uh all the llms are

1:48:45

using Transformer as a base architecture

1:48:48

so I have explained you the

1:48:51

the like whatever thing was there inside

1:48:53

the Transformer architecture whatever

1:48:55

component whatever segment was there

1:48:57

each and everything I have discussed

1:48:58

over there and apart from this

1:49:01

generative AI I have talked about this

1:49:03

llm also so there I have talked about

1:49:05

that what is a llm why it is called

1:49:08

large language model and uh why it is so

1:49:12

powerful because this one uh because

1:49:15

this one llm is able to perform lots of

1:49:18

like task lots of uh one basically llm

1:49:22

we can use for the different different

1:49:24

type of application so here uh I have

1:49:27

written the couple of name like text

1:49:29

generation summarizer translation or

1:49:31

code generation and so on we all know

1:49:33

about the chat GPT uh chat GPT is are

1:49:36

application and uh chat GPT is using

1:49:38

gpt3 gpt3 is a a base model so GPD 3.5

1:49:43

actually it's a base model so how it is

1:49:46

how much it is powerful we all know

1:49:48

about it and that is a example of the

1:49:50

large language model which is capable to

1:49:53

do so many things why because uh it is

1:49:55

having a power so so that actually it

1:49:58

can generate a it can generate a data

1:50:01

based on a previous data it can

1:50:03

understand the pattern and because of

1:50:05

that only we are able to trans we are

1:50:07

able to use this Transformer as a or

1:50:09

whatever like Transformer based model we

1:50:11

have we are able to use those transforma

1:50:14

based model as a transfer learning I

1:50:17

have explained you the concept of the

1:50:18

transfer learning and the fine tuning as

1:50:21

well so here I was talking about this

1:50:23

llm and then I talked about the few

1:50:26

milestone in a large language model so

1:50:29

here I have written couple of name bird

1:50:31

GPT xlm T5 Megatron M2M so these are the

1:50:35

uh like a few milestone in a large

1:50:37

language model now this model has been

1:50:40

trained on a huge amount of data now

1:50:43

specifically we are talking about GPT so

1:50:45

in a GPT Family itself you will find out

1:50:47

of various model I will talk about it it

1:50:50

I will come to the open Ai and each and

1:50:52

everything I will keep in front of you

1:50:54

only and uh I will uh I will show you

1:50:56

that how much it is powerful so we are

1:50:59

talking about GPT so it's like really

1:51:01

powerful and it it has been trained on a

1:51:04

like huge amount of data and it is

1:51:06

having a billions of parameter so here

1:51:08

is few Milestone so in our back days in

1:51:11

our history basically we are using this

1:51:13

particular models now in a recent day we

1:51:15

got so many uh architectures so many uh

1:51:18

open source models and so I will talk

1:51:20

about uh regarding those model as well

1:51:23

so here in the next slide I have shown

1:51:25

you so what all encoder based

1:51:27

architecture we have what all decoder

1:51:29

based architecture we have if we are

1:51:31

talking about anod and decoder right so

1:51:34

in which architecture you will find out

1:51:36

both encoder and decoder if we are

1:51:38

talking about B xlm Electra DTA so these

1:51:42

all are these all the architecture

1:51:44

actually it is based on an encoder we're

1:51:46

talking about this GPT GPT family so

1:51:49

it's a based on a decoder itself and the

1:51:51

idea has been taken from the Transformer

1:51:53

itself now here you can see this T5 Bart

1:51:56

M2M big but so these are the model which

1:51:59

are which is using this encoder and

1:52:02

decoder both got it so now here uh then

1:52:07

I talked about the openi based llm model

1:52:09

so here uh the very first thing comes

1:52:12

into the picture that is a GPD itself

1:52:14

GPT 3.5 which is a like base model

1:52:17

behind this chat GP chat GPT just a

1:52:20

application it's not a model now here

1:52:22

you will find out this Delhi whisper DCI

1:52:25

there are many model I will be coming to

1:52:27

that particular model and I will show

1:52:29

you how you can get all the model from

1:52:32

the opena itself and uh yes we'll try to

1:52:35

use those model for our task for our

1:52:39

like a uh for the for our like a like a

1:52:42

requirements and all definitely will try

1:52:44

to use this particular model like GPT

1:52:47

GPT 3.5 I will show you how you can use

1:52:49

GP 3.5 turbo viso da in or other model

1:52:53

as well like aming and moderation so

1:52:55

apart from that this apart from this uh

1:52:58

like uh Milestone whatever Milestone I

1:53:00

shown you and this openi based model

1:53:03

here you will find out some other op

1:53:05

Source model like Bloom llama 2 Palm is

1:53:08

a model it's a very famous model from

1:53:10

the Google side nowadays like most of

1:53:13

the people are using this pal Falcon is

1:53:14

a model cloud is there MP 30 uh MP is

1:53:19

there uh this B actually it is showing a

1:53:21

parameter right and here we have a

1:53:23

stable Im so a stable LM so there are

1:53:26

like so many open source model so I will

1:53:29

come to that also and I will show you

1:53:31

how you can utilize those particular

1:53:33

model and apart from that I have like

1:53:35

kept some more slight over here inside

1:53:38

this particular PP so you can go through

1:53:40

with that and you can understand some

1:53:42

other uh like concept like how this chat

1:53:44

GPD has been trained and all so I hope

1:53:47

guys still here everything is fine

1:53:49

everything is clear

1:53:50

now we can move to the Practical part so

1:53:53

please do let me know in the chat if

1:53:55

everything is clear so far in terms of

1:53:57

theory guys I'm waiting for your

1:54:06

reply uh just a wait so let me give you

1:54:08

the link of the website and

1:54:18

uh

1:54:20

yes guys I'm waiting for your reply so

1:54:22

if you can confirm in the chat uh uh

1:54:24

like everything is fine or not so that I

1:54:27

can proceed with the Practical

1:54:30

stuff yeah definitely this uh PP is

1:54:32

already there so just try to enroll in

1:54:34

this course the dashboard Bic basically

1:54:37

which we have created this is our

1:54:38

dashboard which you will find out over

1:54:40

the Inon website so just try to log to

1:54:43

your Inon website first of all if see if

1:54:45

you are a new person so what you need to

1:54:47

do you need to sign up after sign up uh

1:54:50

you will login and after login you will

1:54:53

search uh regarding this dashboard so

1:54:55

here actually what is the name of the

1:54:57

dashboard so the name of the dashboard

1:54:58

is generative AI Community Edition so

1:55:01

just click on this dashboard and here

1:55:04

after clicking on this dashboard you it

1:55:05

will ask to you whether you want to

1:55:07

enroll or not so yes uh you will click

1:55:10

on the enroll and it is completely free

1:55:12

so it won't ask you any sort of a money

1:55:15

and after enrolling into this particular

1:55:17

course uh you can get the videos and you

1:55:20

can get the resources as well so all the

1:55:22

resources we have uploaded over here

1:55:24

inside this resource section got it

1:55:32

clear great so I think everything is

1:55:35

fine everything is clear now let's start

1:55:38

with the uh let's start with the

1:55:40

Practical implementation so first of all

1:55:43

guys uh let me clarify the agenda that

1:55:45

what all thing we are going to discuss

1:55:47

in today's session so for that what I'm

1:55:50

going to do I'm going to open my

1:55:51

Blackboard and here I will try to

1:55:53

explain you each and everything uh like

1:55:56

what what whatsoever we are going to

1:55:58

like cover in this particular session so

1:56:01

let's start uh let me write it down all

1:56:03

the thing step by step now first of all

1:56:06

I can write it down over here a day two

1:56:08

Community session and then I will begin

1:56:12

with the topic so here guys are day two

1:56:15

of the community session now uh

1:56:18

yesterday actually I I talked about the

1:56:20

introduction part I talked about the

1:56:21

introduction of the generative Ai and

1:56:23

the llm now today I will be more

1:56:26

focusing on the open a so here I will be

1:56:29

discussing about the open AI so first I

1:56:32

will give you the U like a complete walk

1:56:35

through of the openai website of the

1:56:37

openai documentation after that I will

1:56:40

come to the openai API that how you can

1:56:43

use this open API how you can use this

1:56:46

open API and this API we are going to

1:56:49

use by using this python so guys if you

1:56:53

you know python so definitely uh like uh

1:56:56

you will be able to write a code along

1:56:58

with me uh and don't worry I will show

1:57:00

you how to do the entire environment

1:57:02

setup and all each and everything I will

1:57:04

try to uh I will try to do in front of

1:57:06

you uh from very scratch so uh you all

1:57:09

can do along with me now over here I

1:57:12

will come to this openi API and there

1:57:14

I'm going to use Python and we have

1:57:16

couple of more option like nodejs on all

1:57:19

so if you are familiar with the

1:57:21

JavaScript or maybe some with other

1:57:23

language so in that case also you can

1:57:25

use this openi API after that I will uh

1:57:29

I will come to the openi playground so

1:57:31

here uh they have given you very

1:57:33

specific feature or very uh like uh very

1:57:37

interesting feature that is what that is

1:57:38

a openi playground so over here I will

1:57:41

explain you that uh how you can use a

1:57:44

different different model how you can uh

1:57:46

like pass a different different prompts

1:57:49

and how you can generate output how you

1:57:51

can set up your uh like a different

1:57:53

different uh sentiments and all

1:57:54

regarding the system that okay so my

1:57:57

system should behave like this or that

1:57:59

so each and everything I will explain

1:58:01

you over here and after that what I will

1:58:03

do I will show you the chat completion

1:58:05

API so I will use this chat completion

1:58:09

chat completion and by using this chat

1:58:11

completion actually uh we can call the

1:58:14

GPT model so whatever uh like uh we can

1:58:18

call the like openi API and uh with that

1:58:21

definitely we can use any sort of a

1:58:23

model like a GPT model or any other

1:58:25

model so first I will uh start with the

1:58:28

openi API we'll use we'll be using a

1:58:30

python over here and I will show you how

1:58:32

you can generate the openi key and after

1:58:35

that I will come to the playground and

1:58:37

assistant and then chat completion API

1:58:39

and then I will explain you the concept

1:58:41

of the function call function call now

1:58:46

this is the agenda for today's session

1:58:48

this is the agenda for today's Community

1:58:50

class now before starting with the openi

1:58:53

I will uh I will explain you that why

1:58:56

openi is this much important why not

1:58:58

other other like things or uh if we have

1:59:02

like a other competitor of the openi

1:59:04

that why we are not using that instead

1:59:06

of this open ey and if we are going to

1:59:08

use that then how we can do that okay

1:59:11

and one more thing I would like to

1:59:12

explain you over here so along with the

1:59:14

open a I will uh talk about the hugging

1:59:17

face so see over the hugging face

1:59:20

actually hugging face is has provided

1:59:22

you one uh hugging face hub for all the

1:59:25

models so there you will find out all

1:59:28

the open source model so directly you

1:59:30

can generate a hugging face API key and

1:59:32

you can utilize all sort of a model

1:59:34

whatever is there over the hugging face

1:59:36

Hub yesterday I have shown you that let

1:59:38

me show you again uh that particular Hub

1:59:41

so guys here once you will write it down

1:59:42

so over the Google so once you will

1:59:45

search uh once you will write it down

1:59:46

hugging face model Hub so there uh you

1:59:49

will get a link and you just need to

1:59:51

click on that so here you will uh and

1:59:53

then basically it will be redirecting to

1:59:55

you to this particular model Hub now

1:59:58

here you will find out all the open

2:00:00

source model from a different different

2:00:02

organization so yesterday I was talking

2:00:04

about this Ora 2 now here you will find

2:00:07

out other model as well like whisper

2:00:09

large V3 now from the Facebook side

2:00:12

there's a

2:00:13

seamless okay now here you will find out

2:00:16

other model as well so see from The Meta

2:00:18

side there's a lamba Lama 2 so I will

2:00:20

show you how you can utilize these

2:00:22

particular model for the different

2:00:24

different tasks according to your

2:00:26

requirement getting my point so we will

2:00:29

not restrict it uh we will not restrict

2:00:32

to ourself to the till the open ey

2:00:34

itself apart from that we'll try to

2:00:36

explore few other model few other open

2:00:38

source model and yesterday actually I

2:00:41

have shown you one more platform and

2:00:43

here's the platform AI 21 studio so it

2:00:46

it gives you one model this Jurassic

2:00:48

model so we can utilize that particular

2:00:51

model also and this all are called large

2:00:54

language

2:00:55

model this IDE this thing is clear to

2:00:57

all of you yes or no so uh what is the

2:01:00

difference between hugging face and open

2:01:02

AI so open AI is a different

2:01:04

organization hugging face is a different

2:01:05

organization and over the hugging face

2:01:07

Hub see uh if you have heard about this

2:01:10

Docker or this GitHub so first of all

2:01:12

let me show you this GitHub so if I'm

2:01:14

searching about this GitHub so here

2:01:16

actually over the GitHub you will find

2:01:18

out uh like see this is my GitHub and uh

2:01:22

you all have the GitHub ID right you all

2:01:25

have log to the GitHub and all and first

2:01:27

you sign up and then you log in and

2:01:28

whatever course and all you are having

2:01:30

and definitely you are going to upload

2:01:32

it over here uh in terms of repository

2:01:35

now let's see if I if I have to find out

2:01:36

something so what I will do here let's

2:01:38

say if I'm going to write it down GitHub

2:01:40

machine learning uh linear regression so

2:01:43

GitHub machine

2:01:46

learning machine learning linear

2:01:50

regression so here if I will search uh

2:01:53

like this then definitely I will get a

2:01:55

link and here you can see so it has

2:01:57

suggested me one repository and you will

2:02:00

find out uh this uh code and all

2:02:02

whatever code and all has been uh

2:02:04

uploaded by this particular person and

2:02:07

definitely you can download it and you

2:02:08

can use it similarly we have a Docker

2:02:10

Hub similarly we have a Docker Hub so

2:02:13

let me show you the docker Hub so the

2:02:15

docker Hub actually you will find out

2:02:17

all the images and all so let's say uh

2:02:19

like uh you downloaded Docker in your

2:02:21

system you did setup and all now uh you

2:02:24

don't want to install it from scratch

2:02:26

you want to run it by a Docker so yes

2:02:28

there is a Docker Hub and there you'll

2:02:30

find out different different images and

2:02:31

all so you can uh like uh you can pull

2:02:34

that image and definitely you can run it

2:02:36

inside your container so similarly we

2:02:38

have a hugging face Hub there uh like it

2:02:41

is uh it it is going to provide you a

2:02:43

different different model actually on a

2:02:45

single place so yes uh just uh you just

2:02:47

need to log in over there and after that

2:02:49

you need to generate a API key and

2:02:51

directly you can use those particular

2:02:54

model whatever is there like over the

2:02:56

hugging face Hub now similarly we have

2:02:59

openi it's other another organization so

2:03:01

yes by using the openi API we can access

2:03:04

the open a model as well so here uh okay

2:03:07

so if you will find out if you will see

2:03:09

to this open a this one this is the open

2:03:11

a right now I will show you what all

2:03:13

models this openi is having it is having

2:03:15

a different different model various

2:03:16

model I will come to that I will show

2:03:18

you from very scatch so till here

2:03:20

everything is fine guys everything is

2:03:22

clear so uh just give me a quick quick

2:03:25

confirmation so that I can show you the

2:03:27

entire setup related to this opena API

2:03:30

and we can run a couple of uh couple

2:03:33

couple of line of code as well so please

2:03:35

do let me know in the chat if uh

2:03:37

everything is clear so

2:03:44

far yes we'll talk about the fine tuning

2:03:47

and all so how we can uh do the fine

2:03:49

tuning regarding a different different

2:03:51

model uh it's not a like easy task it's

2:03:54

a a very expensive thing so we'll talk

2:03:58

about

2:03:59

it yes hugging pH model are

2:04:07

free yes correct for building a model uh

2:04:10

so for using uh if you want to use that

2:04:12

particular model so either I can use

2:04:14

open a so or else I can use hugging

2:04:16

phase see whatever model is there over

2:04:17

the hugging for definitely we can access

2:04:19

that but let's say open a is having

2:04:21

there uh like a uh it's a separate

2:04:23

platform right so whatever model is

2:04:25

there over the open a so we'll be able

2:04:26

to access those model only from the open

2:04:28

a not all the model which is there

2:04:30

inside the hugging face also but hugging

2:04:32

face actually is having all the models

2:04:35

open source and all whatever model is

2:04:36

there and some of the model from the

2:04:37

openi side as well but openi actually

2:04:40

it's a specific specific one specific

2:04:43

organization clear yes or no so please

2:04:46

do let me know if uh this thing is clear

2:04:48

to to all of you so that I can proceed

2:04:50

with the uh next part next

2:04:58

section great so people are saying sir

2:05:01

it is clear clear clear okay

2:05:10

great yeah the model is already created

2:05:12

over the hugging face and open ey they

2:05:14

already trained the

2:05:17

model

2:05:22

we don't have all the models in the ging

2:05:24

phase that's why we are learning this

2:05:31

open great so I think uh all the thing

2:05:35

uh like each and everything is clear to

2:05:37

all of you now let's start with the uh

2:05:39

like uh next part of this session so

2:05:42

here I have uh discussed about this open

2:05:44

Ai and this hugging phase and I clarify

2:05:46

the agenda that what all think we are

2:05:49

going to discuss but before starting

2:05:51

with the open AI so let me give you the

2:05:53

a brief introduction of the open AI that

2:05:56

why this open AI is too much important

2:05:58

so for that what I did I have created

2:06:00

one small PP so with that actually you

2:06:02

will get some U uh some basic idea uh

2:06:07

regarding this open AI so here uh let me

2:06:10

start uh let me start the slideshow so

2:06:13

over here guys you can see about the

2:06:14

open if we are talking about the openi

2:06:16

so what is the openi open a is leading

2:06:19

company in the field of AI it was

2:06:21

founded in 2015 as a nonprofit

2:06:24

organization by same Alman and Elon Musk

2:06:27

as we know about the uh founder of the

2:06:30

like open a so yes uh I think we are we

2:06:33

are aware about uh with this particular

2:06:35

names right same Alman and this Elon

2:06:37

Musk and it has founded in 2015 as a

2:06:41

nonprofit organization just for the

2:06:43

research purpose now here in the next

2:06:46

slide I have kept the name so he's a

2:06:48

like

2:06:49

he's a CEO of the open a Sam Alman and

2:06:54

uh yes I think you know about the Sam

2:06:56

Alman he was fired by the open board

2:06:58

we'll talk about that also what what

2:07:00

might be the reason behind that so we

2:07:03

will discuss about that uh as well now

2:07:06

over here you can see uh openi founded

2:07:08

in uh 2015 and the company founded with

2:07:11

the goal of developing and promoting

2:07:13

friendly AI in a responsible way that

2:07:16

was a logo of the open AI so with the

2:07:18

focus on transparency and open research

2:07:21

and he was the and they are the founder

2:07:23

member of the like open a so Elon mus

2:07:27

Sam Alman Greg Brockman okay this guy is

2:07:30

a like great researcher and vak and zon

2:07:34

so these are the founder founding member

2:07:36

of the open AI now over here are open

2:07:39

goals so there are some goals of the

2:07:40

open related to the AI and all now openi

2:07:43

Milestone so I was talking about that

2:07:45

why this openi is too much important why

2:07:48

not other does because if you will look

2:07:49

into the market there are other uh there

2:07:52

uh there are you will find out other

2:07:54

organization as well uh so we have a

2:07:57

Google and Google is having their

2:07:58

separate Department Google uh AI

2:08:01

research and all so Microsoft is also

2:08:03

having their own department for the AI

2:08:05

research even meta is having that even

2:08:08

IVM so all the like big big giant so

2:08:12

there they are having their own research

2:08:14

uh like Department related to this Ai

2:08:16

and all and they are working on that and

2:08:18

they were working on that actually but

2:08:21

why this openi is too much popular and

2:08:23

why we should start from the openi

2:08:25

itself so you know about the openi in

2:08:27

2020 actually they have launched the

2:08:30

Chad GPT and guys believe me it was the

2:08:33

Milestone and it was the major

2:08:35

breakthrough in the history of the AI

2:08:37

because before that also we are having

2:08:40

so many llm model and it was able to do

2:08:43

uh some sort of a thing but not like to

2:08:46

not similar like to this GPT this GPT

2:08:50

actually the GPT model which is a

2:08:52

backbone of this Chad GPT application uh

2:08:55

it was a a breakthrough in the history

2:08:57

of the NLP and because of this this open

2:09:00

AI came into the Limelight and uh apart

2:09:03

from the GPT then uh uh like they have

2:09:06

shown or they have released the other

2:09:08

different different research so here

2:09:10

here I have written couple of name

2:09:12

basically so generative model is one of

2:09:15

the Milestone of the open now apart from

2:09:18

that you will see that they are going to

2:09:20

uh they are going to participate in the

2:09:21

robotic research and all and here uh

2:09:24

like other uh like other few more thing

2:09:27

basically so solving uh robic Q with a

2:09:30

robot hand and here multimodel neurons

2:09:33

and artificial neural network you can

2:09:35

search about uh this particular things

2:09:37

and yes uh this open ey actually it

2:09:40

become uh very uh important uh basically

2:09:44

because of this uh like GPT and all

2:09:46

because of this uh chat GPT application

2:09:49

and yes they were using a different

2:09:51

technique for training this uh GPD model

2:09:54

which we are using for the chat GPT and

2:09:57

the idea from where they took the idea

2:09:59

uh for training this GPT model there we

2:10:02

have unsupervised learning we have a

2:10:03

supervised learning and we have this

2:10:05

reinforcement learning so they took from

2:10:08

the ULM fit research paper yesterday I

2:10:10

have shown you that which has been

2:10:11

published in 2018 and in 2019 in 2020

2:10:15

actually they have released this GPT GPT

2:10:19

got it now here you can see buildin with

2:10:22

open AI API so these are couple of name

2:10:24

getup copilot keeper Tex Bible dingo so

2:10:28

these are some application which is

2:10:29

using this openi API and apart from that

2:10:32

you will find out so what is the openi

2:10:34

vision so the vision is like uh promote

2:10:37

a friendly AI in a way that benefit all

2:10:40

the humanity and all so this is a vision

2:10:42

of the openi now feature so chat GPT

2:10:46

Delhi whisper alignment so so these are

2:10:48

the feature of the open AI Chad GPT is a

2:10:52

a milestone Delhi is also there Delhi 2

2:10:54

recently they have they have released

2:10:55

the Delhi 2 whisper is uh one of them

2:10:58

whisper actually it is a very good model

2:11:00

for generating a transcript and all so

2:11:02

whatever like text we are giving or

2:11:04

whatever like videos we are giving to

2:11:05

this particular model it is able to

2:11:07

generate a transcript from that and here

2:11:10

uh alignment is there startup fund so

2:11:12

these are some feature of the open AI

2:11:14

now guys uh before starting with the

2:11:16

open AI API I think got enough amount of

2:11:19

idea uh regarding this open AI yes or no

2:11:23

please do let me know in the chat if uh

2:11:25

this part is clear so I will proceed

2:11:27

with a uh open a API so how you can

2:11:31

generate a key and all and how you can

2:11:33

utilize

2:11:37

that

2:11:40

yes are you getting guys whatever I'm

2:11:43

explaining you over here uh if you have

2:11:46

any sort of a doubt anything so you you

2:11:48

can ask me in a chat section I will

2:11:50

reply to all of your

2:11:52

doubts so step by step we'll try to

2:11:54

proceed uh and uh so each and everything

2:11:57

will be

2:12:00

clarified great so

2:12:04

clear yes waiting for your reply uh if

2:12:07

you can write it on the chat so then I

2:12:10

will

2:12:16

proceed what is the learn tool what is

2:12:18

the aim to learn open AI so that I can

2:12:20

utilize the same capability same AI

2:12:22

capability in my

2:12:24

application whatever model has been

2:12:26

trained by the openi so that I can use

2:12:28

the same model in my application for a

2:12:30

different different

2:12:41

task great so I think I have uh

2:12:45

discussed each and everything related to

2:12:46

the open a now this is the website of

2:12:48

the openai so if you will search openai

2:12:51

definitely you will get a website of

2:12:52

that so in the website itself they have

2:12:54

mentioned everything so latest update

2:12:57

whatever uh latest update and all it is

2:12:59

there so they are mentioning over here

2:13:01

and Sam Alman return as a CEO of the

2:13:04

open a I think you know about this

2:13:06

controversy of the open a so let me uh

2:13:09

give you some sort of a glimpse of that

2:13:11

uh if you know about the open a so it

2:13:13

was founded as a nonprofit

2:13:16

organization but uh in 2019 actually

2:13:19

they have uh started with their uh

2:13:22

for-profit organization as well if you

2:13:24

will search about the four profit

2:13:26

organization

2:13:27

of for profit organization of this open

2:13:30

a so in 2019 actually they have started

2:13:33

this a for profit organization and uh it

2:13:36

was doing uh lots of work uh regarding

2:13:38

this Ai and all and they collected uh

2:13:40

like uh funds from different different

2:13:43

companies and all from a big big giants

2:13:45

and uh they were working on the G GPD

2:13:48

model itself okay now after that uh this

2:13:51

chat GPD has been released and in 2022

2:13:55

actually 2022 or 23 basically so uh they

2:13:59

started work on a uh like a different

2:14:01

type of project so the project name was

2:14:03

the

2:14:04

qar the uh basically the project name

2:14:07

was the qar and it was more specific to

2:14:11

it was more specific to towards this AGI

2:14:14

so may I know guys what is the full form

2:14:16

of the AGI

2:14:19

if if you know uh the full form of the

2:14:20

AGI so please write it down in the chat

2:14:22

what what do you uh understand with this

2:14:27

AGI so the full form of the AGI is

2:14:31

please write it down in the chat if you

2:14:32

know about the full form of the AGI

2:14:34

please do it yes artificial Journal

2:14:38

intelligence correct so the full form of

2:14:40

the AGI is artificial Journal

2:14:42

intelligence actually see we talking

2:14:44

about the chat GPD now this particular

2:14:46

application it's not it is not

2:14:48

representing a general artificial

2:14:51

intelligence it is a restricted one it's

2:14:53

a specific

2:14:55

one getting my point so let's say there

2:14:58

one side there is a Chad GPT and one

2:14:59

side there is a human so definitely this

2:15:02

Chad GPD can answer in a better way it

2:15:05

can generate answer in a better way

2:15:07

compared to this human but still it is

2:15:09

not like a human so still we are not on

2:15:12

that particular level where we can

2:15:14

achieve a artificial intelligence like a

2:15:17

human that is called artificial general

2:15:21

intelligence and the project name was

2:15:23

given by this openi the project name was

2:15:26

the

2:15:26

qar and that was happening in the

2:15:29

for-profit organization this is the

2:15:31

subsidiary of the open

2:15:33

itself getting my point now because of

2:15:36

that uh so there was a conflict in

2:15:38

between the board member and uh this uh

2:15:41

Sam Alman was fired and now again he

2:15:45

joined the company uh there is a long

2:15:47

story story but yeah I have given you

2:15:48

the Glimpse you can search over the

2:15:50

internet and you can uh read about it U

2:15:53

okay so if you like to read the AI news

2:15:56

and all AI related news news and all so

2:15:59

definitely uh you should check it on a

2:16:01

daily basis because on a daily basis

2:16:04

there's something is happening on a teex

2:16:06

side on a like organization side uh

2:16:09

whatsoever so over here guys uh here you

2:16:12

can see the open a website now if I will

2:16:15

scroll down so you will find out each

2:16:17

and everything over here itself that

2:16:19

what all research is there uh what all

2:16:21

upcoming models is there uh on whatever

2:16:24

applications they are working so each

2:16:25

and everything actually you will find

2:16:27

out over here itself so here uh recently

2:16:29

they have released this Delhi 3 so in

2:16:32

October uh 20123 3rd of October 2023

2:16:36

they have released this Delhi 3 there

2:16:38

was a GPD 4 gp4 Vision where we can uh

2:16:42

upload the images and we can do a lots

2:16:45

of lots of task related to the images

2:16:47

and all

2:16:48

getting my point so here you will find

2:16:50

out a research whatever latest research

2:16:52

is there from the open a side no need to

2:16:54

go anywhere everything you will find out

2:16:56

over here itself if you want to start

2:16:57

from the open a if you are using this

2:16:59

open a in your organization if you want

2:17:02

to use it and before that if you want to

2:17:05

explore it so please go through the

2:17:07

website and here you will find out each

2:17:09

and everything now guys here is a

2:17:11

question I told you that why uh what is

2:17:14

the open a now why we are learning it I

2:17:17

have to give you the specific answer of

2:17:19

this particular question if you will ask

2:17:21

me S why we are learning this open a

2:17:23

what is the main Aim so now let me tell

2:17:26

you that so first of all guys after

2:17:28

opening this opena website what you need

2:17:30

to do you need to log in it you need to

2:17:32

log to this particular website and here

2:17:34

you will get two option so the first

2:17:36

option is a chat GPD and the second

2:17:38

option is a API so we all know about

2:17:41

this chat

2:17:41

GPT I think uh we all have used this

2:17:44

chat GPT and I think we are using it on

2:17:46

a daily basis now we are not going with

2:17:49

this chat GPT we are going with this API

2:17:51

so I will click on this API option and

2:17:53

once I will click on this API option so

2:17:55

I will get this type of interface so I

2:17:58

believe guys you all are getting this

2:18:00

particular interface after clicking on

2:18:02

this API please do let me know in the

2:18:04

chat if uh everything is uh uh like

2:18:07

going fine uh like me so please do let

2:18:10

me know in the

2:18:16

chat

2:18:24

great so yes I think uh people are doing

2:18:28

along with me now see guys here is what

2:18:31

so here is a uh like open a API uh so

2:18:34

once you will click on that you will get

2:18:36

this particular interface now just uh

2:18:38

overover your mouse left hand side and

2:18:40

here you will get a different different

2:18:41

option or various option now what you

2:18:43

need to do guys for here first of all

2:18:45

you need to click on this documentation

2:18:47

so just click on this documentation and

2:18:49

you will come to this particular page

2:18:51

now here you will find out this overview

2:18:53

so here they have given you the complete

2:18:54

overview about the openi API that what

2:18:58

all things they have and uh for what all

2:19:01

applications we can use this openi API

2:19:03

now here you will find out the

2:19:04

introduction section as well so in the

2:19:06

introduction section they have defined

2:19:08

some sort of a thing related to a

2:19:10

different different task like text

2:19:11

generation aming assistant tokens and

2:19:14

all now here you will find out the quick

2:19:16

start so let's say uh you want to

2:19:18

explore this open API so what you will

2:19:20

do at the first place so after opening

2:19:22

this open uh a openi API and after

2:19:26

opening this after opening this

2:19:27

particular documentation you just need

2:19:29

to click on this quick start so after

2:19:31

clicking on this quick start you will

2:19:32

get all the code which initially you

2:19:35

need to run inside your system getting

2:19:39

my point if you want to use this open

2:19:40

API if you want to use this openi API

2:19:44

and you want to run the code if you want

2:19:47

to start then for that what you need to

2:19:49

do you just need to click on this quick

2:19:51

start and over here you will find out uh

2:19:53

different different option so let's say

2:19:55

you know the nodejs so here you can

2:19:57

click on this nodejs and you will find

2:19:59

out entire setup related to this nodejs

2:20:03

how to install the package how to uh set

2:20:05

the key and all now here you'll find out

2:20:08

the different different uh like Windows

2:20:10

different different operating system

2:20:11

related option and here you will find

2:20:13

out the code snippet so directly you can

2:20:15

run it and you can use it now if you are

2:20:18

a python lover if you know the python

2:20:21

only in that case yes they have given

2:20:23

you the option so you just need to click

2:20:25

on this uh Python and here you will find

2:20:27

out the complete setup guide so how to

2:20:30

install a python how to install how to

2:20:32

create a virtual environment how to

2:20:34

install this openi Library so and after

2:20:37

that you will find out this uh setup

2:20:39

openi key uh regarding this Mac OS and

2:20:42

windows now here you'll find out how to

2:20:46

uh request to your openi uh API how to

2:20:49

request to the different different

2:20:51

models so here is a code snippet so we

2:20:53

are going to use this particular process

2:20:56

uh if uh so yes you can use the same

2:20:59

process don't worry I will show you how

2:21:01

you can do the entire setup and all and

2:21:02

how you can call the different different

2:21:04

model now over here you will find out a

2:21:06

model now guys this model actually this

2:21:08

model is a uh like a very important part

2:21:11

of the openi API now here they have

2:21:13

given you the various model like GPD 4

2:21:15

gp4 Turbo G PD 3.5 Delhi is there TTS is

2:21:20

there whisper is there iding moderation

2:21:23

GPD 5 is there GPD 3 which is a legacy

2:21:26

now and here you will find out some

2:21:28

deprecated model so here they have given

2:21:31

you some a deprecated model like uh GP

2:21:33

3.5 Turbo with this much of tokens and

2:21:37

here you will find out this text Ada Ada

2:21:40

text weage text cury text DaVinci so

2:21:43

these are the depricated model you can

2:21:45

use it if it is required definitely you

2:21:47

can use it so here you will get a

2:21:50

complete list of the model whatever

2:21:52

model you want to use for your task for

2:21:56

your particular task now over here uh

2:21:59

this is the uh like overview regarding

2:22:01

the model now if I'm clicking on this

2:22:03

GPD 3.5 so once I will click on this GPD

2:22:06

3.5 so here I will get a complete detail

2:22:09

regarding this particular model now here

2:22:12

is a what here is a model name so what

2:22:14

is the name of the model GPT 3.5 turbo

2:22:19

1106 okay now over here you will find

2:22:22

out two things so the first is what

2:22:24

context window now in the context window

2:22:26

you will find out the number of tokens

2:22:28

now guys this tokens actually the number

2:22:30

of tokens displays a very very important

2:22:33

role if we are talking about this tokens

2:22:35

so really it plays a very very important

2:22:37

role and I told you if we are giving an

2:22:39

input to our model to our LM model so

2:22:42

we'll give in the form of prompts and

2:22:44

prompt is nothing it's a collection of

2:22:46

token so whatever input and output we

2:22:48

are getting we are getting in the form

2:22:50

of prompts right so we are giving a

2:22:52

prompts to our model and we are getting

2:22:54

a prompts from our model and this prompt

2:22:56

is nothing it's a collection of tokens

2:23:00

now we'll talk about this tokens and all

2:23:02

then how much token is uh so as a return

2:23:05

actually how much token you can get as a

2:23:08

output as a free one actually this uh

2:23:10

Chad this open a actually it stopped the

2:23:13

free services now so before actually uh

2:23:16

uh you would be getting this uh let me

2:23:19

write it down over here so $20 of credit

2:23:22

so earlier if you have used this uh open

2:23:25

a so you must have seen that uh if you

2:23:28

are uh like uh if you are going to

2:23:30

create a open API key so in that case it

2:23:33

was giving you this $20 free credit now

2:23:36

they have stopped this particular

2:23:37

service now they are not giving to you

2:23:39

so first of all what you will have to do

2:23:42

so first of all you will have to add the

2:23:44

method a payment method actually so so

2:23:47

you will have to add your credit card or

2:23:49

debit card details and after that you

2:23:52

will have to set your limit let's say

2:23:54

$20 $50 $100 or whatever uh like limit

2:23:58

um actually you find out it is fine so

2:24:01

inside uh in that basically in that

2:24:03

particular limit uh my work will be done

2:24:05

so first of all uh you need to add the

2:24:06

payment method and you need to set the

2:24:08

limit and then only you can use this

2:24:10

open API so recently they have updated

2:24:12

this particular thing now we have

2:24:14

alternative also so we have this AI 21

2:24:17

lab so I will uh show you this uh thing

2:24:20

as well where we have a Jurassic model

2:24:22

and it gives you the $90 fre free credit

2:24:25

$90 free credit but you won't be able to

2:24:27

use this GPD 3.5 because it is only it

2:24:30

is only available in this opena itself

2:24:32

if you want to use this GPD 3.5 model

2:24:35

GPD 3.5 turbo or gbd4 so it is only

2:24:38

available in the opena itself and they

2:24:40

haven't open source it and for this one

2:24:42

you will have to pay if you want to use

2:24:45

it in your organization in uh with

2:24:47

respect to your task so definitely you

2:24:49

will have to pay for that getting my

2:24:52

point now over here guys see uh it

2:24:55

return return a maximum of 4096 output

2:24:58

token so regarding this particular model

2:25:01

now here you can provide this much of

2:25:03

tokens actually so this much of tokens

2:25:05

as a uh input as a input basically and

2:25:08

you will get this much of token as a

2:25:09

output if you are going to use this

2:25:10

particular model now here GPD 3.5 turbo

2:25:14

So currently point to GPD 3.5 turbo 0

2:25:16

613 will Point GPD format turbo 11

2:25:19

starting date this is this is the

2:25:20

starting date and here this is the token

2:25:23

size now here this is the token size

2:25:25

basically they have given to you so you

2:25:27

can uh provide this much of token and

2:25:29

here you will be getting output in uh

2:25:32

like as uh this is the maximum token

2:25:34

size actually uh with respect to this

2:25:36

particular model so you can go and read

2:25:38

more about this model and all and here

2:25:41

you will find out this training data so

2:25:43

this uh model has been trained up to

2:25:45

2021 SE number 2021 and here uh these

2:25:49

all are the model so I will uh use any

2:25:52

sort of a model from here itself and I

2:25:54

will show you how you can hit it by

2:25:56

using this P openi python API now apart

2:26:00

from that uh you will find out some

2:26:02

other uh thing so let's say if I want to

2:26:04

do a text generation so they have given

2:26:06

you the complete detail regarding that

2:26:08

and here they have given you the API

2:26:09

endpoint as well so you can click on

2:26:11

that and here in this particular way

2:26:13

actually you need to write a prompt and

2:26:17

all you need to define a prompts and all

2:26:19

uh so actually this is the uh rate

2:26:21

assistant uh as of now it is not working

2:26:23

so you can click on that or you can use

2:26:25

it this API endpoint inside your

2:26:27

application so uh here they have given

2:26:29

you the code that if you want to perform

2:26:31

this particular task this text

2:26:33

generation task so directly use this Uhn

2:26:36

code snippet after setting up the

2:26:38

environment and all after generating the

2:26:40

openi key and you can perform this text

2:26:43

generation over uh text generation if uh

2:26:45

this is required according to your uh

2:26:48

like application and all now over here

2:26:50

you will find out the other option so

2:26:53

embedding is there so embedding is

2:26:55

nothing uh embedding actually you are

2:26:57

just going to be uh convert your text

2:27:00

into a uh some numeric uh numbers and

2:27:03

here uh this ambing comes into a picture

2:27:05

and this this is very robust model from

2:27:07

the openi side and definitely you should

2:27:10

use it uh I will show you how you can

2:27:12

utilize this particular model and you

2:27:13

find you will find out the complete code

2:27:15

in s it and all and yes you can generate

2:27:18

a Ming regarding your test Ming is

2:27:20

nothing it's just a numeric

2:27:22

representation of your text now here uh

2:27:26

if you want to do a fine tuning so

2:27:27

regarding that also you will find out a

2:27:29

complete detail so how you can do a fine

2:27:31

tuning and all now image generation is

2:27:33

also there so if you want to do a image

2:27:35

generation so which model you should use

2:27:37

from here Vision related to The Vision

2:27:39

also there is a GPT 4 now Vision related

2:27:42

facilities it is there inside the gbd4

2:27:44

itself text to speech speech to text

2:27:46

moderation so no need to train your uh

2:27:49

no need to train your model your uh NLP

2:27:53

model from scratch now so they are

2:27:55

giving you everything you just need to

2:27:56

call the API and you can utilize it now

2:27:59

many people are asking to me that sir

2:28:00

what is the aim to learn behind this

2:28:03

open ey and all so the aim is very very

2:28:05

simple if you want to use this

2:28:07

particular model for your uh uh

2:28:09

different different task the task

2:28:11

basically which they have mentioned over

2:28:12

here you can directly use it you no need

2:28:15

to like train it by your yourself

2:28:17

because this model has been trained on a

2:28:19

huge amount of data now that's why it is

2:28:20

called llm I told you clearly right

2:28:23

yesterday what is the meaning of the llm

2:28:25

and yes uh in most of the cases in 99%

2:28:27

of the cases it will work fine if let's

2:28:29

say if you want to do a fine tune this

2:28:31

particular model so definitely you

2:28:33

required a higher resources and in that

2:28:35

case you will have to pay to the openi

2:28:37

as well getting my point so here you can

2:28:41

read uh entire detail regarding this

2:28:43

fine tuning and all so once I will come

2:28:44

to this fine tuning part I will explain

2:28:46

you this uh thing as well how to do the

2:28:49

fine tuning and all regarding this model

2:28:51

definitely I'm not going to do it uh in

2:28:53

the live class but yeah I will give you

2:28:55

the uh quick guidance regarding uh this

2:28:57

fine tuning so I hope guys uh this model

2:29:02

related thing model related part and

2:29:04

this quick start and this introduction

2:29:06

and what of capabilities is there so

2:29:10

this thing is clear to all of you if it

2:29:12

is clear then please do let me know in

2:29:13

the

2:29:15

chat yes or no so waiting for your reply

2:29:19

please do let me know in the

2:29:22

chat what what are the job opportunity

2:29:25

after this particular course so after

2:29:27

that you can apply as a NLP engineer uh

2:29:30

you can work on a gentic way related

2:29:31

project you can work uh as a uh gen VA

2:29:35

engineer so if you are going to complete

2:29:37

this particular course so after that you

2:29:40

can join uh the company uh like whatever

2:29:43

designation I told you on that

2:29:45

particular designation

2:29:47

and uh here in an interview do they ask

2:29:49

from the scratch inside of using API no

2:29:51

they won't ask you that you need to like

2:29:54

uh you just show them like how to use

2:29:56

the API and all no they won't ask you

2:29:58

this particular thing uh they you just

2:30:00

need to tell you what was your use case

2:30:02

which model you have used and uh what

2:30:04

was the cost regarding behind that

2:30:06

particular model uh how you you have

2:30:09

designed your prompt template how many

2:30:11

tokens basically there uh you were uh

2:30:13

defining inside your prompt in U

2:30:15

basically inside the input input prompt

2:30:17

and how much tokens basically you are

2:30:19

getting inside the output

2:30:21

prompt okay so these are the thing uh

2:30:24

like uh they might they might ask you

2:30:26

regarding this uh uh like openi API and

2:30:29

all and open AI models uh they won't ask

2:30:32

you that uh generate this key that key

2:30:34

or

2:30:36

whatever do we need to learn all the

2:30:39

underlined math behind the model hugging

2:30:41

pH and open ey yes the architecture

2:30:43

should be clear so the architecture part

2:30:45

should be clear uh architecture means

2:30:48

what so uh the base architecture

2:30:50

Transformer architecture they definitely

2:30:53

they might ask you the or Transformer

2:30:55

architecture in one of the interview

2:30:56

they they have asked to me that uh can

2:30:59

you uh explain me the Transformer

2:31:01

architecture what is the meaning of the

2:31:02

positional uncoding why we are using a

2:31:04

skip connection over there and can you

2:31:06

code it as well so if you want to use

2:31:08

this Transformer in the python how you

2:31:10

can do that which uh like which Library

2:31:13

you will call or can you write it down

2:31:14

the code from scratch so this type of

2:31:16

question you might face if they are

2:31:18

going on a architecture level they won't

2:31:21

ask you the uh they won't ask you the

2:31:23

architecture of the different different

2:31:25

model which is there over the hugging

2:31:26

face and all no they won't ask you

2:31:30

that so can we proceed now if uh this

2:31:33

part is clear tell me guys fast yes or

2:31:37

no I given you the complete walk through

2:31:40

of the open uh website openai API now I

2:31:45

will show you how you can utilize it and

2:31:47

don't worry guys I will uh show you the

2:31:50

advanced thing as well I will show you

2:31:51

the advanced part as well uh I will show

2:31:54

you this function uh calling and all and

2:31:57

uh first let me complete this uh uh chat

2:32:00

completion and after that I will come to

2:32:02

the function

2:32:06

calling great so here uh I think this

2:32:09

thing is clear now let's try to start

2:32:12

with the Practical implementation so for

2:32:14

the Practical implementation first of

2:32:16

all uh what you need to do so let me uh

2:32:19

write it down the step all the step so

2:32:22

here uh the first thing what you need to

2:32:24

do see uh you should have uh you should

2:32:27

have this uh Anaconda inside your system

2:32:30

I think you know about this Anaconda

2:32:32

what is this Anaconda it's a package uh

2:32:34

it's a package manager for the data

2:32:36

science projects and all so you should

2:32:38

have this uh Anaconda inside your system

2:32:40

the second thing uh python must be

2:32:44

installed python must be installed all

2:32:47

now here whatever practical which I'm

2:32:49

going to do so I'm going to do by using

2:32:51

the Jupiter notebook so here let me

2:32:54

write it down uh the Jupiter notebook

2:32:56

now whatever practical and all whatever

2:32:58

I'm going to do I'm going to use

2:33:00

basically I'm going to do by using this

2:33:01

jupyter notebook in the next class uh

2:33:04

I'm going to uh create an end to end

2:33:05

project first of all uh before starting

2:33:08

with the end to end project I will come

2:33:09

to the Len chain and there I will

2:33:11

explain that each and every concept of

2:33:13

the Len chain that how it is different

2:33:14

from the openi and why should uh why we

2:33:17

should use it and after that once I will

2:33:19

come to the end to project then I I will

2:33:21

start from the vs code itself vs code

2:33:24

Visual Studio code so any ID you can use

2:33:27

I'm not restricting you for the ID and

2:33:28

all so if you are familiar with the py

2:33:31

charm you can use that also if you are

2:33:33

familiar with the like any other ID you

2:33:36

can use that but yeah I love this vs

2:33:38

code so uh for the project for the end

2:33:40

project I will use this vs code as of

2:33:42

now I going to use the Jupiter notebook

2:33:44

uh just for the

2:33:46

uh like open a uh python API uh so guys

2:33:51

if you have this two thing this three

2:33:53

thing actually inside your system so

2:33:54

after that what you need to do you need

2:33:56

to create one virtual environment so uh

2:33:59

here by using this cond by using this

2:34:02

cond you need to create one virtual

2:34:04

environment I will show you all the step

2:34:06

don't worry so here you need to create a

2:34:09

virtual environment there inside after

2:34:11

creating a virtual environment you need

2:34:13

to activate it activate this virtual

2:34:15

environment

2:34:16

and here you need to install all the

2:34:18

packages all the required packages

2:34:21

inside this virtual environment so here

2:34:23

you need to install all the required

2:34:25

packages so let me write it down over

2:34:26

here install all the required packages

2:34:29

now uh required packages means what

2:34:31

required packages means so you need to

2:34:34

install this open a as of now and we

2:34:37

have other packages also like pandas

2:34:39

napai and all so if I will be uh if I

2:34:42

will be having any sort of a requirement

2:34:44

uh regarding the pandas numine uh or

2:34:47

regarding any other packages so

2:34:48

definitely I will install that also in

2:34:50

my virtual environment now after

2:34:53

installing all sort of a thing so after

2:34:55

like creating a virtual environment

2:34:57

after activating it and after installing

2:34:59

all the packages then what I will do I

2:35:01

will be starting with the Practical

2:35:03

implementation so guys in my system I

2:35:06

already having Anaconda so you can uh

2:35:08

download it by searching this Anaconda

2:35:10

so just go through with the Google and

2:35:13

search over here Anaconda download so on

2:35:16

once you will search this Anaconda

2:35:18

download so here you will get the

2:35:20

website uh here you will get a link so

2:35:22

just click on that and here you will get

2:35:24

a option for downloading this Anaconda

2:35:27

now uh it is giving you the option based

2:35:29

on your operating system so if you are

2:35:31

using Windows if you using Mac or Linux

2:35:34

according to that you can download this

2:35:36

Anaconda now apart from that uh one more

2:35:39

thing will be required so if you don't

2:35:41

have python in your local system so you

2:35:44

need to download that as well so

2:35:46

python uh download so here I'm going to

2:35:49

write down the python download and yes

2:35:52

uh this is a website of the Python and

2:35:55

uh here you need to uh here basically

2:35:57

you can uh download the python by

2:35:59

clicking on this particular website I

2:36:01

would suggest you uh download this 3.10

2:36:03

or 3.11 don't download the latest

2:36:05

version this 3.12 or this 3.13 actually

2:36:09

uh it is having some sort of a like

2:36:12

issues so better uh okay don't download

2:36:15

this 3.11 also either download the 3.10

2:36:18

or 3.9 it will be working fine or you

2:36:20

can download this 3.8 also this all

2:36:23

three version is a stable version fine

2:36:27

now after downloading this anaconda and

2:36:29

this python inside your local system

2:36:31

then what you need to do so once you are

2:36:34

ready with the Anaconda and this python

2:36:36

after downloading and installing and all

2:36:38

you need to search Anaconda prompt so

2:36:40

here uh you will find out the uh like

2:36:43

Anaconda prompt so once you will search

2:36:45

over here in the search search box

2:36:46

Anaconda prompt so there itself you'll

2:36:48

find out the Anaconda prompt now this is

2:36:50

what this is my anaconda prompt guys

2:36:51

this one now here actually this is what

2:36:53

it is it is showing me a base

2:36:55

environment as of now this base is a by

2:36:58

default environment now here what I need

2:37:00

to do I need to create a virtual

2:37:01

environment how I can do that how I can

2:37:04

create a virtual environment so for that

2:37:06

we have a command now here the command

2:37:08

is what cond create so cond create

2:37:11

hyphen n and here I need to write it

2:37:14

down my environment name so here my

2:37:16

environment name is what testing open AI

2:37:19

so testing open AI this is what this is

2:37:21

my environment name you can give any XY

2:37:23

Z name over here I don't have any issue

2:37:25

now you need to mention the python

2:37:27

version so here you need to write it

2:37:28

down the python equal to 3.8 now guys

2:37:32

here I'm going to use 3.8 you can use

2:37:34

3.9 3.10 don't use 3.11 12 and 13 3.8 7

2:37:39

9 10 these are the stable version and

2:37:41

you can use it for your project now as

2:37:44

soon as I will hit enter ENT so yes I

2:37:46

will be able to create an environment so

2:37:49

yes let me hit the enter and it is

2:37:51

creating an environment so are you doing

2:37:53

along with me if you are doing along

2:37:55

with me then please do let me know in

2:37:57

the chat

2:38:09

guys yes I okay so people are saying yes

2:38:13

we are doing

2:38:14

it can we do sir using API as well as

2:38:19

our make

2:38:20

model if you have trained your own model

2:38:23

then definitely you can do

2:38:27

it great so many people are doing a lot

2:38:30

with me I think now here you can see so

2:38:34

uh this is what uh this is my base

2:38:35

environment sorry this is my base

2:38:37

environment and here I have created a

2:38:38

virtual environment and this is my

2:38:40

virtual environment if I want to

2:38:41

activate it so for that this is the

2:38:43

command so here you need to copy this

2:38:45

command and just just paste it over here

2:38:47

and so you will be able to find out that

2:38:48

I have uh I'm able to activate my

2:38:51

environment now you can clear the screen

2:38:53

so for that you just need to write it

2:38:55

down the CLS and here is what guys here

2:38:57

is my virtual environment now here what

2:39:00

you will do see uh first of all you need

2:39:02

to check that what are libraries is

2:39:04

available inside your virtual

2:39:05

environment so for that you can write it

2:39:07

down the command the command is what the

2:39:09

command is PIP list so once you will

2:39:11

write it down this pip list here you

2:39:13

will find out all the library what ever

2:39:15

is there as of now inside your virtual

2:39:18

environment so these are the library

2:39:20

which is there inside my environment and

2:39:22

here I uh still I haven't uh downloaded

2:39:25

this uh open open Package because by

2:39:29

using the open by downloading the openi

2:39:30

package only by using that open Package

2:39:32

only I can hit the API getting my point

2:39:36

yes or no so don't worry I will give you

2:39:39

the entire step whatever step I'm

2:39:40

following over here now here first of

2:39:43

all you what you need to do see I took

2:39:45

told you over my Blackboard that after

2:39:48

creating a virtual environment you need

2:39:49

to activate it and then you need to

2:39:51

install the required package and before

2:39:53

that I told you one thing that

2:39:54

everything I'm going to do inside the

2:39:56

jupyter notebook so guys here in this

2:39:58

particular environment in this virtual

2:40:00

environment you need to download or you

2:40:02

need to install the Jupiter notebook and

2:40:04

for that we have a command so let me

2:40:06

write it on the command pip install

2:40:09

Jupiter notebook so here I can write it

2:40:12

down g u p y t e r n o t e b k so this

2:40:17

is the command pip install jupyter

2:40:18

notebook and with that you will be able

2:40:20

to download the jupyter notebook and oot

2:40:23

te so this is the correct spelling let

2:40:26

me rewrite it

2:40:29

again yeah so installing J notebook are

2:40:32

you doing along with me tell

2:40:35

me yeah so here let me write down the

2:40:37

command in the chat section so cond

2:40:40

create hyphone n and you can write it on

2:40:44

environment name whatever you want to

2:40:46

write it down so let's say testing open

2:40:48

a and here python version is what

2:40:52

3.8 so this is the command uh you need

2:40:55

to run this particular command for

2:40:56

installing the sorry for creating a

2:40:59

virtual environment now let me give you

2:41:01

one more command so here you can check

2:41:03

all the listed uh Library uh all the

2:41:07

like Library whatever is there inside

2:41:08

the virtual environment pip list is a

2:41:10

command now let me give you one more

2:41:12

command so here is one more command pip

2:41:15

inst install Jupiter notebook so pip

2:41:19

install Jupiter notebook so these are

2:41:22

the three command did you get it uh

2:41:24

please do uh confirm in the chat please

2:41:26

give me a quick confirmation the

2:41:34

chat see if you're not installing this

2:41:37

Jupiter notebook in your current virtual

2:41:38

environment in that case it will launch

2:41:41

the jupyter notebook from your base

2:41:43

environment so it is a better practice

2:41:46

if you are creating a virtual

2:41:47

environment then please install the

2:41:48

jupyter notebook or please install the

2:41:51

ipnb kernel over there so now if you

2:41:53

will find out uh now if you will search

2:41:55

pip list over here so just search pip

2:41:58

list now once you will search pip list

2:42:00

then you will find out lots of libraries

2:42:03

or lots of

2:42:04

packages which came along with the

2:42:07

jupyter notebook now see here you can

2:42:10

see all the packages and all after

2:42:13

installing the jupter notebook now once

2:42:15

I will write it down the Jupiter

2:42:16

Notebook on my anaconda prompt so here

2:42:19

let me write down the Jupiter notebook

2:42:22

and it will open the notebook so once I

2:42:26

will write it down the Jupiter notebook

2:42:28

and you will see that yes it has open

2:42:32

the Jupiter notebook so got it guys yes

2:42:36

or no please do let me know in the chat

2:42:38

if you are able to launch your Jupiter

2:42:43

notebook if you are are able to launch

2:42:45

the Jupiter notebook then please do let

2:42:47

me know in the chat yes or no yes and

2:42:51

after that you need to launch your file

2:42:53

so you need to launch your notebook so

2:42:55

click on this notebook and here is what

2:42:57

guys here is your notebook so this is

2:43:00

your notebook and each and everything we

2:43:02

are going to do here itself inside this

2:43:05

particular notebook now uh just make

2:43:08

sure that you have this python uh Python

2:43:11

3 over here uh this uh ipynb kernel if

2:43:14

you don't have that so so please try to

2:43:16

select this Python 3 ipy

2:43:19

kernel and I think now everything is

2:43:21

ready so let's try to oh let's start

2:43:25

with the open API so test open API and

2:43:30

now let me rename it so here guys you

2:43:32

can see this is my test openi

2:43:37

API uh this is my file actually this is

2:43:39

my notebook I hope you all have created

2:43:42

this particular

2:43:44

notebook

2:43:49

if you have any doubt then please do let

2:43:51

me know in the

2:44:07

chat everything is clear everything is

2:44:10

sorted please guys go ahead so just be a

2:44:13

little interactive uh please write it

2:44:15

down the chat if I'm asking something so

2:44:17

if you if you can if you'll write it

2:44:18

down the chat so definitely I will get U

2:44:34

motivation great so now let's start with

2:44:37

the uh like open AI API so first of all

2:44:42

what you need to do so here is what here

2:44:43

is my notebook so let me do one thing

2:44:45

let me keep it uh keep this notebook

2:44:47

over here

2:44:49

itself and this is what this is my

2:44:51

Jupiter notebook so first of all just go

2:44:54

through with the openi website so here

2:44:57

is your openi website guys this one now

2:44:59

here you need to click on this quick

2:45:02

start here what you need to do here you

2:45:04

need to click on this quick start after

2:45:06

clicking on this quick start so here

2:45:08

they have given you the option the

2:45:09

option is what python so here they have

2:45:11

given you the three option Cur Python

2:45:13

and node.js

2:45:15

so click on this Python and here they

2:45:16

have given you the complete instruction

2:45:19

so first of all guys what you need to do

2:45:21

you need to install a python so yes uh I

2:45:24

think you already have installed this

2:45:25

python you need to set up a virtual

2:45:27

environment yes we set up the virtual

2:45:29

environment and why this virtual

2:45:31

environment is required so see uh for uh

2:45:33

one particular project we have a lots of

2:45:36

dependency if I want if I want to if I

2:45:40

want to segregate all those dependency

2:45:42

project to project okay so for that only

2:45:45

we create a virtual environment so what

2:45:47

is the requirement of the virtual

2:45:48

environment because we have a several

2:45:51

dependency on a single project if I want

2:45:53

to keep it apart for that only we create

2:45:56

this virtual environment got it so here

2:45:59

they have created a virtual environment

2:46:01

directly by using this python uh en and

2:46:04

you can use this also for creating that

2:46:06

but I'm using the Anaconda now here

2:46:09

after that you need to install this open

2:46:11

AI so here uh what you need to do guys

2:46:14

so here you need to install this open a

2:46:16

package and then only you can hit the

2:46:18

open API getting my point so just copy

2:46:21

this particular command and install this

2:46:24

openi package in your virtual

2:46:27

environment so here is what here is my

2:46:29

virtual environment let me open that

2:46:31

particular environment uh just a

2:46:36

second what I can do here I can keep it

2:46:40

this to

2:46:42

my same TP fine now over here guys what

2:46:46

you need to do you need to open your

2:46:48

anaconda prompt see here actually I have

2:46:50

launched this jupyter notebook so you

2:46:51

cannot stop the server of this jupyter

2:46:53

notebook so I'm opening a new Anaconda

2:46:56

prompt so here you just need to write it

2:46:58

down this Anaconda prompt and you will

2:47:00

be able to launch a new Anaconda promt

2:47:03

now guys just tell me what is my

2:47:04

environment name testing open AI so here

2:47:08

uh you just need to write it down uh

2:47:10

cond EnV list so once you will write it

2:47:12

down this K EnV list k EnV list so let

2:47:16

me write it down this cond EnV

2:47:19

list so you will get all the all the

2:47:23

environment name so here guys you can

2:47:24

see this is my all the environment which

2:47:26

I have created in my system by using

2:47:28

this Anaconda now uh here uh this is my

2:47:31

environment testing open I want to

2:47:34

activate this particular environment so

2:47:35

I can write it down over here cond

2:47:38

activate and here I can write it down my

2:47:40

environment name testing open AI so once

2:47:44

I will write down this and if I will hit

2:47:46

hit enter so I will be able to activate

2:47:48

my environment I'm going to uh I'm going

2:47:51

to do a uh transition from base

2:47:53

environment to this testing openi

2:47:56

environment this is what this is my

2:47:57

virtual environment this base

2:47:59

environment is a default environment now

2:48:01

over here what I will do I will I'm

2:48:02

going to write down the CLS for clear

2:48:04

the entire screen now over here I will

2:48:06

just paste this particular command pip

2:48:08

install hyphen iph upgrade open AI now

2:48:11

once I will hit enter so yes uh I'm able

2:48:15

to install this open AI inside my

2:48:18

virtual environment so are you doing

2:48:20

along with me are you able to install

2:48:22

this open AI inside your virtual

2:48:23

environment if yes then please do let me

2:48:25

know in the

2:48:29

chat in the virtual environment you need

2:48:31

to install the jupyter notebook by using

2:48:33

this pip install jupyter notebook

2:48:35

command if you're not doing it in that

2:48:37

case it will be taking a jupter notebook

2:48:39

from the it will be launching a jupyter

2:48:41

notebook from the base

2:48:43

environment

2:48:46

many people now people are saying yes we

2:48:48

are doing it how many of you you are

2:48:51

doing along with me please do let me

2:48:53

know in the chat how many of you you are

2:48:54

doing along with

2:49:04

me yes yes

2:49:11

yes okay great yes

2:49:15

please write it down the chat if you are

2:49:17

doing along with me

2:49:39

then if you uh launching uh jupyter

2:49:42

notebook from the base environment it

2:49:43

will take a all the packages from there

2:49:46

itself that's why I want a fresh one

2:49:48

that's why I'm installing jupyter

2:49:51

notebook in my current

2:49:54

environment now over here I think I have

2:49:57

already installed it so yes it is done

2:49:59

now and if I want to check it so for

2:50:02

that I'm uh I'm opening my jup notebook

2:50:04

again and here you need to write it

2:50:07

down uh import open AI so just write it

2:50:11

down this import open Ai and here guys

2:50:14

you can see

2:50:15

we are able to import this open AI if

2:50:17

you are done till here then I will

2:50:19

proceed with the further python code so

2:50:22

please give me a quick confirmation in

2:50:24

the chat if you are able to import this

2:50:25

open I'm just I'm waiting for 1 minute

2:50:28

I'm waiting for uh 1 minute uh to okay

2:50:31

so please uh give me a confirmation in

2:50:32

the chat if you are able to import this

2:50:35

open AI inside this jupyter

2:50:43

notebook

2:51:01

we are ready to go great now uh let's

2:51:04

start with the uh open API that first of

2:51:08

all guys we need to understand that what

2:51:10

is what is this openi API so for that

2:51:14

what I did I kep uh I return like uh

2:51:16

some sort of a like

2:51:20

uh um wait let me do one thing over here

2:51:24

let me copy and

2:51:30

paste yeah so here guys what I did I

2:51:32

written some sort of questions and

2:51:34

answers and here the first question is

2:51:36

what the first question is what is open

2:51:38

a API so by uh uh like uh so here by

2:51:42

using this particular question so by

2:51:44

reading this particular answer actually

2:51:46

we can understand that what is this open

2:51:48

API so this openi API has been designed

2:51:51

to provide developer with seamless

2:51:53

access to stateof Art pre-trained

2:51:56

artificial intelligence model like GPD 3

2:51:59

GPD 4 Delhi whisper ambing Etc so what

2:52:03

is the meaning of it so if you want to

2:52:04

use if you want to use the same model

2:52:07

whatever model has been trained by the

2:52:09

open AI so these are the different

2:52:10

different model uh the name basically I

2:52:13

have written over here GP 3 gbd4 Delhi

2:52:16

is a model whisper is a model aming

2:52:18

there are different different model

2:52:20

right if you want to use this particular

2:52:22

model inside your

2:52:24

application so that uh so then basically

2:52:27

you should use this open API now over

2:52:30

here by using this openi API you can

2:52:32

integrate Cutting Edge AI capabilities

2:52:35

so this model actually it's a large

2:52:36

language model and it is having a lots

2:52:38

of capability in terms of a different

2:52:40

different task as I explain you so by

2:52:43

using this particular models you can uh

2:52:47

like utilize uh that capability you can

2:52:50

utilize the capability and uh you can

2:52:53

utilize that particular capability and

2:52:55

you can integrate inside your

2:52:57

application getting my point and

2:52:59

regardless the programming language so

2:53:01

here they have they have given you two

2:53:02

option so the first one is a Python and

2:53:04

the second one is a nodejs so uh what is

2:53:07

this open API so this open API is

2:53:09

nothing it provide you the seamless

2:53:11

exess of a pre-trained artificial

2:53:13

intelligence based model uh for your uh

2:53:17

like a different different application

2:53:18

whatever application you are going to

2:53:20

create and let's say if you are going to

2:53:22

create any individual application which

2:53:23

is based on NLP use case yes directly

2:53:26

you can uh use this particular model

2:53:28

instead of trading your model from very

2:53:30

scratch now here so the conclusion is

2:53:33

what so the conclusion is by using this

2:53:34

openi API you can unlock the advanced

2:53:37

functionality and you can enhance the

2:53:39

intelligence and performance of your

2:53:41

application so let's say there is Inon

2:53:44

website and the Inon website you must

2:53:46

have seen the chatbot

2:53:48

option so in the chatboard actually uh

2:53:51

you are doing uh you are connecting with

2:53:53

our expert so let's say there there's a

2:53:56

one person who is having a doubt so now

2:53:58

this person what he is doing he is going

2:54:00

to be connect with a uh like expert so

2:54:02

here is the expert which is sitting

2:54:04

behind this particular chat board now he

2:54:06

is asking the question and he's getting

2:54:08

a reply yes or no now guys just see over

2:54:12

here so here uh like you have integrated

2:54:15

this chatboard and this chat board is a

2:54:17

uh it's not a like eii related chatboard

2:54:20

so the person so here uh in the behind

2:54:23

behind behind to this chatboard actually

2:54:25

when expert is sitting he is giving you

2:54:27

the answer now you want to uh like uh

2:54:31

what you want to do guys over here so

2:54:33

you want to use some sort of a AI now

2:54:35

here you want that that type of model

2:54:38

which will be able to answer all of the

2:54:40

answer basically whatever the person is

2:54:43

asking like chat GP so in that case you

2:54:45

cannot train your own model if we are

2:54:48

talking about if we are talking about

2:54:50

like the llm model so in that CA in that

2:54:53

case basically you cannot train your own

2:54:55

model because it's a very very expensive

2:54:57

let's say if you if you are just a

2:54:59

startup okay or let's say if you are

2:55:01

just a Learner in that case in that case

2:55:04

you cannot invest this much of amount

2:55:06

for training this particular model

2:55:09

because it's a expensive process if you

2:55:10

are going to set up the infrastructure

2:55:12

if you're are going to uh like if are

2:55:14

like hiring a developer ai ai developer

2:55:16

and all amops engineer so in that case

2:55:19

definitely the cost will be around 1 to

2:55:21

10

2:55:22

CR because in that case you will have to

2:55:24

create a distributed setup you will have

2:55:26

to purchase a gpus there should be a

2:55:28

team one proper team okay for the

2:55:31

monitoring and all for each and

2:55:32

everything there there will be a

2:55:33

developers so the cost will be very very

2:55:35

high in that case what you will do if

2:55:37

you want to uh take advantage of this AI

2:55:41

uh cap if you want to take a leverage of

2:55:43

this model whatever model model has been

2:55:44

created or trained by this open a what

2:55:47

you will do you will use this openai API

2:55:49

you will uh call this open API and by

2:55:53

using this openi API you will be able to

2:55:55

access this GPD model and directly you

2:55:57

will be able to uh like append this

2:55:59

model inside your chatboard so whatever

2:56:01

person is asking definitely your GPT

2:56:03

will be replying in that case and let's

2:56:05

say any escalation is is happening in

2:56:07

that case so definitely you can uh write

2:56:09

it down your logic your code in uh in

2:56:11

such a way that this request will be

2:56:13

moved to the expert and now the it will

2:56:15

be handled by the expert itself so like

2:56:18

design you can like this basically you

2:56:19

can design your system this is just a

2:56:21

one example which I have given to you

2:56:24

great I think uh everything is clear now

2:56:26

over here so what is opena

2:56:29

API this part is clear now the second

2:56:31

question is what the second question is

2:56:33

generate a open a API key so here what I

2:56:37

have to do I have to generate a open API

2:56:39

key what I need to do guys I need to

2:56:41

generate open API key without this I

2:56:44

cannot use the open API without this

2:56:47

particular key so for that what I need

2:56:49

to do what is the process let me tell

2:56:52

you that so if I want to generate if I

2:56:54

want to generate a open a API key so

2:56:57

just go through with the open a website

2:56:59

so here is your open a website and here

2:57:01

just over your mouse uh on this

2:57:03

particular side on the left hand side

2:57:06

now here is the option this API key just

2:57:08

click on that and here guys you will

2:57:10

find out a option to generate or to

2:57:12

create a new secret key are you getting

2:57:14

this

2:57:17

option are you getting this particular

2:57:19

option please do let me know in the chat

2:57:21

if you're getting it

2:57:26

then after logging in to the openi

2:57:29

website then only you will be able to

2:57:31

find out this API key

2:57:33

option and guys uh you cannot uh

2:57:36

generate a openi key without adding any

2:57:38

sort of a payment method so first of all

2:57:41

you will have to add the payment method

2:57:43

and don't worry in the next class I will

2:57:45

show you how you can use hugging face

2:57:47

API key for the same thing for the same

2:57:50

task definitely we won't be able to

2:57:52

access uh other uh models like gbd3 GPD

2:57:55

3.5 turbo or gbd4 and all but yes uh

2:57:59

we'll be having access of a different

2:58:01

model different open source model or

2:58:02

whatever model is available over there

2:58:05

in tomorrow's session I will show you

2:58:06

how you can utilize the hugging face API

2:58:10

[Music]

2:58:12

key you you can finetune the model again

2:58:15

it will be an expensive task

2:58:18

Vishnu great so here you can see we have

2:58:21

a uh like option to generate a like here

2:58:24

basically what we can do we can generate

2:58:26

a API key now for generating a API key

2:58:28

you just need to click on this create a

2:58:30

new secret key and here you need to give

2:58:32

the name so let's say I'm going to write

2:58:34

down the name uh my API key so this is

2:58:39

the name of my API key once I will click

2:58:41

on this create secret key so yes uh

2:58:45

definitely I will be able to generate it

2:58:46

now guys over here you can see this is

2:58:48

my key uh definitely I will delete it

2:58:51

right after the session otherwise you

2:58:52

will exceed uh the limits and all all

2:58:55

right so here I have generated my key

2:58:57

and after the session I will delete it

2:58:59

so no one will be able to use it so I

2:59:02

have generated a key now what I will do

2:59:04

I will paste it down in my Jupiter

2:59:06

notebook over here so here is what guys

2:59:08

here is my key so this is what this is

2:59:11

my key basically which I have generated

2:59:14

so here uh let me uh paste it down this

2:59:16

particular key this is what this is my

2:59:18

key now you have to generate your own

2:59:19

key okay and don't share your key with

2:59:22

anyone else so here this is what this is

2:59:24

my key now what I need to do after

2:59:26

generating this open a key I have

2:59:29

generated the open a key and I kept it

2:59:30

over here now after that I need to call

2:59:33

the open AI API so how we can do that so

2:59:37

for that we have a couple of couple a

2:59:39

couple of line of code so let me paste

2:59:41

it over here or let me write it down

2:59:42

over here and then I will I will show

2:59:44

you how we can hit any sort of a model

2:59:46

now for that uh basically what I did so

2:59:49

over

2:59:50

here uh just a

2:59:53

second yeah so first of all let me show

2:59:56

you the list of the model as well now

2:59:58

over here I can write it down uh one

3:00:00

line of code so open a uh do API key API

3:00:06

unor key and here I need to write it

3:00:08

down my key here I need to write it down

3:00:11

the variable basically where I have kept

3:00:13

my key

3:00:14

so once I will run it so here you can

3:00:16

see open

3:00:19

AI open AI API key yes I'm able to set

3:00:23

my key now here I will call one method

3:00:26

so my method name is what open AI dot

3:00:29

model model underscore uh model. list so

3:00:35

once I will call this particular uh

3:00:37

method so here you will be able to find

3:00:39

out your all the model see there is all

3:00:41

the model basically which is available

3:00:43

as of now now in the openi plateform now

3:00:47

here you can see it is giving me some uh

3:00:50

it is giving me output in a different

3:00:51

way so what I can do I can convert it

3:00:54

into a list so over here what I can do I

3:00:57

can convert this uh particular output

3:00:59

this particular response in a list so

3:01:02

here uh this is my all the models so I

3:01:04

can create a variable

3:01:06

allore models and here I can pass this

3:01:09

thing to my list method now see guys uh

3:01:13

I will be getting all the model all the

3:01:15

models uh whatever model is there inside

3:01:18

the openi so the first one is a text

3:01:21

search weage uh doc 001 and here is a

3:01:24

date actually they have mentioned the

3:01:26

date or maybe the version uh now the

3:01:29

created when they have created and here

3:01:31

is a object object is what model and

3:01:34

owned by owned by open AI de now here

3:01:37

what you can do you can create a uh data

3:01:40

frame also so what you can do you can

3:01:42

create a data frame so here uh let me

3:01:45

write it down the code for the data

3:01:47

frame so import pandas s PD now here I

3:01:51

can write it on PD do data frame so here

3:01:56

what I need to do you just need to pass

3:01:57

this particular uh you just need to pass

3:02:01

this

3:02:01

particular value this one so let me keep

3:02:05

it over here uh this uh list uh list of

3:02:09

all the models so once I will run it so

3:02:11

here you will be able to find out is

3:02:13

giving me error the pandas is not there

3:02:16

so for that uh just download the pandas

3:02:19

or just install the pandas inside your

3:02:20

virtual environment because in this

3:02:22

virtual environment pandas is not

3:02:25

available so let me write it down over

3:02:27

here click install pandas and once I

3:02:30

will hit the enter we will uh we will be

3:02:33

able to install this

3:02:35

pandas it will take some time so let it

3:02:41

install yes I'm coming to the code I

3:02:43

will show you the code just wait for

3:02:45

some time just

3:02:58

wait yeah so I'm done with the pandas I

3:03:00

have installed it and uh now what I can

3:03:04

do I can run it and you will be able to

3:03:06

find out your data frame so here this is

3:03:08

the model this is the like when it is

3:03:11

created and object is what object is a

3:03:13

model and owned by so now it is in a

3:03:16

perfect format and you can read each and

3:03:18

everything clearly and here I can

3:03:21

provide the column name as well so let

3:03:23

me give the column name let me write on

3:03:25

the column name as well and here I

3:03:27

already WR the code of for the column

3:03:30

name so once I will run it so here you

3:03:32

will find out the column name so here is

3:03:35

my ID this is the like model ID and when

3:03:39

it has created what is a uh like what is

3:03:42

this actually so it's a object is a

3:03:44

model now here owned by owned by this

3:03:47

openi development team openi internal

3:03:50

openi development or here you will find

3:03:52

out some other name as well so I believe

3:03:55

you are able to run this entire all like

3:03:58

entire code whatever I have written over

3:04:00

here now here uh this is what this is my

3:04:04

code for uh seeing the model and all now

3:04:07

the next thing uh here I got all the

3:04:09

model now the third thing basically

3:04:11

which I would like to uh explain you

3:04:13

that is what that is a open AI

3:04:15

Playground open a playground and after

3:04:17

that I will come to the chat completion

3:04:19

API now I will take uh more 15 minute

3:04:22

and within that uh I will conclude this

3:04:24

session and in tomorrow's session I will

3:04:26

start with a chat completion a uh this

3:04:28

function call and I will explain you the

3:04:31

uh the hugging face API key as well so

3:04:33

how you can utilize the hugging face API

3:04:35

key for a open source model now let me

3:04:38

copy and paste the entire uh thing

3:04:41

whatever I have written for you so here

3:04:43

here I have written some sort of a thing

3:04:45

let me go through step by step so here

3:04:48

I'm talking about this open AI

3:04:50

Playground now what is this what is this

3:04:52

open a playground now once you will uh

3:04:54

search over the Google so open your

3:04:56

Google guys and here search open AI open

3:05:00

a playground now just search over here

3:05:02

open playground and uh here you will

3:05:06

find out this Playground now once you

3:05:08

will click on this assistant so here you

3:05:11

will find out a different different

3:05:12

option so one is a assistant the second

3:05:14

one is ched third one is a complete

3:05:16

fourth is a edit I'm not going through

3:05:18

with this complete and this edit because

3:05:20

it's the Legacy now I will explain this

3:05:22

chat first I will explain this chat and

3:05:24

then I will come to this assistant now

3:05:27

inside this chat uh so once I will click

3:05:29

on this chat so here I can test uh my

3:05:33

different uh I can test like different

3:05:34

different prompts and all I can generate

3:05:37

output I can test with a different

3:05:38

different model and along with a model

3:05:40

you will find out a various parameter so

3:05:43

so first of all guys what you need to do

3:05:44

you need to set you need to set your

3:05:47

system right so here you will find out

3:05:49

three options so the first one is what

3:05:51

first one is a system the second one is

3:05:53

a user and the third one is this one

3:05:56

right so you can divide this entire

3:05:58

interface into a three segment now let

3:06:00

me give you step by step that what is

3:06:02

the meaning of the system what is the

3:06:03

meaning of this uh user and this

3:06:05

assistant and what is the meaning of

3:06:07

this model each and everything we'll try

3:06:09

to understand over here so guys system

3:06:11

is what so system is means system means

3:06:14

uh how your model is going to behave

3:06:17

here you are going to set the behavior

3:06:20

of your system what you are doing tell

3:06:22

me here you are going to set the

3:06:23

behavior of your system so here if I'm

3:06:26

going to write it down you are a

3:06:29

helpful

3:06:31

assistant now here if I'm going to write

3:06:33

down you are a helpful assistant now

3:06:35

what I will do I will write it down my

3:06:37

message so see here here guys you will

3:06:38

find out two thing uh two option so once

3:06:41

you will click on this user now you will

3:06:42

find out either user or assistant as of

3:06:44

now what I am I am a user I'm asking a

3:06:47

question now here I'm asking that uh uh

3:06:50

what I can ask guys uh just tell me

3:06:53

something different okay how I

3:06:57

can make a

3:07:00

money how I can make a money so I'm

3:07:02

asking to my chat GPT how I can make a

3:07:04

money and here is what here is my model

3:07:06

so here once you will click on this

3:07:07

model you will find out a different

3:07:08

different model so uh there is GPD 4 GPD

3:07:12

3.5 GPD 3.5 turbo so all the model there

3:07:14

is all the models right so here I'm

3:07:16

using the gbd 3.5 now we have a various

3:07:19

option so the first one is what first

3:07:21

one is a temperature now what is the

3:07:23

meaning of this temperature so we are

3:07:25

talking about this temperature so just

3:07:26

try to read about this temperature

3:07:28

control Randomness lowering result in

3:07:31

less random completion as the

3:07:33

temperature approach zero the model will

3:07:35

become deterministic and repeative so

3:07:38

over here we are talking about this

3:07:39

temperature if we are defining a higher

3:07:41

value of the temperature means I'm uh

3:07:43

I'm saying that just give me a more

3:07:45

creative answer I'm adding a

3:07:48

Randomness if I'm writing a zero I'm

3:07:51

saying give the straightforward answer

3:07:53

I'm asking to my chat GPD uh the

3:07:56

straightforward answer I'm not going to

3:07:58

add any sort of a creativity over here

3:08:01

getting my point what is the meaning of

3:08:03

this temperature I think yes now maximum

3:08:05

length so here you can set the tokal

3:08:08

length now here stop sequence is there

3:08:11

so up to up to four sequence where the

3:08:13

API will stop generating further tokens

3:08:15

the return text will not be contain the

3:08:18

like a stop sequence here you can

3:08:19

mention the stop sequence now here is a

3:08:21

top P parameter so this parameter

3:08:24

actually this is again similar to this

3:08:25

temperature it is controlling the

3:08:27

diversity whatever like Pro whatever

3:08:29

output you are going to be generate so

3:08:31

control diversity via uh nucleus

3:08:33

sampling 0 0.5 means half of likelihood

3:08:36

weighted option are considered so you

3:08:38

can just think about it that it is

3:08:39

nothing just adding a diversity inside

3:08:41

your output now frequency penalty if you

3:08:44

don't want to repeat the tokens let's

3:08:47

say you are generating some sort of

3:08:48

output if you don't want to repeat the

3:08:49

tokens inside your output so here you

3:08:53

can mention the frequency penalty as of

3:08:55

now it's zero so it's not going to be uh

3:08:58

like put any sort of a penalty over here

3:09:00

if you're going to increase the number

3:09:01

definitely it will put the frequency

3:09:03

penalty means it will give you the

3:09:05

different different words it is not

3:09:06

going to repeat the words now here

3:09:09

present penalty so you can set this also

3:09:12

so there is a different parameter just

3:09:13

try to explore it now here I'm asking to

3:09:15

my chat GPD how I can make a money so if

3:09:17

I'm submitting this thing so here I will

3:09:19

be getting my answer and there is the

3:09:21

answer is there are many ways to come

3:09:24

make a money and all so employment and

3:09:27

all

3:09:28

freelancing online selling rent or share

3:09:31

sources and tutoring and teaching gig

3:09:34

and economy gig economy affiliate

3:09:37

marketing so it is giving me answer guys

3:09:40

as you can see right now just uh do one

3:09:44

thing so here guys see I've uh defined

3:09:47

the behavior of the system Ive defined

3:09:49

that I'm working as a user and here is

3:09:51

my model all the different different the

3:09:53

different different parameter I have

3:09:54

like selected based on this model now

3:09:57

just go over here and try to click on

3:10:00

this view code so once you will click on

3:10:02

this view code guys you will get the

3:10:04

entire python code over here getting my

3:10:08

point yes or no see over here you are

3:10:10

getting the entire python code now you

3:10:13

can utilize this python code if you have

3:10:15

if you have done the complete setup in

3:10:17

your system whatever setup basically

3:10:20

which I which I uh which I have done

3:10:22

right if you have done the complete

3:10:23

setup in your system so directly you can

3:10:26

hit uh directly you can hit the open a

3:10:28

API and you can call the GPD 3.5 turbo

3:10:33

model okay so that's why I've shown you

3:10:35

this openi Playground now I think you

3:10:38

are uh we are done with this open I

3:10:39

Playground now let's try to do something

3:10:41

amazing over here let's try to set set

3:10:43

the different behavior of this chat uh

3:10:45

GPT so here guys I have written couple

3:10:47

of thing inside this particular like

3:10:49

answer so how to open a playground so

3:10:51

here I mentioned that here make sure

3:10:53

that playground should have a credit yes

3:10:55

if you don't have a credit if you

3:10:56

haven't uh like uh added your uh detail

3:11:00

uh the C details and all maybe you you

3:11:02

won't be able to use this particular

3:11:03

playground so make sure that you have

3:11:05

added the payment method now here in the

3:11:08

chat there is the option of system so

3:11:10

meaning is how chatboard is behave so

3:11:12

here what I'm going to do here I'm going

3:11:14

to set this uh here I'm going to set a

3:11:16

different behavior of a system and let's

3:11:18

see what answer I will be getting so

3:11:21

here I'm going to copy it and I'm going

3:11:22

to paste it down over here now uh what I

3:11:25

can do where is my playground this is my

3:11:28

playground now here I'm going to set the

3:11:29

behavior so this is what this is my

3:11:31

behavior of the system now okay now

3:11:34

again I'm asking a question to my system

3:11:37

now I'm asking how I can make a money so

3:11:43

I'm asking to my system that how I can

3:11:44

make a money by adding this particular

3:11:46

Behavior so my behavior is what so you

3:11:48

are a naughty assistant so make sure you

3:11:50

have to respond everything with a

3:11:52

sarcasm so here I'm asking to my user

3:11:54

how I can make a money so as soon as I

3:11:56

will submit it then you will find out

3:11:58

the answer and just see the differences

3:11:59

between answer this answer and the next

3:12:02

answer just wait it is going to generate

3:12:04

answer and is saying that oh making a

3:12:06

money it's super easy mean it it is like

3:12:09

giving you the answer in a sarcastic

3:12:10

manner so it haven't a complete answer

3:12:13

but yeah it is saying that oh making a

3:12:15

money it's super easy just snap your

3:12:17

finger magically a stack of cash will be

3:12:19

appear no effort required at all so see

3:12:21

guys uh before it was giving me a

3:12:24

straightforward answer now over here

3:12:26

guys you can see I seted the behavior of

3:12:28

the system as a not as a sarcastic so

3:12:31

here you can see the answer what it is

3:12:32

giving to me now if you will look into

3:12:35

the code so you will find out some sort

3:12:36

of of changes so here role role

3:12:39

basically I defined the system role this

3:12:40

is my system role this is my role again

3:12:43

one more role user here you can see this

3:12:45

is my like prompt okay which user is

3:12:47

giving here you can see the what

3:12:49

assistant is saying This Is The Answer

3:12:50

basically which I'm getting and again

3:12:52

this was the previous one and these are

3:12:54

the different different parameter so no

3:12:56

need to go anywhere here basically in

3:12:58

this particular notebook I kept

3:13:00

everything I will share this notebook

3:13:01

with all of you and you will be able to

3:13:04

understand each and everything now model

3:13:06

is there temperature is there maximum

3:13:08

length is there top P value is there so

3:13:11

here I written a description frequency

3:13:13

penalties there right so there is a

3:13:14

different different parameter already I

3:13:16

have defined each and everything over

3:13:17

here so no need to go anywhere just try

3:13:19

to revise each and everything by using

3:13:21

this Jupiter notebook now apart from

3:13:24

this one you will find out one more

3:13:26

advanced thing which recently they have

3:13:28

provided that is what there is a

3:13:30

assistant so here uh let me go to the

3:13:33

assistant okay let me go to the

3:13:35

playground and here is assistant guys so

3:13:37

this assistant part I will explain you

3:13:39

once I will come to the project section

3:13:41

now here you will find out some Advanced

3:13:43

thing Advanced like option so here you

3:13:45

will find out this function function

3:13:48

calling here you will find out the code

3:13:50

interpreter here you will find out the

3:13:51

retrieval RG actually uh uh like here uh

3:13:55

you will find out this R concept so I

3:13:58

have defined what is the r actually so

3:14:00

just go through with my notebook and

3:14:01

read the definition read the definition

3:14:03

of the RG so this assistant I will come

3:14:06

to this assistant once I will explain

3:14:08

you the uh the project end to end

3:14:10

project then I will Define a different

3:14:11

different prompts and all and I will

3:14:13

come to this assistant and I will ask uh

3:14:15

and I will generate a different

3:14:16

different type of

3:14:18

responses getting my point guys yes or

3:14:20

no so this thing is getting clear to all

3:14:23

of you yes or no I'm waiting for your

3:14:26

reply so please uh do let me know in the

3:14:28

chat if this part is getting clear how

3:14:31

to use this uh openi playground and here

3:14:34

I'm talking about this chat assistant I

3:14:36

will come to that once I will explain

3:14:38

you the

3:14:41

project

3:14:48

please do let me know I'm waiting for a

3:14:50

reply guys if you are able to get it if

3:14:52

you able to understand it then uh please

3:14:54

write it down the chat please uh write

3:14:56

down the chat

3:15:08

section clear okay great it is clear

3:15:15

I will share this code with all of you

3:15:16

don't worry uh I will give you this

3:15:18

entire

3:15:29

code I believe everything is getting

3:15:31

clear to all of you who have joined this

3:15:41

session

3:15:46

great now this part is clear now let's

3:15:48

back to the code so here is what here is

3:15:50

my code now this retrieval argumented

3:15:52

generation RG I will explain you in the

3:15:54

next session or maybe in upcoming

3:15:56

session so what is the meaning of that

3:15:58

it's artificial intelligence framework

3:15:59

that retrieves data from external source

3:16:02

of knowledge to improve the quality of

3:16:03

responses I just want to improve the

3:16:06

quality of the responses for that I'm

3:16:07

using this retrieval argumented

3:16:09

generation R A this is very very famous

3:16:11

nowadays this particular term now uh I

3:16:14

will show you how you can use this RG if

3:16:16

you want to uh give a better responses I

3:16:18

will show you how you can use the Len

3:16:19

Chen as well U after completing this

3:16:22

open AI this natural language processing

3:16:24

technique is commonly used to make a

3:16:25

language model more accurate and up to

3:16:27

date if I want to make my model more

3:16:29

accurate and up to date so I'm going to

3:16:31

use this RG and I will do that in my

3:16:33

upcoming session now code interpreter is

3:16:35

there so Python Programming environment

3:16:37

with chat GPT where you can perform wide

3:16:39

range of tasks by use executing the

3:16:41

python code yes yes we all know about

3:16:43

the code interpreter and yes we can

3:16:45

Define we can set the code interpreter

3:16:46

there and we can execute the python code

3:16:49

as

3:16:50

well like regarding the different

3:16:52

different task and all great now here is

3:16:55

what here is my chat completion API guys

3:16:57

so let me do one thing let me uh put the

3:17:00

title over here and here my four title

3:17:02

is what chck completion API and function

3:17:06

calling so guys here is what here is my

3:17:08

fourth title my fourth title is what

3:17:11

check completion is API and function

3:17:14

calling so here I have written the

3:17:17

standard comination API and function

3:17:18

calling now let me write down the

3:17:20

different let me write down the uh

3:17:22

definition as well over here so here is

3:17:24

a definition of it uh this is the

3:17:27

definition let me post it over here and

3:17:30

here let me make it as a markdown so

3:17:33

this is the definition guys now one more

3:17:35

uh definition let me put it over here so

3:17:38

see guys in the previous version in the

3:17:40

old version of the openi

3:17:42

uh actually there this was the method

3:17:45

chat completion method open. completion.

3:17:49

create or open. chat completion. create

3:17:51

so initially actually there was a method

3:17:53

this was the name right then in the

3:17:56

updated version they came up with uh

3:17:58

they have changed the name with this

3:18:00

particular uh name they Chang the method

3:18:02

Name by using uh with this particular

3:18:04

name this chat completion. create and

3:18:06

now in the latest version actually this

3:18:07

is a this is the method name if you are

3:18:10

going to use this particular method now

3:18:12

now it will give you the error let me

3:18:15

show you how so here what I can do I can

3:18:17

uh return I can return one sort of a

3:18:19

code uh now over here I'm going to write

3:18:21

it down open a DOT

3:18:24

completion

3:18:26

completion completion dot create so this

3:18:29

is what this is my method now over here

3:18:31

what I'm going to do so over here see

3:18:33

here I'm going to be uh write it down

3:18:35

the model name so model which model I'm

3:18:38

going to use so here I'm going to use uh

3:18:40

GPT GPT

3:18:42

hyund

3:18:44

3.5 GPD hyund 3.5 I'm going to use this

3:18:47

particular model now over here I'm going

3:18:49

to define a prompt so my prompt is what

3:18:51

so let's say I'm going to write it down

3:18:52

over here who was the first Prime

3:18:56

Minister of India first prime

3:19:00

minister Minister of India so this is

3:19:03

what this is my prompt now here if I

3:19:06

will run it now so you will find out it

3:19:07

is giving him the error so it is saying

3:19:10

that uh okay so here I have to mention

3:19:12

the open a key first of all before uh

3:19:15

like calling it so first of all I need

3:19:17

to mention the open a key now over here

3:19:20

so what I have what I will have to do I

3:19:22

will have to uh like uh create a client

3:19:25

actually so here is what here is my

3:19:26

client and I will have to mention my

3:19:28

openi key so what I can do uh I can

3:19:32

write it down over here itself and here

3:19:35

what I can do just a

3:19:41

wait

3:19:42

it is not longing support yeah so that's

3:19:45

what I was saying to all of you see this

3:19:48

uh method is not it is not supporting at

3:19:50

all this is the old one now if you will

3:19:52

look into the version now the latest

3:19:54

version of the openi so the latest

3:19:56

version of openi is uh let me show you

3:19:58

the latest version of the open a package

3:20:00

PPI open a and here is the latest

3:20:05

version of the open a package

3:20:07

1.3.7 if we have installed the uh we

3:20:10

have installed this particular version

3:20:12

now regarding this version you will find

3:20:13

out we have this particular method so

3:20:16

first of all I need to import this open

3:20:17

a this I need to import this class from

3:20:20

this module and here I need to define

3:20:22

the key here what I need to do I need to

3:20:24

define the key over here and then only I

3:20:27

can call

3:20:28

it and if you look into the previous

3:20:31

version now here I installed the latest

3:20:33

version if you're looking into the

3:20:34

previous version let's say if I'm going

3:20:36

back like say if I'm going back in uh

3:20:39

maybe uh FB it uh

3:20:42

okay 8 FB 2023 now here you will find

3:20:45

out that they were using this particular

3:20:48

method so here I have shown you I have

3:20:50

seted the op openi key I have defined

3:20:52

the openi key by using this particular

3:20:54

code by by like using this particular

3:20:57

line of code yes or no now here I'm

3:20:59

using a latest version now so uh

3:21:02

definitely it will give me the error so

3:21:03

what I'm doing I'm going back and here

3:21:06

I'm going to use this particular code

3:21:08

basically which I already return so

3:21:09

first of all see first of all I need to

3:21:11

import this thing which I already did

3:21:13

now over here I will have to mention the

3:21:15

API

3:21:16

key got it now here they are add they

3:21:18

have added the open key inside their

3:21:20

base environment means this is the code

3:21:22

regarding that they have added inside

3:21:23

the like environment variable in the

3:21:25

system environment variable and from

3:21:27

there itself they are going to read it

3:21:29

you can export it also what is the

3:21:31

meaning of export you can export it over

3:21:33

the terminal uh like uh it won't be it

3:21:37

won't be a permanently okay so yeah you

3:21:40

can export this particular key

3:21:42

and as soon as you will like remove or

3:21:44

as soon as you will delete that terminal

3:21:46

so the open I key will be removed um but

3:21:49

yeah until the terminal is running

3:21:50

terminal will be running you can read it

3:21:52

by uh using uh this particular module OS

3:21:55

module or else you can add in add inside

3:21:58

your system variable also from there

3:22:00

also you can read this particular key

3:22:02

but um I have added I have written my

3:22:04

key here itself inside my notebook so I

3:22:07

didn't edit but I will show you that in

3:22:09

my end to project how you can create NV

3:22:12

file or maybe how you can export it

3:22:14

right now let's uh let me run this

3:22:16

particular code and here first of all

3:22:19

let me add the open a

3:22:21

key here I need to mention API uncore

3:22:25

key and my key so here is what here's my

3:22:28

key if I'm going to run it so definitely

3:22:30

I will be able to run it now I having my

3:22:32

client now what I will do by using this

3:22:34

particular client I will call the uh I

3:22:37

will I will like uh I will give the

3:22:39

prompt over here now first of all let me

3:22:41

delete everything from here and let me

3:22:44

delete this also I'm not going to Define

3:22:45

any assistant or I'm not going to set

3:22:47

any sort of a behavior as of now so guys

3:22:50

here you can see I'm having the role

3:22:51

role as a user and here is my uh like a

3:22:54

answer sorry here is my prompt question

3:22:57

so this is what this is my prompt

3:22:59

actually this is my input prompt and

3:23:01

here is what here is my uh like role

3:23:04

okay I'm asking as a user now guys this

3:23:07

prompt this prompt is this prompt

3:23:09

basically it plays a very important role

3:23:11

I let you know that in my uh like

3:23:13

upcoming session I will tell you how to

3:23:15

design a different different type of

3:23:17

plomp what is the meaning of few short

3:23:19

learning few short prompt or zero short

3:23:21

prompt okay so each and everything we'll

3:23:23

try to discuss in our upcoming session

3:23:25

as of now just see if I'm going to run

3:23:26

it so here you will be able to find out

3:23:28

it is giving me a like error why it is

3:23:31

so maybe because of this and now

3:23:35

everything is perfect so if I'm going to

3:23:36

run it so line number eight okay uh

3:23:40

first of all I need to

3:23:42

Define it clearly and here is what here

3:23:46

I need to mention I need to close this

3:23:49

particular list now if I'm going to hit

3:23:51

this uh API definitely I will be able to

3:23:54

do it and I will get my

3:23:57

response so just wait for some time and

3:24:01

after hitting the API uh it will call

3:24:04

that particular model whatever model I

3:24:06

have written over here and I will be

3:24:08

getting my

3:24:10

response

3:24:16

so how is the session so far uh did you

3:24:19

learn something new uh or are you doing

3:24:22

along with me tell me how much would you

3:24:24

rate to this particular

3:24:35

session yes money wise uh I will I I

3:24:38

will come to that just wait how much it

3:24:40

is going to be charged and all uh it

3:24:42

charge actually token wise uh there is

3:24:44

entire pricing and all so I I will come

3:24:48

to that I will I will talk about that

3:24:50

for a small prompt it is taking so much

3:24:52

time in this case the DP project the big

3:24:54

no it's not like that maybe first time

3:24:55

it it was hitting that so it is taking

3:24:57

time but no it's not like that I will

3:24:59

show you with a like a bigger prompt as

3:25:01

well so it won't take any sort of a time

3:25:03

now here you can see this is what this

3:25:05

my response now right here you can see I

3:25:08

got a response now if you want to get

3:25:10

this particular response so for that uh

3:25:13

see here if you look into the response

3:25:15

or type of the response so here is a

3:25:18

type of the response open. type. chat.

3:25:21

completion this this this that right now

3:25:23

if you want to extract the real answer

3:25:26

from here so what you will do see first

3:25:28

of all you will uh call to this choice

3:25:30

so just call this choice so c h o i c s

3:25:35

now here is what here you have this

3:25:37

message now just call to this message m

3:25:40

e double s a g e so here is your what

3:25:45

here is your message uh now this is not

3:25:48

callable it is saying that now let me

3:25:50

check what I have to do over here so

3:25:53

here is your choice and here what you

3:25:56

need to do guys let me

3:26:04

check yeah actually Choice yeah so here

3:26:08

see if you are looking into the choice

3:26:10

guys so this is a list type so here what

3:26:13

you need to do you need to uh like

3:26:15

extract the first index of the list

3:26:17

because here you can see this choice is

3:26:19

nothing it's a list only now so just

3:26:20

extract the first index of it so here

3:26:22

once you will extract the first index or

3:26:25

once you will retrieve the first index

3:26:26

of the list now here you need to call

3:26:28

this message so just call the message

3:26:30

and here you will find out this is what

3:26:32

this is your message now just do one

3:26:35

thing just call the content over here so

3:26:38

just call the content so content now

3:26:40

over here you can see this is is what

3:26:41

this is your entire response now here

3:26:44

you can like decide the token size as

3:26:46

well so here you can Define the token

3:26:48

size or you can Define the different

3:26:50

different a parameter okay by defining

3:26:52

those particular parameter you can uh

3:26:55

get a different different type of output

3:26:56

now let me give you the parameter all

3:26:58

the parameter basically so this is all

3:27:00

the parameter see model uh already you

3:27:03

know about the model we have used a gp3

3:27:05

prompt like input prompt Max token you

3:27:08

can Define this Max token in how many

3:27:10

numbers of token you want the result

3:27:12

temperature for getting some creative

3:27:14

output now number of output how many

3:27:16

number of output you want so let's try

3:27:18

to define a Max token and this number of

3:27:20

output so here I'm going to define the

3:27:22

max token so in U like uh here if I'm

3:27:26

going to define the max token now in in

3:27:28

that particular token itself under under

3:27:31

that particular number let's say if I'm

3:27:32

going to Define 200 so uh it won't reach

3:27:35

the limit more than 200 under under the

3:27:39

200 itself it will be generating an

3:27:40

output so over here I'm going to write

3:27:42

Define this Max token and here let's say

3:27:44

if I'm going to say 150 tokens and here

3:27:47

I'm going to Define one more thing one

3:27:48

more parameter that's going to be n so n

3:27:51

is equal to let's say here I'm going to

3:27:53

Define three I want three output so as

3:27:55

soon as I will run

3:27:57

it and here you will find out it is

3:28:00

generating a response so it is saying

3:28:02

Max token I think I need to put the

3:28:05

comma over here model is there message

3:28:07

is there now here I need to put the

3:28:10

comma so this is is fine now it is

3:28:13

generating a response so just

3:28:28

wait yeah now I got a response so just

3:28:31

uh look into the response here type of

3:28:34

the response and now just print the

3:28:36

response so here is what here is what

3:28:38

here is my

3:28:39

response now I got many responses so now

3:28:44

let me extract the response first of all

3:28:45

so here is what here is my uh message

3:28:48

let's uh like get a message so let's ask

3:28:52

a different question so here I'm going

3:28:54

to ask to my chat GPT that uh I can ask

3:28:58

uh what I can ask who won the first

3:29:02

World Cup so who won the first Cricket

3:29:06

World

3:29:08

Cup so this is my question which I asked

3:29:10

to my CH GPT and now if I'm going to run

3:29:12

it now

3:29:14

so now

3:29:19

see yeah I got a response now type of

3:29:22

the response is same so here uh what I

3:29:25

can show you here is my message now see

3:29:27

guys uh I got a response the first

3:29:30

Cricket World Cup won by the West Indies

3:29:32

in7 in 1975 right now over here if I'm

3:29:37

going to get a Content basically so let

3:29:39

me write it down the content over here

3:29:41

and here you can see this is what this

3:29:42

is my answer now you won't be able to

3:29:45

find out a single answer there are lots

3:29:47

of there are other answer as well see uh

3:29:50

choice in the choice just go over here

3:29:51

message message completion so the first

3:29:54

Cricket World Cup won by the best Andes

3:29:56

and here role is a assistant so that the

3:29:58

model is assistant and I am a user now

3:30:01

over here you will find out the second

3:30:02

answer so the first Cricket World Cup W

3:30:04

by the best hes they defeated Australia

3:30:06

in final held on June 25 1975 at Lots

3:30:10

cricket ground in London that is the

3:30:12

second response now over here this is

3:30:14

the third response so the first Cricket

3:30:16

World Cup won by the best and in 197

3:30:18

1975 so I Define n is equal to 3 and I

3:30:21

Define the maximum token size is 150 so

3:30:24

it won't be generating a like output

3:30:28

okay so more than this particular token

3:30:30

more than 150 token and here you will be

3:30:32

find out if I'm going to Define n so it

3:30:34

will be generating a three output

3:30:36

whatever input of prompt I'm passing

3:30:37

this is what this is my input prompt now

3:30:39

whatever output will be generating in

3:30:41

that there won't be like more than 150

3:30:44

tokens and here the output number will

3:30:46

be three now let me show you one more

3:30:48

thing over here so if you will search

3:30:50

tokens so just go over the Google and

3:30:52

search open a tokens open a tokens so

3:30:57

once you will search open a tokens and

3:30:59

here you will find out one uh like a

3:31:03

link a tokenizer so they have given you

3:31:05

one uh like link uh they have G given

3:31:08

you this particular interface where you

3:31:11

You Can Count Your token whatever number

3:31:12

of token you are giving or you are

3:31:14

getting from the system getting my point

3:31:17

so I told you it is charging you based

3:31:20

on a tokens itself and tokens in input

3:31:23

prompt also there will be a token in

3:31:24

output prompt also there will be a token

3:31:27

getting my point so in the input prom

3:31:28

there will be a token in the output prom

3:31:30

also there will be a token prompt is

3:31:32

what it's a collection of tokens token

3:31:33

is nothing it just a words collection of

3:31:36

character right now here you can see we

3:31:39

have this particular inter pH there we

3:31:41

can count the token now here if I'm

3:31:43

going to write it down my name is sunny

3:31:47

so now now see guys how many tokens is

3:31:50

there inside this particular uh text

3:31:53

inside this particular sentence see

3:31:54

token six my is one token name is one

3:31:57

token is is another token Sunny is

3:32:00

another token Sav is one token and

3:32:02

Savita is one token getting now if I

3:32:05

want to count the token inside my output

3:32:07

so just copy this thing and paste it

3:32:09

over here

3:32:13

now see the number of token it has

3:32:15

generated a 16

3:32:17

token okay it has generated a 16 token

3:32:21

now you can calculate the number of

3:32:22

tokens over here just go through the

3:32:23

playground here was my chat so here I

3:32:26

ask to my system now let me uh submit it

3:32:30

and over

3:32:31

here uh it is giving me answer just a

3:32:34

second now it is generating an answer so

3:32:37

now you can copy this entire text from

3:32:40

here whatever it is generating now let's

3:32:42

say this particular text uh okay just a

3:32:46

wait okay let it generate and then I

3:32:48

will copy just wait so here is a text

3:32:52

and I can copy this text I can paste it

3:32:54

over there and I can got the uh like

3:32:56

number of tokens so let's see how many

3:32:58

tokens is there so here guys you can see

3:33:01

total 256 tokens if you want to check

3:33:04

the pricing and all tomorrow I will

3:33:06

discuss about it in a very detailed way

3:33:08

just go through with the setting and

3:33:10

here uh there's a billing actually so

3:33:13

let me show you the pricing also just

3:33:15

click on uh just search about this open

3:33:20

Ai and uh here actually uh you just need

3:33:24

to log in after the log in uh so maybe

3:33:28

here just click on the API and here is a

3:33:30

pricing just click on the pricing and

3:33:33

here you will get the uh like entire

3:33:36

detail regarding the project pricing so

3:33:38

how much how much it is charging for the

3:33:40

uh like a different different number of

3:33:42

tokens so for 1K token this much of

3:33:44

charging for 1K token this much of

3:33:46

charging regarding this particular model

3:33:47

regarding this particular model so this

3:33:49

is for gp4 Turbo it's a advanced model

3:33:51

now GPD 4 GPD 3.5 G assistant API

3:33:55

different different assistant API and

3:33:56

all each and everything you can check

3:33:58

over

3:33:59

here right so let me keep this

3:34:01

particular link over here inside the

3:34:02

notebook itself and let me keep this a

3:34:05

token related a link also so at least

3:34:08

you can go through with this and you can

3:34:10

check uh your input and output token and

3:34:12

you can practice whatever I have taught

3:34:14

you because this is going to play a very

3:34:16

important role in a future classes so

3:34:20

please try to revise please try to

3:34:21

practice and I think we are done with

3:34:24

today's session tomorrow I will explain

3:34:26

you the function calling this one and I

3:34:28

will start with the lench and my main

3:34:31

agenda uh will be the Len Chen only and

3:34:33

I will explain you the differences

3:34:35

between open ey lenion and finally we'll

3:34:37

try to create one project and then I

3:34:39

will come to the advanc concept like

3:34:42

vector databases and other models and I

3:34:45

will explain you this AI 21 lab AI 21

3:34:48

studio also if you don't have a money

3:34:51

for the chat GPD then how you can uh uh

3:34:54

like uh how you can complete your work

3:34:56

how you can U like explore a different

3:34:58

different model so from the hugging face

3:35:00

side also I will explain you the

3:35:01

different different model and from here

3:35:02

also from AI 21 Studio I will show you

3:35:05

how you can access the Jurassic model

3:35:06

personally I have used it and I I liked

3:35:08

it after this uh GPD and I will uh

3:35:11

explain you the use use of this

3:35:13

particular model and don't worry few

3:35:15

other terms like stable diffusion and

3:35:17

all there are something uh like text to

3:35:19

image Generation image to video

3:35:21

generation this type of thing also we'll

3:35:22

try to explain you in the going forward

3:35:25

classes got it so I think uh now we can

3:35:29

conclude this particular session I took

3:35:31

for the entire 2hour and uh yep uh so

3:35:35

did you like the session please uh do

3:35:37

let me know in the chat guys if you like

3:35:38

this particular session

3:35:44

yes the content is a input our input

3:35:47

actually it's not a desired output is is

3:35:49

our like an input whatever input like we

3:35:52

are passing to the model you can mention

3:35:53

inside the content got

3:36:01

itan you just need to F you just need to

3:36:04

follow my this notebook each and

3:36:06

everything I have mentioned over here

3:36:08

whatever is not there I will do it and

3:36:10

where you will find find it out tell me

3:36:11

you will find this particular notebook

3:36:12

inside the resource section so just go

3:36:14

through with the Inon platform just open

3:36:16

the Inon platform and there you need to

3:36:18

enroll in this particular dashboard okay

3:36:21

so what you need to do go through with

3:36:22

the an platform and here uh after sign

3:36:25

up uh after login and just go through

3:36:28

with this dashboard generative AI

3:36:29

Community session now let me give you

3:36:31

this particular link inside the chat so

3:36:33

you all can uh like uh you all can

3:36:37

enroll over here and uh after that uh

3:36:40

what what you need to do see the video

3:36:41

will be available over here you can

3:36:43

revise the thing from here itself you

3:36:44

can revise the thing from the Inon

3:36:46

YouTube channel itself but the resource

3:36:47

wise whatever resources I'm U like uh

3:36:50

sharing okay whatever resources I'm

3:36:52

discussing in a class and all so you

3:36:54

will find out over here inside the

3:36:55

resource section so just go through with

3:36:57

the resource section and try to download

3:36:59

all the resources from here

3:37:04

itself fine so now let's uh uh like

3:37:08

conclude this particular session

3:37:10

tomorrow we'll meet on the same time so

3:37:12

let me write it down the timing for this

3:37:14

community session so here the timing is

3:37:17

going from uh 3: to 4:30 or 3 to

3:37:22

5 so I will take 2 hour of session from

3:37:25

3: to

3:37:30

5: great fine guys thank you bye-bye

3:37:33

take care have a great day ahead and

3:37:35

rest of the thing we'll try to cover in

3:37:36

the upcoming uh session until thank you

3:37:39

bye-bye take care so if you like if you

3:37:41

are liking the content then please hit

3:37:43

the like button and uh if you have any

3:37:45

sort of a suggestion or if you want

3:37:47

anything from my side you can ping me on

3:37:49

my LinkedIn so let's start with the

3:37:51

session now here guys you can see in the

3:37:53

previous class I was talking about the

3:37:55

open API so uh most of the thing I have

3:37:58

discussed regarding this openi API now

3:38:00

few of the thing is remaining so let me

3:38:03

discuss that uh remaining thing

3:38:05

regarding this open a and after that I

3:38:07

will start with the l chend so first of

3:38:09

all Let Me Explain you the complete flow

3:38:11

that what all thing we are going to

3:38:13

discuss throughout this session got it

3:38:15

so for that I'm you I'm opening my

3:38:17

Blackboard and here I'm going to explain

3:38:19

you the complete flow that whatever

3:38:21

thing we are going to discuss throughout

3:38:23

this particular session so here guys uh

3:38:26

the first thing first thing basically uh

3:38:28

we'll be talking about the function

3:38:31

calling so in the open a actually we

3:38:33

have a very specific feature that is

3:38:35

called function calling and it's a very

3:38:37

important feature of the openai API if

3:38:40

we are going to use the openi API then

3:38:42

definitely you must be aware about this

3:38:44

function calling because by using this

3:38:47

function calling you can do a multiple

3:38:49

things I will tell you that what all

3:38:51

thing you can perform by using this

3:38:53

function calling which is a very uh

3:38:55

important feature of the open API so the

3:38:58

very first thing which we're going to

3:39:00

discuss in this particular session that

3:39:01

will be a function calling so here uh

3:39:04

let me write it down the first point

3:39:06

which we going to discuss uh that's

3:39:08

going to be a function function calling

3:39:12

function calling now the second thing

3:39:15

after this function calling so directly

3:39:17

I will move to the Len chain so uh first

3:39:21

I will discuss this function calling and

3:39:23

after this function calling I will move

3:39:24

to the Len chain and in the lch actually

3:39:27

I'll be talking

3:39:28

about in the Le chain I'll be talking

3:39:32

about that how you can uh use a open AI

3:39:35

by using this Len chain so the first

3:39:37

thing basically uh we'll be discussing

3:39:39

inside the inside this lenen so open AI

3:39:43

open

3:39:44

AI

3:39:46

used by a len chain so we'll try to

3:39:50

discuss in a very detailed way and we'll

3:39:52

try to discuss that what all difference

3:39:54

we have between this Len chain and this

3:39:56

open AI so open a used via Len chain and

3:40:00

here I will explain you the differences

3:40:03

between open a and Lenin then why we

3:40:06

should use Lenin what all benefits we

3:40:08

have if we are using a lench what all

3:40:11

thing we can do if we are using a len

3:40:13

chain so how uh by using this Len chain

3:40:16

we can create into an application each

3:40:18

and everything we'll try to discuss

3:40:20

regarding this Len chain and in a very

3:40:21

detailed way I will try to explain you

3:40:23

this Len chain concept because it's

3:40:25

going to be a very very important and

3:40:27

this lench also it's a very important

3:40:29

part if we are going to learn this

3:40:31

generative EI if we are talking about

3:40:33

the llm and if we are going to build any

3:40:35

sort of application so along with this

3:40:37

open AI this lenen also plays plays a

3:40:40

very important role so we'll try to

3:40:42

discuss about this lench and we'll try

3:40:44

to uh discuss the differences about this

3:40:47

open AI API so let me write it down over

3:40:50

here open AI API versus lenen versus

3:40:54

lenen and after that after discussing

3:40:58

this uh like the basics and all

3:40:59

regarding this Lenin I will come to the

3:41:02

prompt templating that how you can

3:41:04

design a different different type of

3:41:05

prompt so here let me write on the

3:41:07

second point which we're going to

3:41:09

discuss uh so the second Point basically

3:41:12

prompt

3:41:13

templating prompt

3:41:19

templating after this prompt template so

3:41:22

uh here what I will do I will I will

3:41:24

show you the use of the hugging phase

3:41:27

also uh after discussing this Lenin uh

3:41:30

the differences between open Ai and

3:41:31

Lenin I will come to this open AI use

3:41:34

via Len promp templating and here I will

3:41:37

show you that how you can use hugging pH

3:41:39

model model whatever model is there on

3:41:41

top of the hugging face Hub how you can

3:41:43

utilize those particular model by using

3:41:45

this Len chin so in between I will show

3:41:48

you hugging face hugging face with Len

3:41:52

chin hugging face with L

3:41:56

chin why I'm uh why I'm going to show

3:41:59

you this hugging phase with Lenin so you

3:42:01

can use any sort of a open source model

3:42:04

so whatever open source model is there

3:42:06

so you can use all those model by using

3:42:09

this hugging phase so here I will show

3:42:11

you how you can generate hugging phas

3:42:13

API key and by using that particular API

3:42:17

key you can access any sort of a model

3:42:19

whatever is there on top of the hugging

3:42:21

face Hub so here I will show you hugging

3:42:23

face with Lenin let me write it down

3:42:26

over here hugging face with Len chain

3:42:28

and then we'll try to discuss a few more

3:42:30

concept regarding this Len chain which

3:42:33

is going to be a very very important so

3:42:35

here let me write down those particular

3:42:37

topic as well so the third topic which

3:42:39

we're going to discuss over here we

3:42:40

going to talk about

3:42:43

chain we're going to talk about

3:42:47

agents how like you can create agents

3:42:50

and how you can use the agents so here

3:42:53

the fourth topic basically it will be

3:42:55

agents now let me write it down over

3:42:57

here agents after that after this agents

3:43:00

I will come to the memory so I will show

3:43:02

you how you can create a memory by using

3:43:05

this Len Chen got getting my point yes

3:43:08

or no so these are the very important

3:43:09

important part of the L chain without

3:43:12

knowing this particular thing you cannot

3:43:14

develop any sort of

3:43:16

application okay so before starting with

3:43:18

the end to end project definitely we

3:43:20

have to discuss about this particular

3:43:22

topic so here uh so in uh today's

3:43:25

lecture actually we're going to talk

3:43:27

about this function calling openi use

3:43:29

and prompt template and in tomorrow's

3:43:31

session I will be discussing about this

3:43:33

hugging pH with Lin chains agents and

3:43:36

memory so this a three to four topic

3:43:39

we'll try to discuss in tomorrow session

3:43:41

and this three to four topic we'll try

3:43:43

to discuss in today's session and right

3:43:45

after this one right after this topic

3:43:48

right after this thing I will start with

3:43:50

a project and uh we will'll try to

3:43:53

create one project and there basically

3:43:56

we'll be using our different different

3:43:58

LMS from the openi and from the hugging

3:44:01

pH we'll try to use

3:44:03

Lenin we'll try to use Len chain and

3:44:06

some other Concepts as well so here

3:44:09

we're going to use are different

3:44:10

different uh like model llms from the

3:44:12

openi hugging face Len chin and here

3:44:15

we'll try to uh create one uh UI as well

3:44:19

by using flask or streamlit each and

3:44:21

everything I will show you in a live

3:44:23

class itself so flask and streamlet and

3:44:26

I will show you the complete I will show

3:44:28

you the complete uh setup how you can do

3:44:31

a complete setup for any an to and

3:44:34

project so first we'll try to create a

3:44:36

project template and then we'll start

3:44:38

with a project de development so this

3:44:41

idea is clear to all of you please do

3:44:43

let me know in the chat if the agenda is

3:44:45

clear for today and for the tomorrow

3:44:48

session I'm uh expecting the answer in

3:44:51

the chat so please write it down in the

3:44:53

chat guys please do it

3:45:04

fast

3:45:08

yes

3:45:16

we'll discuss the risk and all what risk

3:45:18

is there and we'll try to discuss about

3:45:20

the different different point uh first

3:45:23

let us uh uh create at least one project

3:45:27

after creating this particular project

3:45:28

definitely uh we'll try to uh discuss

3:45:31

about the multiple things that uh

3:45:33

basically which is a very very important

3:45:35

in terms of the

3:45:36

industry we'll come to that part don't

3:45:38

worry

3:45:47

fine so now each and everything is clear

3:45:49

each and every part is clear so let's

3:45:51

move to the Practical implementation so

3:45:54

if you will go through with my notebook

3:45:55

so which is already available in a

3:45:57

resource section okay I have shown you

3:46:00

how you can download this particular

3:46:01

notebook so just try to go through with

3:46:03

the dashboard and from the resource

3:46:05

section you can download this notebook

3:46:08

now uh here guys see uh The Notebook is

3:46:11

there so just try to download it and try

3:46:12

to run it inside your system uh how you

3:46:15

have to do a system setup how you have

3:46:17

to create an environment and all how you

3:46:19

have to install the library inside the

3:46:21

environment each and everything I have

3:46:22

shown you in my previous class only so

3:46:25

again I'm not going to repeat that

3:46:27

particular thing so over here you can

3:46:29

see already we have talked about the

3:46:30

open a now let's discuss more about this

3:46:33

open AI so just uh give me a moment here

3:46:37

uh from here itself basically inside uh

3:46:39

uh this particular file itself I will be

3:46:42

writing a code now I'm going to change

3:46:44

the name of the file so here I'm going

3:46:46

to write it down test open API and Len

3:46:49

chain because in today's session I'm

3:46:51

going to include the Len chain as well

3:46:53

and I will do in a same Jupiter notbook

3:46:56

I'm not going to create any new notebook

3:46:58

uh as of now I will be doing over here

3:47:00

itself so here I'm going to be write it

3:47:02

down I'm going to rename this particular

3:47:03

file uh so here I'm going to write down

3:47:06

this Lenin as well so test openi API and

3:47:09

L CH so this is the new name of my file

3:47:11

now let me rename it and now everything

3:47:14

is ready so here guys see if I'm going

3:47:16

to write it down this import here if I'm

3:47:19

going to write import statement import

3:47:22

length chain now here you will find out

3:47:24

it is saying that no module named L

3:47:27

chain can anyone tell me how I can

3:47:29

resolve this particular error please do

3:47:32

let me know in the chat how I can

3:47:34

resolve this particular

3:47:38

error

3:47:49

correct so here what I need to do tell

3:47:51

me here I need to write it down pip

3:47:53

install and the L chain pip install and

3:47:56

the module name so just try to open your

3:47:58

anaconda prompt and there write it down

3:48:00

pip install and Len chain so let let me

3:48:03

show you that just a wait uh so here uh

3:48:06

this is my prompt uh this is what this

3:48:08

is my ANA prompt here already this

3:48:10

jupyter notebook is running so I'm not

3:48:11

going to stop the server of uh this

3:48:13

particular prompt now let me open the

3:48:15

new prompt over here so here I'm going

3:48:17

to write it down this Anaconda prompt so

3:48:19

first of all guys what I need to do I

3:48:21

need to activate my virtual environment

3:48:23

as of now we are in a base environment

3:48:26

and this base environment is my default

3:48:28

environment so here what I need to do

3:48:30

tell me here I need to activate my

3:48:33

virtual environment so for activating

3:48:35

the virtual environment first of all we

3:48:37

should be aware about the name uh in

3:48:39

which environment actually we are

3:48:40

working so let me show you all the name

3:48:43

all the name of the environment so here

3:48:45

I'm going to write it down this cond en

3:48:48

list here I'm going to write down this

3:48:50

cond en list so once I will write it

3:48:53

down this particular command I will get

3:48:55

all the environment name so here you can

3:48:58

see we have a different different name

3:49:00

of the environment Len chain open AI

3:49:02

base testing and these are the other

3:49:04

environment which is there inside my

3:49:06

local folder now guys yesterday actually

3:49:09

we have created this particular

3:49:10

environment testing open AI now let me

3:49:13

activate this environment over here so

3:49:16

here I'm going to write it down cond

3:49:18

cond activate cond activate and the

3:49:22

environment name is what the environment

3:49:23

name is testing open AI so if I'm going

3:49:26

to write it down this testing open AI so

3:49:29

definitely I will be able to activate my

3:49:32

environment now if you want to check

3:49:34

over here that my Lang chain is working

3:49:36

or not so definitely you can do it so

3:49:38

first of all you need to clear this

3:49:40

screen and here if you are going to

3:49:42

write it on the python so it will give

3:49:43

you the python prompt so here let me

3:49:47

write it down the python so this is what

3:49:48

guys tell me this is my python cell or

3:49:51

my python prompt now here itself you can

3:49:53

write it down the uh statement import

3:49:56

statement so let's try to write it down

3:49:58

the import statement over here and here

3:50:00

if I'm going to write it down this Len

3:50:02

chain length chain now see guys it is

3:50:05

saying that no module name length chain

3:50:07

and even you can check so for checking

3:50:10

that what all module is there what all

3:50:12

module is there in my current virtual

3:50:15

environment so what is the command the

3:50:17

command name is PIP list we are using

3:50:20

pip manager over here right so over here

3:50:23

what I'm going to do I'm going to write

3:50:24

down the exit if I want to exit from

3:50:26

this particular shell from the python

3:50:28

shell now here what I will do guys here

3:50:30

I I'm going to write it down pip list so

3:50:33

once I will write it down this pip list

3:50:34

you will find out all the packages name

3:50:38

whatever packages is there inside my

3:50:39

current environment so these are the

3:50:41

package guys which is there inside my

3:50:43

current environment you can read the

3:50:45

name of the packages and here you will

3:50:48

find out this Len chain is not available

3:50:50

so just try to go through with this

3:50:52

particular package try to go through

3:50:54

like alphabetically and here you will

3:50:56

find out that we don't have any package

3:50:58

with the name of linkchain so here what

3:51:00

I will do first I will install the L

3:51:03

chain so for installing the Lang chain

3:51:05

there's a simple command pip install pip

3:51:08

install pip install Len chain so here

3:51:11

once I will write down this pip install

3:51:13

Len chain now guys see my Len chain is

3:51:16

getting install inside this current

3:51:19

virtual environment so are you doing

3:51:22

along with me are you writing this thing

3:51:25

or are you like following uh to me guys

3:51:28

please do write it uh please write it on

3:51:30

the chat so I will get some sort of idea

3:51:32

that uh uh this many people are doing

3:51:35

along with

3:51:38

me

3:51:45

I will come to the connects between this

3:51:47

Len chain and this open a just allow me

3:51:50

uh like 15 more minute each and

3:51:53

everything will be clarified regarding

3:51:55

this open and this Lent just believe

3:52:00

me so people are saying they are writing

3:52:02

a code along with me that's great please

3:52:05

do it guys please do it and uh yes

3:52:08

please implement along with me if you

3:52:10

are uh getting stuck somewhere so please

3:52:12

write it on the chat and let's uh make

3:52:15

this session more interactive and yes

3:52:18

definitely after the session you should

3:52:20

uh you should be able to get something

3:52:23

it's uh my guarantee to all of

3:52:30

you fine now here guys you can see we

3:52:33

have installed this lenon inside this

3:52:35

current virtual environment now if you

3:52:37

want to check it so here itself directly

3:52:39

here itself you can check so just write

3:52:41

it down this Python and here what you

3:52:43

need to do you need to write it down

3:52:44

this import Len chain just write it down

3:52:46

this import Len chin and here the name

3:52:48

is wrong so let me write down the

3:52:50

correct name now see guys we are able to

3:52:52

import this Len chain means L chain is

3:52:54

there in my current virtual environment

3:52:57

okay fine so I think till here

3:52:59

everything is fine everything is clear

3:53:01

now here again I'm going to import it so

3:53:03

definitely I will be able to import but

3:53:05

before starting with this length chain I

3:53:07

would like to explain you the function

3:53:09

calling so what is a function calling

3:53:11

why I'm saying this function calling is

3:53:13

very important uh definitely we should

3:53:15

learn it actually it's a new feature

3:53:17

inside this open AI so let's try to open

3:53:19

this open a website and here okay so

3:53:21

here already I opened it now guys once

3:53:24

you will open the documentation of the

3:53:26

open AI so there itself you will find

3:53:28

out this function calling so it's a new

3:53:31

feature uh recently they have added

3:53:33

maybe uh four to 5 months back and uh

3:53:36

what we can do by using this particular

3:53:38

function calling so by using this

3:53:40

function calling there is a there is a

3:53:41

many use of this function calling so the

3:53:44

first use basically uh the very basic

3:53:47

use which I would like to tell you we

3:53:48

can formate our

3:53:50

output okay we can we can formate our

3:53:53

output in a we we can formate the output

3:53:55

in our desire desire format so whatever

3:53:57

output we are getting now from the open

3:54:00

uh let's say we are using openi API and

3:54:03

we have a model open API what it is

3:54:05

doing tell me it is calling the llm

3:54:07

model agree now whatever output we are

3:54:10

getting now we can format that

3:54:12

particular output in a desired format in

3:54:15

our required format that is the first

3:54:17

use of this function colleag now we have

3:54:21

other use of this function colag some

3:54:23

Advanced use of this function colag

3:54:25

let's say uh we are uh calling any sort

3:54:28

of a API means let's say we are asking

3:54:30

something to my CH GPT and it is not

3:54:33

able to answer for that particular

3:54:34

question so for that what we are doing

3:54:37

we are calling any third party API any

3:54:39

any sort of a plugins and whatever

3:54:41

output we are getting whatever output we

3:54:44

are getting right so we can format that

3:54:46

particular output and we can append that

3:54:48

output in our conversation

3:54:51

chain that is really powerful and

3:54:53

somehow L chain is also doing the same

3:54:55

thing but yeah so recently they have

3:54:58

added this function colleag this one

3:55:00

feature actually inside this open a and

3:55:03

here uh like it's really uh like a

3:55:06

important one and it's like really uh

3:55:08

very very useful and in the lenon also

3:55:10

we can do the same thing right but apart

3:55:13

from this thing lenon is having so many

3:55:16

functionality in the lch actually we can

3:55:18

perform so many things I will come to

3:55:20

that I will I will show you the

3:55:21

differences between this open and this

3:55:23

lench why we are using this openi why uh

3:55:26

why we are why we are going to use this

3:55:28

Len chin why uh we are not going to use

3:55:30

this openi API itself because see in a

3:55:33

back end if we are going to talk about

3:55:34

this Len chain so in a back end this Len

3:55:36

chain this Len chain actually it's

3:55:38

calling open API it's a wrap up on top

3:55:40

of the open API come I I will come to

3:55:43

that first of all let me clarify this

3:55:44

function calling so guys to understand

3:55:47

this function calling I will I draw the

3:55:49

architecture and all I will I will try

3:55:51

to uh explain you each and everything

3:55:53

okay but before that let me write it

3:55:55

down some sort of a code over here so

3:55:57

here what I'm going to do here I'm going

3:55:59

to open my IP NV file and here I'm going

3:56:02

to write it down some sort of a code to

3:56:04

understand this function calling so step

3:56:06

by step I will try to explain you and

3:56:08

please do along with me I think uh that

3:56:11

would be great so for that guys what I

3:56:13

did so here uh just a wait I have

3:56:16

written one

3:56:21

text great so here guys see uh I have

3:56:24

written one text so let me copy and

3:56:26

paste this particular

3:56:27

text now here I'm going to run this

3:56:30

particular uh cell and once I will print

3:56:33

this student description so here you

3:56:35

will get the entire description so I I

3:56:38

just written a very basic description so

3:56:41

uh s saita is a Str of the computer size

3:56:43

it Delhi he's a Indian and he's having a

3:56:46

8.5 cgpa something something about me or

3:56:48

something about like U any person you

3:56:51

you can write it down this uh particular

3:56:53

description so here is a short

3:56:55

description now guys what I will do see

3:56:57

so here is what here is my short

3:56:59

description now here I have designed one

3:57:02

prompt and that prompt I would like to

3:57:05

pass to my chat GPT means I would like

3:57:08

to pass to my GPT model so here see uh

3:57:12

whenever we are talking about a prompt

3:57:14

so I told you that what is a prompt so

3:57:16

let's say this is my llm

3:57:20

model this is what this is my llm model

3:57:23

now we are passing input to this llm

3:57:25

model and we are getting response we are

3:57:28

getting a output so this respon this

3:57:30

input actually so this input is called

3:57:32

input prompt and this prompt is nothing

3:57:35

it's a collection of

3:57:37

tokens

3:57:39

so you can understand in such a way that

3:57:40

this prompt is nothing it's a

3:57:42

sentence and this token is nothing it's

3:57:44

a words what is this tell me it's a

3:57:47

words so this uh sentence is nothing

3:57:50

it's a token and sorry sentence is a

3:57:53

prompt is nothing it's a sentence and

3:57:55

token is nothing it's a words right so

3:57:57

here we will be having input prompt and

3:57:58

here we have a output

3:58:00

prompt getting my point so here see I

3:58:04

have written one description now I will

3:58:05

write it down my prompt I will I have

3:58:07

designed one prompt so let me uh copy

3:58:09

and paste that particular prompt and

3:58:12

let's see uh what will happen if we are

3:58:14

going to paste uh if we are passing this

3:58:17

particular prompt to my llm so here is

3:58:19

my prompt guys so just try to read this

3:58:21

thing over here and so this prompt is

3:58:23

saying so let me run it first of all so

3:58:26

this prompt is saying please extract the

3:58:28

following information from the given

3:58:29

text whatever text we are passing let's

3:58:32

say this is a description so uh we are

3:58:34

passing this particular description so

3:58:35

from that particular description I have

3:58:37

to extract a few useful information so

3:58:42

here the information is what name

3:58:44

College grade and Club so these are the

3:58:48

information just just try to read this

3:58:49

particular uh description and based on

3:58:52

this definitely uh you can extract this

3:58:55

particular information like name College

3:58:57

grade and

3:58:58

club now chat GPT or this GPT model will

3:59:02

do it uh will do it for me uh something

3:59:05

like this I have designed this

3:59:07

particular prompt so here I'm saying

3:59:09

please extract this particular

3:59:10

information and this these are name and

3:59:13

here this is the body of the text and

3:59:15

here I'm passing my text you can see so

3:59:17

here I'm writing I have a string so I

3:59:18

have defined one prompt and here I'm

3:59:20

passing my description now see once I

3:59:23

will run it so definitely I will be

3:59:25

getting my prompt so here is what guys

3:59:27

tell me here is what here is my prompt

3:59:29

this is what this is my prompt okay it

3:59:31

is fine not an issue now guys what I

3:59:33

will do I'm going to pass this

3:59:35

particular prompt to my chat GPT all

3:59:38

right now what I can do I can pass this

3:59:40

particular promt to my chat GPT and over

3:59:43

here uh first of all let me copy and

3:59:46

paste this particular code or let me

3:59:48

write it down that so here I'm going to

3:59:50

write it down from open a

3:59:52

import open AI so this is what this is a

3:59:55

class now here what I'm going to do I'm

3:59:57

going to create object of this

4:00:00

particular class so here I'm going to

4:00:02

create a object of this particular class

4:00:04

so here I will write it down open Ai and

4:00:07

here uh what I'm going to do so here is

4:00:09

what here is my object now I can keep

4:00:12

this object inside one variable now here

4:00:15

I'm going to say my variable name is

4:00:17

what my variable name is client now if I

4:00:19

want to make a connectivity so for

4:00:21

making a connectivity what I need to do

4:00:23

tell me so here I need to pass my API

4:00:26

key so how I can do that so here is a a

4:00:29

parameter uh we need to pass one

4:00:31

parameter over here so the parameter

4:00:33

name is what parameter name is API unor

4:00:36

key so here I'm going to write it down

4:00:38

AP apore key and here I will pass my key

4:00:41

so my key is what my key is my key so

4:00:44

once I will uh run it so here you will

4:00:46

be able to find out this is what this is

4:00:48

my client so let me contrl Zed and here

4:00:52

is what here is my client so this is

4:00:54

what guys tell me this is my client now

4:00:56

by using this particular client

4:00:58

definitely I can call my chat completion

4:01:01

API so let's try to call this chat

4:01:03

completion API and here I have already

4:01:06

written the code for that so let me copy

4:01:08

paste uh I have written some sort of a

4:01:10

code already I kept in my notepad so

4:01:13

from there sometimes I will copy it uh

4:01:16

because I want to save my time otherwise

4:01:19

uh if I'm going to write each and every

4:01:20

line so definitely it's going to take

4:01:22

more time now here uh you can see so we

4:01:25

are going to call this chat completion

4:01:28

API now chat completion this is the

4:01:30

particular method that's it now here is

4:01:32

what here is my prompt now once I will

4:01:34

run it so you will be able to find out I

4:01:36

will be getting one response so here is

4:01:39

my response let me show you this

4:01:41

particular response and here is what

4:01:43

guys here is my response definitely I

4:01:46

can extract this response uh for that uh

4:01:49

what I need to do so here I just need to

4:01:51

write it down this

4:01:52

response uh response and this response

4:01:55

actually uh inside this response there

4:01:57

you will find out this choices so I will

4:02:00

write it down this dot choices dot

4:02:03

choices now I will run it so here you

4:02:05

will get this choices now from here what

4:02:07

I need to do

4:02:08

from here this is the list actually so

4:02:10

here I will write it on this zero zero

4:02:12

index whatever information is there on

4:02:15

this zero index now from here I'm going

4:02:17

to extract uh this particular

4:02:19

information now here I will write it

4:02:21

down this message message now here is

4:02:24

what this is my message actually and

4:02:26

from this message I'm going to write it

4:02:28

down I'm going to except this content so

4:02:30

here I'm going to write it down this dot

4:02:33

content now guys see this is what this

4:02:35

is my entire information now if I want

4:02:38

to convert this particular

4:02:40

information now if I want to convert

4:02:42

this particular information in Json

4:02:44

format so for that what I will have to

4:02:46

do so here actually what I'm going to do

4:02:48

I'm going to collect this thing in one

4:02:51

variable that is what that is my output

4:02:53

now here what I will do guys here I'm

4:02:55

going to import Json so here I'm going

4:02:57

to write it down import Json and here

4:02:59

I'm going to write down json. load now

4:03:02

to this load function I will uh provide

4:03:05

my variable my variable name is what my

4:03:07

variable name this output now here you

4:03:09

will find out uh is saying this json.

4:03:13

load it is giving me Str Str object has

4:03:16

no attribute read okay it's not going to

4:03:19

read let me check what is the correct

4:03:21

function just a

4:03:25

second so the function name is loads

4:03:29

here guys you can see so the uh the

4:03:31

method basically which I was calling so

4:03:33

the method name was loads so Json do

4:03:36

loads and here we are are passing this

4:03:38

output now you can see this is what this

4:03:40

is my output are you getting my point

4:03:43

guys are you able to see what I did I I

4:03:46

given this uh I given this prompt I

4:03:49

given this basically I given this

4:03:51

description to my model and I asked that

4:03:55

okay just give me this particular

4:03:57

information just give me this particular

4:03:59

information from this description and

4:04:01

here what I did I passed this particular

4:04:03

prompt to my tell me to my chat

4:04:07

completion API actually this chat

4:04:09

completion API is calling this GPD 3.5

4:04:12

turbo model and here guys you can see we

4:04:14

are able to get a response whatever

4:04:16

description we have given according to

4:04:18

that whatever prompt we have designed

4:04:20

and it is giving me that particular

4:04:22

response we have given a description we

4:04:25

have designed a prompt and according to

4:04:27

that only we are getting a response here

4:04:30

you can see this is a response actually

4:04:32

I have converted it into a Json format

4:04:34

so this is the first thing which I want

4:04:36

to show you now here guys see this type

4:04:40

of prompt it is called few short prompt

4:04:43

it is called few short prompt where I'm

4:04:46

giving my description and I'm saying

4:04:48

that okay so uh you need to behave like

4:04:51

this means whatever description I'm

4:04:52

giving to my model and here uh regarding

4:04:55

that particular description I want to

4:04:57

extract some sort of a

4:04:59

information so here actually this type

4:05:02

of prompt is called fuse short prompt

4:05:04

now directly I was asking something to

4:05:06

my model in my previous one in my

4:05:08

previous uh session so here actually

4:05:12

directly I was asking uh the question to

4:05:14

my uh model to my llm model so this is

4:05:17

called actually zero short prompt this

4:05:19

is what zero short prompt now here this

4:05:22

type of prompt actually is called few

4:05:24

short

4:05:25

promp getting my point this idea is

4:05:29

getting clear to all of you please do

4:05:31

let me know in the chat if you are able

4:05:33

to follow me till here please write it

4:05:35

down in the chat I'm waiting for your

4:05:37

reply

4:05:43

I'm sharing the text uh don't worry I

4:05:45

can share everything in the chat so just

4:05:47

a

4:05:49

second um here is a

4:06:05

text so here is a text guys

4:06:08

I

4:06:09

think it's

4:06:11

a it's a half text let me give you the

4:06:15

full so college and here is the full

4:06:21

text because it is having a word limit I

4:06:23

cannot uh like give more than 80 words I

4:06:27

think I cannot uh like paste more more

4:06:30

than 80 words in the inside the

4:06:36

chat

4:06:39

yes is it is it because we are asking

4:06:41

for a number of variable in a second

4:06:42

prompt correct your understanding is

4:06:45

correct

4:06:48

Goldie so zero short means we are not

4:06:51

defining anything over here directly we

4:06:52

are asking a question to my model now

4:06:56

what is a few shot so here we are giving

4:06:58

some sort of a description and based on

4:07:00

that particular description we are

4:07:02

asking regarding some information we are

4:07:05

asking some information okay so this is

4:07:08

called few shot and here is a zero shot

4:07:11

don't worry uh we have a many example

4:07:13

here I just given you the glimpse of

4:07:14

that just wait for some time one or two

4:07:16

more classes you will get more about it

4:07:19

because uh now we just we are going to

4:07:20

design The Prompt and all and in the

4:07:23

next session specifically I will I will

4:07:25

be working on the prompt on a different

4:07:27

different prompt and even uh for the uh

4:07:30

inside the project also we are going to

4:07:31

design a different different prompts got

4:07:33

it now see uh definitely we are able to

4:07:37

call our l m we are able to call our

4:07:39

like open a API and definitely we are

4:07:41

able to get our output also from the llm

4:07:45

models now here guys what is the use of

4:07:48

the function calling so first of all let

4:07:49

me uh Define one very basic function and

4:07:52

then I will Define one Advanced function

4:07:54

also so here what I'm going to do see

4:07:57

here I did this particular thing by

4:07:59

using this uh chat jpt Itself by using

4:08:02

this completion API now let me show you

4:08:04

the same thing by defining the function

4:08:06

so here what I'm going to do so here I'm

4:08:08

going to Define one function so let me

4:08:12

do one thing let me Define one function

4:08:14

and here this is my function guys see

4:08:17

I'm going to define the function this is

4:08:18

my function now from where I got this

4:08:21

particular format so you must be

4:08:23

thinking sir okay so sir you define this

4:08:25

function now from where you got this

4:08:27

particular format so just try to go

4:08:29

through with the open API and here uh

4:08:32

sorry open a documentation and here just

4:08:34

click on this function calling and once

4:08:36

you will scroll down over here so here

4:08:39

you will get the code s snippet so and

4:08:42

inside this code s snippet you will find

4:08:44

out this function definition that how to

4:08:46

decide or how to define this particular

4:08:49

function getting my point I will come to

4:08:52

this particular example I have designed

4:08:54

one example for all of you but first of

4:08:56

all let's try to understand a function

4:08:58

calling from uh like very basic example

4:09:02

and then I will come to the advanced

4:09:04

part so here you can see we have a

4:09:06

function

4:09:08

and from here itself I took this

4:09:09

function definition and how to decide

4:09:12

how to define this function and all now

4:09:13

let me tell you what I written over

4:09:15

there so here I have opened this uh

4:09:17

notebook now see uh what is the name of

4:09:20

this function actually student custom

4:09:22

function it's not a function like python

4:09:25

we write it down that Def and all it's a

4:09:28

like function basically which we are

4:09:29

writing down for the open AI U actually

4:09:32

we have to uh like pass this thing to

4:09:34

the uh to inside the chat complete API

4:09:38

itself I will come to that first of all

4:09:39

let's try to understand this uh

4:09:41

structure so first of all I I need to

4:09:44

write it on the name so here I have

4:09:45

written the name name is equal to

4:09:47

extract student information then we have

4:09:50

to write it on the description so here

4:09:52

you can see this is the description of

4:09:54

the function that why we are going to

4:09:56

Define it now here you will find out

4:09:58

some sort of a pairs so key and value

4:10:00

pairs so first we have a parameter so

4:10:02

here you can see we have a parameter now

4:10:04

uh we have a type so which type of uh

4:10:07

like object object we are going to be

4:10:08

defined over here and then we have a

4:10:10

properties now here you will find out

4:10:12

inside this parameter you will find out

4:10:14

a different different values like name

4:10:17

school grade and Club whatever actually

4:10:20

I Define over there inside my prompt the

4:10:22

same thing the same thing over here

4:10:25

right so first we have a name the second

4:10:27

thing we have a description the third

4:10:29

one we have a parameter inside the

4:10:31

parameter we have a different different

4:10:32

values like names school grade and Club

4:10:38

getting my point now here just see the

4:10:41

type of this name it's a string just see

4:10:44

the type of this school it's a string a

4:10:47

college you can write down the college

4:10:49

here is a college so let me write down

4:10:50

the college instead of this school so

4:10:53

here is what here is college so instead

4:10:55

of this is school I can write down this

4:10:57

college now here is college the type of

4:11:00

college is string right now here is a

4:11:03

grade now grade type is integer now here

4:11:05

is a club so Club type is integer again

4:11:09

I think you getting my point that how to

4:11:10

define this function it's a predefined

4:11:13

format or the Inon platform itself

4:11:15

you'll get this particular form format

4:11:17

now just run it okay now just run it and

4:11:21

after that what you need to do so here

4:11:23

see you need to uh call the chat

4:11:26

completion API so here is your chat

4:11:28

completion API let me copy this chat

4:11:30

completion API from here and let me

4:11:33

paste it down now here you need to

4:11:35

Define some sort of a parameter now let

4:11:38

me write it down those particular

4:11:39

parameter and then I will run it so here

4:11:42

guys you can see we have this message so

4:11:45

let me keep this message in a single

4:11:47

line so here I'm going to keep this

4:11:49

particular message in a single line so

4:11:52

here is what guys here is what here is

4:11:54

my message it is fine now after the

4:11:57

message what you need to do you need to

4:11:59

write it down one more parameter and the

4:12:01

parameter will be what the parameter

4:12:03

will be a function so here I'm going to

4:12:05

write it on the parameter the parameter

4:12:07

name is what function so here is my

4:12:10

parameter function now tell me what is

4:12:11

the name of the function so here the

4:12:14

name of the function is nothing it's a

4:12:16

student custom function so let try to

4:12:19

copy it and try to paste it over here

4:12:22

that's it you just need to copy the

4:12:24

function name from here and you need to

4:12:27

paste it over

4:12:29

here okay as a value of this particular

4:12:32

parameter now guys I can keep this

4:12:35

particular response in response two so

4:12:37

so here I'm going to write it down this

4:12:39

response to so here is what here is my

4:12:41

response to now let me run it and let's

4:12:43

see what I will be getting so here is

4:12:45

saying okay it is giving me error so I

4:12:47

think uh chat

4:12:50

completion role is fine I'm using client

4:12:53

only let me check with the

4:12:56

client yeah client uh now everything is

4:13:00

fine what is the issue I you code

4:13:03

incorrect API

4:13:05

provided okay okay just a second let me

4:13:11

use the correct client this is

4:13:15

fine and here I can keep the Cent c l i

4:13:20

e n t now

4:13:26

see uh it is saying that

4:13:29

incorrect invalid key uh why it is

4:13:36

so um just to check let me check this

4:13:39

key over here student custom information

4:13:43

prompt is fine U but before it was

4:13:45

giving me output now why it is saying

4:13:48

like that let me check with a key over

4:13:51

here so my key and here is what here is

4:13:56

my key just a second guys let me take a

4:13:58

correct

4:14:00

key

4:14:06

uh

4:14:08

okay don't worry I will delete this

4:14:10

particular key uh I'm running in front

4:14:13

of you everyone but after the session I

4:14:16

will delete it fine so now I am having

4:14:19

my key and here what I can

4:14:23

do again I can run

4:14:26

it

4:14:28

great now let's

4:14:33

see yeah now everything is working fine

4:14:35

so this is what this is my response to

4:14:37

two and here guys you you will find out

4:14:40

that we are getting a output so we are

4:14:43

getting output in whatever format we

4:14:45

have defined this thing so we have

4:14:47

defined this thing like uh name College

4:14:49

grade and club now here you will find

4:14:51

out the same thing so name is there

4:14:54

college is there grade is there and Club

4:14:56

is there if you don't if you want to

4:14:58

change any sort of a description you can

4:14:59

change it and you again you can check it

4:15:02

and now actually we are

4:15:03

not we we are not uh doing directly this

4:15:06

thing we are using a function over here

4:15:09

and this is a very basic use of the

4:15:11

function as of now which I have shown

4:15:13

you getting my point so directly also

4:15:16

you can do that you can call it but here

4:15:18

they have given the function by using

4:15:20

this function also you can call

4:15:23

it okay so here actually this is the

4:15:26

basic use of the function and at this

4:15:28

point of time you you won't be able to

4:15:30

find out any differences in a direct

4:15:33

call and in a function call both is

4:15:36

looking same but now the difference will

4:15:39

start once I will explain you the second

4:15:42

example now over here you can see so

4:15:44

this is the response which I'm getting

4:15:46

now let's try to extract the response so

4:15:48

over here what I can do I can write it

4:15:50

down this a contain and let's see what I

4:15:52

will be getting over here so here is

4:15:55

what here is my uh content which I want

4:15:58

okay which I want to extract from here

4:16:00

so let me copy it and let me paste it

4:16:02

over here actually I want to extract the

4:16:04

content so that's why I'm going to be

4:16:05

write down response to Choice message

4:16:07

and content so once I will done it and

4:16:10

over here I will be getting this content

4:16:13

so here I am getting this content now

4:16:16

let me check over here okay actually see

4:16:20

here actually we have to get the content

4:16:22

from the function call so till message

4:16:24

it's fine so let me check with the

4:16:26

message till message I think it is fine

4:16:28

now if I want to extract the content now

4:16:30

so over here I will have to call this uh

4:16:32

I will have to write it down this

4:16:33

function call because before I was

4:16:35

extracting the message because directly

4:16:37

I did it directly I I called my llm

4:16:40

model now here I'm calling it but by us

4:16:43

using function so here I've defined the

4:16:45

format in a function I have defined the

4:16:47

format of the function and now by using

4:16:49

this function I'm calling my API so the

4:16:52

the API is hitting the model and

4:16:54

whatever output desired output I want

4:16:57

I'm getting it now over here what I will

4:16:59

do so here I'm going to write it down

4:17:01

this uh dot function call so let me copy

4:17:04

and paste it over here function

4:17:07

underscore call now over here guys you

4:17:09

can see we are getting this particular

4:17:11

value now let me write it the argument

4:17:13

over here arguments and this is what

4:17:15

this is my output now yes same thing we

4:17:18

can do over here as well so here I can

4:17:20

write it down this uh Json Json do loads

4:17:25

and here what I can do I can write down

4:17:27

the json. loads and now see I'm getting

4:17:30

a same output but see guys here at this

4:17:34

point of time definitely you are not

4:17:36

able to find out a difference between

4:17:38

the direct function call and between

4:17:40

this uh direct call and this function

4:17:42

call right now I will show you one

4:17:45

Advanced example and by seeing that

4:17:47

particular example definitely you will

4:17:49

be able to discriminate getting my point

4:17:52

so till here everything is fine are you

4:17:54

able to do it don't worry I will give

4:17:56

you the code and I will give you each

4:17:58

and everything whatever I'm writing over

4:18:00

here and uh this file and all it will be

4:18:03

available inside my resource section so

4:18:05

here is the resource section guys uh so

4:18:07

just try to enroll into the course and

4:18:09

uh yes definitely you will be able to

4:18:11

get this particular file inside this

4:18:12

resource section and this is completely

4:18:14

free you no need to pay anything you no

4:18:17

need to P you don't need to pay actually

4:18:19

a single rupees for this for this

4:18:21

particular dashboard so please try to

4:18:23

enroll and try to download the resource

4:18:25

from there so till here everything is

4:18:28

fine please give me a quick yes then I

4:18:30

will proceed with a further

4:18:35

topic

4:18:42

what is the difference between Json and

4:18:43

function call so here you will find out

4:18:45

so just check the type of this output so

4:18:48

here you will find out the type of this

4:18:50

output is nothing let me show you it's a

4:18:54

string now here I have converted into a

4:18:56

Json that's it okay I don't I I don't

4:18:59

want to keep it in a a string because uh

4:19:01

it's not looking good to me if you will

4:19:03

print it now if you will print it guys

4:19:07

see it's not looking good to me that's

4:19:09

why I converted into ajason now if you

4:19:11

will check the type of this particular

4:19:13

output so here you will find out a Json

4:19:16

let me write it down the type over here

4:19:18

and let me print it now so here is what

4:19:21

guys tell me here is nothing it's a Jon

4:19:23

not dictionary got it so this is fine to

4:19:26

everyone I think till here everything is

4:19:35

clear

4:19:41

great now let's start with the second

4:19:43

concept so over here uh the first

4:19:46

concept actually I shown you the basic

4:19:48

use of the function and all now let's

4:19:49

try to understand the advanced use of

4:19:52

this function calling so over here guys

4:19:54

see uh we have few more thing regarding

4:19:56

these functions and all so first of all

4:19:58

let me tell you that now let's say if

4:20:00

you want if we are passing a description

4:20:02

of two student all together so it can

4:20:06

handle that thing also it can handle

4:20:08

that thing also now over here let me

4:20:10

show you that particular uh that

4:20:12

particular thing also just a wait uh I

4:20:14

have I have a code for that and I'm

4:20:16

going to copy and paste see guys so what

4:20:18

you need to do so over here I just

4:20:20

written one for Loop and let me show you

4:20:23

that particular for Loop and here see

4:20:25

inside this for Loop what I have written

4:20:28

so first of all I Define one uh list and

4:20:32

inside this list we have a two

4:20:34

description so the first one you know uh

4:20:36

already I written this particular

4:20:37

description now let me uh let me run it

4:20:41

okay so what was the name of that so

4:20:44

just a wait let me check

4:20:51

um okay where I have written this

4:20:53

student I think this one so that name

4:20:56

the name of the variable is student

4:20:58

description so let me copy and paste

4:21:00

over here let me copy and paste this

4:21:02

student description so this is what this

4:21:04

is the student description this is the

4:21:05

first one so let me

4:21:07

write it down student description over

4:21:08

here now let me keep it over here now

4:21:11

student description now I'm going to

4:21:13

Define one more so here I'm going to

4:21:14

create one more variable and here

4:21:17

student description

4:21:18

two and here guys what I will do again

4:21:21

I'm going to copy and paste a same thing

4:21:24

so this is the value which I'm going to

4:21:25

copy and paste and I'm going to do some

4:21:26

sort of a changes over here so instead

4:21:29

of this s Savita I'm going to write down

4:21:30

something else so let's say I'm going to

4:21:32

write it down Krish n so and here

4:21:35

Krishna is a student of a compter

4:21:36

computer science I uh maybe instead of

4:21:38

this delh let me change the name so here

4:21:41

is what here is Mumbai now here he is a

4:21:43

cgpn so he's having more than 9.5 cgpa

4:21:47

so let me write down this like cgpa as

4:21:50

well and here let me change the name so

4:21:52

instead of Sunny what I'm saying I'm

4:21:54

saying Krish is known for his

4:21:56

programming skill and he's a member of

4:21:59

here I can write down DS Club data

4:22:01

science club data science club so here I

4:22:04

am giving an information regarding

4:22:07

two student now here see he hopes to

4:22:10

pursue in a career in artificial

4:22:11

intelligence after graduating something

4:22:13

else right so now what I will do let me

4:22:15

run it and let me keep this particular

4:22:18

description over here so here what I'm

4:22:20

going to do I'm going to keep this

4:22:21

particular description now what I will

4:22:23

do so over here uh I I'm just going to

4:22:26

run the for Loop and here you can see

4:22:29

one by one the description is coming and

4:22:31

it is going through this particular uh

4:22:34

completion API this Chad completion API

4:22:36

and I will be getting a response so

4:22:38

let's try to make some changes over here

4:22:40

because it's a like old code let me give

4:22:43

the latest one over here so this is the

4:22:45

latest let me copy and paste the latest

4:22:49

function so here is what here is a

4:22:51

client chat completion. create now over

4:22:55

here the model name is what model name

4:22:57

is same now here message uh it's the

4:23:00

same this one now let me write down the

4:23:02

student so it will be more uh like clear

4:23:04

to all of you so here here uh you can

4:23:07

see we are calling a function now here

4:23:09

guys see we are calling which function

4:23:11

this particular function let me copy the

4:23:13

same name so here the function name is

4:23:15

what student custom function so here I'm

4:23:17

going to copy the name of the function

4:23:19

and let me paste it over here so this is

4:23:22

what guys tell me this is my function

4:23:23

name and here is function call is auto

4:23:25

right automatically the function is

4:23:27

going to be called now what I want tell

4:23:29

me I want a response so over here I'm

4:23:31

going to print this particular response

4:23:33

and let's see we'll be able to get a

4:23:35

correct response or not so if I'm going

4:23:38

to run it guys so you will be able to

4:23:40

find out a response regarding two

4:23:41

description so it is saying that check

4:23:44

completion is not a subscribable okay so

4:23:47

over here I think I will have to paste

4:23:49

this thing now let me copy it and let me

4:23:55

paste it over here

4:23:57

so this is the one I think it is fine

4:24:01

now and this is going to be a response

4:24:05

so response whatever response we are

4:24:06

getting there is a choice and inside

4:24:08

that we have a message and finally

4:24:10

function call and from there we are

4:24:12

going to collect a argument so once I

4:24:15

will this argument actually this

4:24:16

arguments you can map this argument with

4:24:18

this thing this uh thing basically which

4:24:20

I have written over here inside the

4:24:21

function name College grade and

4:24:25

Club getting my point so here what I'm

4:24:27

going to do now here I'm going to run it

4:24:29

and let's see what I will be getting

4:24:32

so once I will run it definitely I will

4:24:35

get a response great so here it is

4:24:37

giving it has given me a response

4:24:39

regarding the first uh description and

4:24:41

now guys you can see it has given me a

4:24:43

response regarding the second

4:24:44

description so the first one is s sabida

4:24:47

and the second is kishna you can give as

4:24:49

many as uh like description in all so

4:24:51

over here let me take the third one and

4:24:54

let me keep it over here and here I can

4:24:56

say so here student description three

4:25:00

three now over here instead of this

4:25:02

krishak let's say I'm going to write

4:25:04

down one more name let's say sudhansu

4:25:06

Kumar and here I can say that he's a

4:25:09

student of

4:25:10

IIT Hyderabad or I let's say uh

4:25:16

Bangalore now over here he's a Indian

4:25:19

he's having a cgp around let's say 9.2

4:25:22

and he's programming skill and he's a

4:25:24

active member of mlops club now let me

4:25:27

write it down over here mlops Club so

4:25:30

now yes I have given this particular

4:25:32

description over here and if I'm going

4:25:34

to copy it and let me paste sit over

4:25:36

here so regarding this description also

4:25:39

definitely we'll be able to call our

4:25:40

model we'll be call our API and finally

4:25:43

we'll be getting a output it's doing the

4:25:45

same thing which our chat completion API

4:25:47

is doing directly without function right

4:25:50

now we are doing along with a function

4:25:53

along with a multiple description

4:25:55

getting my point so here this is the

4:25:57

basic use actually basic use of the

4:25:59

function after this one I will come to

4:26:01

the advanc use just wait now over here

4:26:03

see if I'm going to run it so let's see

4:26:05

what I will be getting uh so here I will

4:26:08

be getting a First Response yes this is

4:26:11

my first response now this is the second

4:26:14

response and here you can see there is

4:26:18

the third response getting my point guys

4:26:21

yes or no we can call our llm model we

4:26:24

can we can call our API we can hit the

4:26:26

model and we can summarize the result

4:26:29

according to the prompt if this thing is

4:26:32

clear to all of you then please write it

4:26:34

down yes in the chat please do let me

4:26:36

know in the chat guys if this part is

4:26:38

clear to all of

4:26:41

you yes it's a case sensitive whatever

4:26:44

variable you are going to Define in the

4:26:45

function col it's a k so please make

4:26:47

sure that you are going to write it down

4:26:49

the correct

4:26:59

name after this one the use of the

4:27:01

function call will be clear just wait

4:27:04

okay fine now this thing is clear to all

4:27:06

of you now let me come to the next point

4:27:08

so here actually what we are going to do

4:27:10

see uh we are going to call a single

4:27:13

function right regarding this particular

4:27:15

description uh this is my function but

4:27:19

we can call a multiple function also we

4:27:22

can call a multiple function also so

4:27:25

here guys let's say if we are going to

4:27:26

define a one more function here let's

4:27:29

say if we going to define a one more

4:27:31

function so you can Define any sort of a

4:27:33

function over here let's say function

4:27:35

two let me write it down over here

4:27:37

function 2 function _ 2 you can define a

4:27:41

second function and after defining see

4:27:44

you will Define in a same format

4:27:45

whatever format is there this one in

4:27:48

this format itself so in this format

4:27:51

whatever format I have written now the

4:27:53

variable and the parameter and the

4:27:54

description U and those thing will be

4:27:57

changed but the format will be a same

4:27:59

because the same format which you will

4:28:01

be find out over the tell me over the

4:28:04

open a API s they already have given you

4:28:07

that so this is what this is my function

4:28:08

two now you can like Define a function

4:28:11

two whatever information you want so

4:28:13

let's say I just want this grade and

4:28:14

club or whatever so right so if I'm

4:28:17

going to remove it you can remove it or

4:28:18

maybe you can Define one more function

4:28:20

for some other information right and now

4:28:22

if you want to call it so how you will

4:28:25

do that tell me so for that actually uh

4:28:28

here I have created this uh list right

4:28:31

here we have created a list of the

4:28:33

student information regarding a

4:28:34

different different description

4:28:36

now here again I can create one more

4:28:38

list the list basically the list

4:28:41

regarding this function so here what I

4:28:43

can do I can copy this code and I can

4:28:45

paste it over here this particular code

4:28:47

and here what I can do I can create one

4:28:49

more list and inside this list what I

4:28:51

can do I can write it down the function

4:28:53

so here is what let me a copy and paste

4:28:56

so this see this is what this is my

4:28:57

function parameter now here we have a

4:29:00

first function and we have a second

4:29:01

function so this is this is my first

4:29:03

function which I defined already this

4:29:05

one so let me copy this particular name

4:29:07

and let me paste it over here this one

4:29:09

so this is what tell me guys this is my

4:29:11

first function which I'm going to write

4:29:12

down over here and this is my second

4:29:14

function already I given the same name

4:29:16

so like this you can call a multiple

4:29:18

function

4:29:20

also getting my point so here I have

4:29:22

defined this function and according to

4:29:24

that I'm getting my desired output

4:29:26

desired parameter you can create one

4:29:28

more function on top of a same

4:29:30

description and here you just need to do

4:29:33

one thing instead of this specific

4:29:35

function you just need to write it down

4:29:36

this function you just need to provide

4:29:38

this list and you are done according to

4:29:41

the definition you will get output so

4:29:44

this is your assignment you have to do

4:29:46

by yourself I have given you the way I

4:29:48

have given you the path now just Define

4:29:50

a second function regarding whatever

4:29:52

information is there inside the

4:29:54

description whatever you want to extract

4:29:56

just Define a function and call it over

4:29:59

here so here I can mention this thing as

4:30:01

assignment don't worry each and

4:30:03

everything I will provide you uh this

4:30:05

notebook will be available in the

4:30:06

resource section you can download from

4:30:10

there this is what this is your

4:30:12

assignment guys now here this part is

4:30:15

clear that uh we are calling up llm so

4:30:19

here directly we are calling llm then

4:30:21

what we are going to do see we have

4:30:22

designed a prompt directly we are

4:30:23

calling llm then what we are going to do

4:30:25

we have Define a function then uh like

4:30:28

we are getting that particular output

4:30:29

that is also fine now we are going to

4:30:31

call our llm by using openi with respect

4:30:34

to different different description that

4:30:35

is also fine means regarding a like

4:30:38

different different description on the

4:30:39

same time now we can Define two function

4:30:41

as well more on more than two function

4:30:43

that is also fine now what is the actual

4:30:46

use of it still we are not able to find

4:30:48

out the actual use of this function

4:30:50

everything is looking same now let me uh

4:30:54

explain you that particular part I'm

4:30:56

coming to the advanced example now so

4:30:59

over here what I'm going to do I have

4:31:00

written one Advanced example and uh let

4:31:04

me copy and paste uh the code basically

4:31:06

which I have written step by step I will

4:31:09

copy and paste don't

4:31:20

worry okay so here guys see again I'm

4:31:24

going to start from

4:31:25

scratch now Advanced example of function

4:31:34

call

4:31:36

Advanced example of function calling

4:31:42

okay now over here guys see uh what I'm

4:31:45

going to do I'm going to call my chat

4:31:47

GPT so here I'm going to copy and paste

4:31:51

one code now this code actually we have

4:31:54

defined something over here so here I'm

4:31:57

saying uh what I'm asking I'm asking to

4:31:59

my llm that what is the next flight from

4:32:03

so here I let me change the name let me

4:32:05

write it down Delhi to Mumbai so here

4:32:08

I'm going to write it down what would be

4:32:10

the next flight from Delhi to Mumbai

4:32:13

this is my prank now just tell me guys

4:32:16

will my Chad GPT able to answer for this

4:32:19

particular

4:32:21

question my CH chat G is able to answer

4:32:23

for this particular question the

4:32:25

question which I'm asking over here I

4:32:27

want your uh like p uh like I want your

4:32:31

opinion on that please write down the

4:32:32

chat I'm asking to all of you can my

4:32:36

chat GP answer for this particular

4:32:41

question no why why it cannot be answer

4:32:46

because like this chat GPT has stayed on

4:32:49

the limited amount of data right so not

4:32:51

a limited amount of data it has stay on

4:32:54

uh the data basically which is available

4:32:55

till September

4:32:57

2021 getting my point if you look into

4:33:00

the chat GPT if you look into the open a

4:33:02

just just go with the open AI uh not

4:33:04

this one so where it is this one so here

4:33:07

guys just just uh go over here and uh

4:33:10

what you can do you can go into the

4:33:13

models now over here just click on this

4:33:15

GPD 3.5 and uh just look over here

4:33:19

training data so it has trained up to

4:33:21

September 2021 data up to this

4:33:25

particular data that's why it won't be

4:33:28

able to answer for this particular

4:33:30

question whatever I'm going to write it

4:33:31

down here now let me run it and let's

4:33:34

see the response that what response I

4:33:36

will be getting so over here uh yes it

4:33:39

is giving me a response let's wait for

4:33:41

some time I got a response now and here

4:33:44

I'm going to run it so see what it is

4:33:46

saying that it is saying that as an AI

4:33:49

language model I don't have a realtime

4:33:52

information however you can easily find

4:33:54

out next flight from Delhi to Mumbai by

4:33:57

checking the website or mobile apps of

4:33:59

Airlines so that operate the route such

4:34:02

as air india indigo spice jet vistara go

4:34:05

Additionally you can contact travel

4:34:07

agency or use online flight scratch

4:34:10

engine for up to date now just tell me

4:34:12

if you are going to create if you're

4:34:14

going to create any chatbot by using

4:34:16

this open API so will you give this type

4:34:19

of answer to your user if your user is

4:34:22

going to ask you that what is the next

4:34:24

flight from Delhi to Mumbai definitely

4:34:26

you will have to do some sort of a jugar

4:34:28

right you will have to extract the

4:34:30

information from

4:34:32

somewhere you you cannot give this type

4:34:35

of answer right so you will have to make

4:34:37

your chatboard that much of that much

4:34:39

capable you you have to make your

4:34:42

application that much capable so it can

4:34:43

answer for this type of question as

4:34:46

well okay now let me tell you uh the use

4:34:49

of the function calling over here that

4:34:51

how function calling can help to us so

4:34:54

over here what I'm going to do here I'm

4:34:56

going to Define one

4:34:57

function what I'm going to do guys here

4:35:00

I'm going to Define one function so this

4:35:02

is what this is my function just like

4:35:05

observe step by step don't run anything

4:35:07

don't write it down any sort of a code

4:35:09

just observe whatever I'm explaining to

4:35:11

you that's it so here is what here is my

4:35:14

function function description now we

4:35:16

have a name of the function get flight

4:35:18

info we have a description get flight

4:35:21

information between two location now

4:35:24

here we have a parameter and inside

4:35:25

parameter we have two things so the

4:35:28

first one you will find out that is what

4:35:30

that is a location origin and location

4:35:32

destination so in my case what is the

4:35:35

origin

4:35:37

delhi now here in my case like whatever

4:35:41

prompt or whatever question I'm asking

4:35:42

in that case the destination is what

4:35:44

destination is tell me

4:35:47

Mumbai so there is two parameter I have

4:35:51

here is a type here is a description

4:35:53

here is a type here is a description

4:35:55

that's it so let me let me change

4:35:57

something inside the description also so

4:35:59

here I'm I can write it down Delhi d e l

4:36:02

and here let me write it down the Mumbai

4:36:04

mu M mu M so this thing is fine now here

4:36:09

if you will observe so I have mentioned

4:36:11

one more thing I have mentioned one more

4:36:14

parameter over here the parameter name

4:36:16

is what the parameter name is required

4:36:18

now what is required location required

4:36:22

origin location required and destination

4:36:24

is required two things is required over

4:36:27

here okay that is fine till here

4:36:29

everything is fine we are able to

4:36:30

understand but still we didn't get a

4:36:32

complete idea how you will get it first

4:36:34

of all let me run the entire code right

4:36:37

so here you can see we have a

4:36:39

description so let me run it and this is

4:36:41

fine this is like perfectly fine now

4:36:44

here I have a prompt so let me copy The

4:36:47

Prompt over here I'm not writing from

4:36:49

scratch because it might takes time so I

4:36:52

already return in my notepad and all

4:36:53

somewhere so I'm just going to copy and

4:36:55

paste that's it so here guys um I'm

4:36:58

asking to my chat GPD or sorry I'm

4:37:00

asking to my GPD model when is the next

4:37:03

flight from New Delhi to Mumbai this is

4:37:06

my question now over here if I'm going

4:37:08

to run it so here guys you will see that

4:37:10

okay so this is my this is my user Prem

4:37:12

now what I'm going to do now I'm going

4:37:14

to copy it now I'm again I'm going to

4:37:16

copy the same thing this one and I'm

4:37:18

hitting this particular prompt so here

4:37:20

is what here is my model here is my role

4:37:23

role is what role is a user and here is

4:37:25

my prompt getting my point now here now

4:37:29

I'm passing my function just focus over

4:37:32

here just focus now over here I'm

4:37:34

passing passing my function function

4:37:36

underscore description this is what this

4:37:38

is my function description now see over

4:37:40

here uh this is my prompt and if I'm

4:37:43

going to run it now if I'm going to run

4:37:45

it now now you will see the response

4:37:47

that what response I will be getting

4:37:49

before actually I was getting this

4:37:50

particular

4:37:51

response before I was getting this

4:37:54

response now just look into the response

4:37:56

that what will be the response over here

4:37:57

so here what I'm going to do I'm going

4:37:59

to copy the same thing uh this

4:38:02

particular thing and here I'm going to

4:38:05

write it down response to response to

4:38:07

choice choice message and contain so

4:38:10

once I will run it so here you can see

4:38:12

it's not giving me anything okay so why

4:38:14

it is not giving me let me show you

4:38:16

because there is no such content there

4:38:18

is no such content that's why it is not

4:38:20

giving me anything now let me print till

4:38:22

message only and you will find out the

4:38:25

uh the like values over here so over

4:38:27

here guys see if I'm going to print till

4:38:30

message so it is giving me a message

4:38:31

whatever message I'm getting step by

4:38:33

step we'll try to understand it don't

4:38:34

worry now here let me copy this thing

4:38:36

and let me check with this particular

4:38:39

argument so here I'm going to copy this

4:38:40

argument and let's see what argument we

4:38:43

have uh so over here it is saying okay

4:38:45

first of all I need to call this

4:38:47

function call and then only I can call

4:38:49

this argument uh not an issue fine now

4:38:52

over here we have a argument see we have

4:38:54

two argument first is loc uh location

4:38:57

origin that's a Delhi and location

4:38:59

destination that's a

4:39:00

vom getting my point guys see it is

4:39:03

going to extract from here location

4:39:05

origin and location destination and here

4:39:07

is Delhi here is Mumbai this is a

4:39:09

location origin location destination now

4:39:11

it is not giving me answer but it is

4:39:13

going to it is it is it is able to

4:39:15

extract something right from this

4:39:17

function call and here you can see these

4:39:20

are this is two argument right there you

4:39:23

will find out two argument this is the

4:39:24

argument basically which we are able to

4:39:26

get it from here because we have already

4:39:28

defined it over here this thing okay

4:39:30

that is fine this is clear to all of you

4:39:31

now guys see how you will uh give this

4:39:35

uh like flight actually so for that you

4:39:38

will have to call any third party API

4:39:40

then only you will be able to provide

4:39:42

the information now right so let's say

4:39:45

if I'm talking about the make my trip so

4:39:47

what it does it is having access of a

4:39:49

different different API if I'm going to

4:39:50

book any train ticket so is calling the

4:39:52

IR CZ API and is giving me the entire

4:39:55

detail make my trip is not a owner of

4:39:58

the Railway where it is having the

4:40:00

entire data entire information of the

4:40:03

Railway Indian Railway no

4:40:05

IRCTC actually it's a organization

4:40:08

actually that is a portal which is like

4:40:10

governed by the uh Indian government and

4:40:13

like it it is having some sort of apis

4:40:15

and all which is being called by the

4:40:17

make my trip or any other website and

4:40:19

because of that only you are able to get

4:40:20

an information whatever rails and all

4:40:23

whatever flights and all you are going

4:40:24

to find out over there or maybe some

4:40:27

other website right so here what you

4:40:29

will do for getting this information you

4:40:30

will call the API any third party API

4:40:33

now here see I'm not going to call any

4:40:35

sort of API I'm giving you as assignment

4:40:37

this thing so you can call any sort of

4:40:40

API you can explore a different

4:40:41

different API and you can accept the

4:40:43

information from there I'm uh I can uh

4:40:46

give you the very basic name rapid API

4:40:48

just go through go and check with the

4:40:49

rapid API there you will get the each

4:40:51

and every API related to the weather

4:40:53

related to the different different thing

4:40:54

as of now what I did actually I created

4:40:56

my own function which is working as a

4:40:58

API I created my own function which is

4:41:00

working as a API now let me give you

4:41:02

that uh let me show you that particular

4:41:04

function so here what I did I have

4:41:06

created my own function which is working

4:41:08

as a API you can think this working as a

4:41:11

API but you can call your real time API

4:41:14

for extracting a real data don't worry I

4:41:17

will show you that thing I will uh show

4:41:18

you how you can call the Sur API in my

4:41:20

next class when I will discuss about the

4:41:22

agents in a lang chain there I will

4:41:24

discuss about the Sur API and all so

4:41:26

over here you can see guys we have a uh

4:41:28

I have created one function get flight

4:41:30

info location origin location

4:41:32

destination now here I'm going to be uh

4:41:34

like here I written some sort of a code

4:41:36

that is what that is nothing as a flight

4:41:37

information and it is in a dictionary

4:41:39

format so here we have a location origin

4:41:41

destination date time Airlines and

4:41:43

flight this is the airlines time and

4:41:45

this is the flight number and all now

4:41:47

here this function is working as a API

4:41:50

you can think like that now if I'm going

4:41:52

to run it so over here uh it is working

4:41:55

fine now guys see what I'm going to do

4:41:58

here so this function is working fine

4:42:00

now here uh I'm going to collect this

4:42:03

origin and this destination so first of

4:42:06

all let me show you this particular

4:42:07

thing uh argument I already shown you

4:42:10

this one this is my

4:42:13

argument and over here uh what I'm going

4:42:16

to do I'm going to be convert this

4:42:19

argument into a Json so

4:42:21

json. loads now over here what I'm going

4:42:25

to do so let me run it and here I am I

4:42:28

having two argument uh first is Delhi

4:42:30

and the second is Bombay this is my

4:42:32

origin and this is my destination so

4:42:34

this thing this information I'm going to

4:42:35

collect in my like a variable that is

4:42:38

perams now over here we have a variable

4:42:40

that is perams now from here I'm going

4:42:42

to extract few more information I want

4:42:44

to extract the origin and the

4:42:46

destination so for that I already

4:42:47

written the code let me copy and paste

4:42:49

so this is my origin so I'm calling this

4:42:52

get uh method on top of this uh

4:42:54

dictionary actually this is my

4:42:55

dictionary and I'm extracting a value of

4:42:57

this particular key as like this I'm

4:43:00

extracting a value of this particular

4:43:01

key you you can see over here let me

4:43:03

show you so this is what this is my

4:43:05

dictionary now on top of this dictionary

4:43:07

if I will call this get method now uh by

4:43:10

using this uh key so get and over here

4:43:14

what I will do I'm going to write it on

4:43:15

the key so the key name is what location

4:43:18

uncore origin now over here see if I'm

4:43:22

going to run it now you will find out

4:43:23

this Delhi so this is my origin and here

4:43:26

you will find out the destination

4:43:28

similarly I can get the destination also

4:43:29

now it's not a big deal see now over

4:43:32

here I can call this a destination why

4:43:35

I'm doing it entire thing will be clear

4:43:37

and I will give you the quick revision

4:43:38

also just wait for some time just wait

4:43:40

for more 5 minute everything will be

4:43:42

fine so Delhi is there Delhi and Bombay

4:43:44

is there so here we have origin and

4:43:46

destination now we got both origin and

4:43:49

destination right so parameter is uh we

4:43:51

are able to get a parameter we are able

4:43:53

to get origin and destination now let's

4:43:55

try to find out the flight detail right

4:43:57

so let's try to fly find out the F

4:43:59

flight detail so for that basically what

4:44:01

I'm going to do here I'm going to call

4:44:05

one uh so here I'm going to call one

4:44:07

method that is a a right so what this a

4:44:10

will do so here actually I'm going to

4:44:11

pass the name so let me show you this

4:44:13

particular value what is happening over

4:44:15

here so just a wait let me copy and

4:44:17

paste over here so this is what this is

4:44:19

the name this name is what this is the

4:44:21

function name get flight information

4:44:23

right now I'm giving this uh function

4:44:26

name uh this uh function name this GL

4:44:28

get flight info which is a string as of

4:44:30

now let me show you the type of this

4:44:32

function over here so over here what I'm

4:44:33

going to do here I'm going to write it

4:44:35

down type of this function so this type

4:44:37

of the function is nothing it's a string

4:44:40

only so let me uh keep it inside the

4:44:43

bracket so this is what this is a string

4:44:44

now if I'm passing this thing to my eval

4:44:46

function eval method so you will get the

4:44:49

actual function this eval is doing

4:44:50

nothing this EV is giving you the actual

4:44:52

value that's it this is what this is the

4:44:54

function now we have defined get flight

4:44:56

information it will give you the actual

4:44:58

value that's it so here you can see it

4:45:00

is giving me the function only this is

4:45:02

what this is my function this get flight

4:45:04

info is what it's a function now it's

4:45:05

not a string we have already defined it

4:45:07

over here see this one so this is doing

4:45:09

nothing it is just giving me actual

4:45:11

value okay now let me show you one

4:45:13

example very basic example let's say if

4:45:15

I'm going to write down and here if I'm

4:45:17

going to write down two now tell me what

4:45:19

is this two if I'm going to write down

4:45:21

like this uh type and here I'm going to

4:45:25

write it down two just tell me what is

4:45:27

this it's a string but two is a string

4:45:30

no it's an

4:45:31

integer right it's a integer so if I'm

4:45:34

I'm going to write it down like this now

4:45:35

if I'm passing to my so it will provide

4:45:37

an integer see this is what this is an

4:45:38

integer if you check with the type so

4:45:40

type the type will be an integer only so

4:45:43

it is converting whatever value we are

4:45:46

passing into the well method now it is

4:45:47

converting into a original format into a

4:45:49

original form so here we are getting a

4:45:51

function so this is what this is my

4:45:52

function which I collected over here now

4:45:54

I just need to call this particular

4:45:56

function so here I'm going to call this

4:45:58

function now after calling this

4:46:00

particular function I will be get see

4:46:02

here I'm going to pass the parameter

4:46:04

keyword argument keyword par like this

4:46:06

this particular parameter params this

4:46:07

one okay location origin and location

4:46:10

destination this two thing we want over

4:46:12

here this one right now once I will run

4:46:15

it so here I will be getting my details

4:46:18

so let me run it first of all uh where

4:46:20

is a perms here is a perms and here is

4:46:22

what here is my flight details so name

4:46:25

date time is not defined let me Define

4:46:29

the date time over

4:46:31

here so from date time on of date time

4:46:37

import date time and it is done I think

4:46:42

now let me run

4:46:44

it time Delta is not defined let me

4:46:48

check what all import statement is there

4:46:52

just a

4:46:54

wait time Delta also we can import from

4:46:57

here itself so this is going to be a

4:47:00

time Delta great now let me run it and

4:47:04

over here you will find out a detail see

4:47:07

so actually what we are going to do uh

4:47:10

this function actually uh you can think

4:47:13

it's a it is working as a API got it now

4:47:17

here what we are going to do so we are

4:47:18

extracting a information from the uh

4:47:21

like whatever prompt and all we are

4:47:22

passing now so from there basically we

4:47:24

are extracting an information and we are

4:47:26

collecting a detail of the flight okay

4:47:28

from U like this is the response

4:47:30

actually see first what I did I defined

4:47:32

a function this is what this is my

4:47:33

function

4:47:35

this is what this is my function right

4:47:36

after that we are calling the uh after

4:47:39

that we are hitting to the uh like model

4:47:41

by by using this open API now after

4:47:44

hitting it so actually whenever we are

4:47:47

checking with a response so in argument

4:47:49

actually in a function argument we have

4:47:50

this two thing now by using this two

4:47:52

thing now what we are going to do so we

4:47:54

are uh like extrating the information

4:47:57

from here so as of now this is this

4:47:59

function actually you can think it's my

4:48:01

API but you can call actual API by using

4:48:04

this particular information that is what

4:48:06

I'm doing over here just just think over

4:48:07

here that is what I'm doing so now what

4:48:09

I did what I got tell me guys so I I

4:48:13

collected the information whatever see I

4:48:15

Define the thing inside my function

4:48:18

inside this particular function okay

4:48:19

this one this is the value this is the

4:48:21

like parameter which I defined now I uh

4:48:24

I like called my model I called my open

4:48:26

API and it is hitting the model right so

4:48:29

whatever response I'm getting now from

4:48:31

that particular responses I'm getting

4:48:33

this particular argument because my chat

4:48:36

GPT is not able to answer for this

4:48:37

particular question and by using this

4:48:39

argument I'm hitting my API I'm hitting

4:48:42

my API and after hitting the API guys

4:48:45

you can see this is the detail this is

4:48:47

the information I'm

4:48:49

getting okay by using those particular

4:48:51

argument now let me show you the

4:48:53

complete one so once we are getting this

4:48:55

particular information the flight

4:48:56

information regarding those particular

4:48:58

argument okay you can create an end

4:49:00

application here I'm showing you in a

4:49:01

notebook itself so here see guys what

4:49:04

I'm getting now give you the final code

4:49:06

so we are getting this particular

4:49:07

information and is done now let me uh go

4:49:12

for the final call so here you can see

4:49:16

uh I can keep it as a uh response three

4:49:18

client chat completion create now here

4:49:21

is what here is my model and here is

4:49:23

what here is my user prompt whatever

4:49:24

prompt I I'm passing now see guys over

4:49:26

here see role is what role is a function

4:49:29

now I have changed the role okay uh here

4:49:31

is a role role is a user now role is a

4:49:33

function function now this is the value

4:49:35

I'm extracting from the function

4:49:37

whatever function I'm defined and here

4:49:39

is what here is a like content basically

4:49:41

which I'm passing this is what this is a

4:49:42

flight right so this is the argument

4:49:44

which we are extracting from the

4:49:46

function whatever function I have

4:49:47

defined right and then this is what this

4:49:50

is my function description that's it

4:49:51

right so here see guys uh my role role

4:49:54

as a user as a role as a user basically

4:49:56

what I'm asking to my uh chat GPT or

4:49:58

sorry to my GPT model let me show you

4:50:01

that so over here what I'm going to do

4:50:03

I'm going to print it this user prompt

4:50:05

this is my question this is my prompt

4:50:07

this is what basically which I'm going

4:50:08

to ask right now over here roll again I

4:50:11

Define one more role that is what that

4:50:13

is a function right now over here I'm

4:50:15

going to pass the name and here I'm

4:50:17

going to extract the like function the

4:50:20

the ex exact function over here you can

4:50:22

check over here you can like copy it and

4:50:25

you can paste it over here this one so

4:50:28

just just paste and you will get this

4:50:30

function called now just collect the

4:50:32

name name of the function do name so

4:50:34

what is the name of the function get

4:50:36

flight info right now here is what

4:50:38

content is nothing content is a flight

4:50:40

now as soon as I will run it so here you

4:50:42

will be able to find out that we are

4:50:44

able to extract the information now let

4:50:47

me show you this response three so here

4:50:49

is what here is my response three and

4:50:51

guys see what I'm getting over here so

4:50:54

let me print the final one and here you

4:50:58

will be able to find out a detail so let

4:51:01

me run it see guys so now let me call

4:51:05

the uh this uh function call just a

4:51:09

second function uncore

4:51:13

call function _ call and over here guys

4:51:16

you can see we have argument and

4:51:19

actually we have a message over there

4:51:20

just a wait let me show you that

4:51:23

also uh function call and

4:51:26

argument okay just a

4:51:31

wait oh message inside the message

4:51:33

message itself I will be able to get it

4:51:36

uh where my message is coming inside a

4:51:40

choice and

4:51:42

here okay I need to call a Content

4:51:44

actually just a

4:51:49

second message function call this is my

4:51:52

function call that is fine now here

4:51:55

Choice uh just a second choice what we

4:51:58

have inside a

4:52:00

choice okay it is a response three fine

4:52:03

fine fine I was checking with a response

4:52:05

two uh yeah this was a response now it

4:52:08

is fine it was a response three I was

4:52:10

checking with a response two it's my bad

4:52:12

it's my bad uh okay now let me collect

4:52:16

the message from here so here is what

4:52:19

here is a zero and

4:52:22

uh now let me call this

4:52:28

message so here is my message and let me

4:52:31

collect the content

4:52:35

tent and here is what here is my content

4:52:39

guys so did you get it what is the use

4:52:41

of this function calling now let me give

4:52:43

you the definition of this function

4:52:45

calling in a single line so just a wait

4:52:48

I'm giving you the definition definitely

4:52:50

you will be able to relate now so if we

4:52:52

are talking about this function calling

4:52:54

now so here is a definition of it let me

4:52:58

copy and paste so what is our definition

4:53:00

of the function calling so function

4:53:02

calling is nothing learn how to connect

4:53:05

large language model to the external

4:53:07

tool that's it we can define a function

4:53:10

we can Define the parameters we can

4:53:13

Define the values and according to that

4:53:15

we can get our responses from the third

4:53:17

party API and here I have defined this

4:53:20

particular function M function is a

4:53:22

third party API but you can call the

4:53:24

realtime API and you can get the

4:53:28

information you can get the exact

4:53:31

information this thing is clear to all

4:53:34

of

4:53:35

you yes or

4:53:38

no how many of you you are able to get

4:53:41

it how many of you you are able to

4:53:43

understand this thing if you can let me

4:53:45

know in the chat so I think that would

4:53:47

be great again I will try to revise it

4:53:49

uh I will give you the quick revision of

4:53:51

it and then I will move to the link

4:53:56

chain will you revise it please do let

4:53:59

me know in the chat will you revise this

4:54:02

concept

4:54:08

I'm waiting for a reply if you can

4:54:09

answer me in the chat I think that would

4:54:11

be

4:54:32

great

4:54:35

yes I'm going to revise it just wait

4:54:37

just give me a second first of all uh do

4:54:39

let me know how much person you got so

4:54:42

if you can tell me uh in a percentage

4:54:43

also so that would be great I will get

4:54:45

some sort of idea that okay you are

4:54:47

getting something from here whatever

4:54:49

code I'm writing you're getting from

4:54:50

here so please uh do let me

4:55:02

know 80%

4:55:11

great 70 70

4:55:16

80 yeah if you're getting 70 or 80% now

4:55:19

so I think rest of the thing like you

4:55:21

just need to revise Sor is saying sir

4:55:23

I'm just getting 10% so Sor in that case

4:55:26

you need to follow from a very first

4:55:28

session just check with the very first

4:55:30

session and then come to the second one

4:55:32

and then come come to this third

4:55:39

one if you are near to 70 to 80% now

4:55:43

then you just need to revise it once

4:55:44

that's

4:55:48

it yes correct uh your understanding is

4:55:52

correct here we are extracting value

4:55:54

from given prompt using function

4:56:02

call

4:56:11

what is the meaning of the role is equal

4:56:12

to function which

4:56:15

one here we are defining now see we have

4:56:18

a user so user is asking a question and

4:56:20

rest of the information we are going to

4:56:22

collect from here we are defining one

4:56:24

more role we have we can Define many

4:56:25

roles over here um we can Define uh like

4:56:29

uh we can Define the system we can

4:56:30

Define role as assistant we can Define

4:56:32

role as a user user we can Define role

4:56:34

as a

4:56:35

function user is asking something and uh

4:56:38

and uh from wherever basically we are

4:56:41

going to be get output or we are getting

4:56:43

a uh we are we trying to exct the

4:56:45

information regarding this particular

4:56:47

prompt so we are defining as a rle over

4:56:49

here that's

4:57:00

it great so let's revise it now and then

4:57:03

I will go for the Len chain so we'll try

4:57:05

to understand the langen chain and all

4:57:06

already I have installed this L chain

4:57:08

and try to hit the open API and tomorrow

4:57:11

we'll understand the lch in a very

4:57:13

detailed way uh today uh just a quick uh

4:57:17

understanding quick uh uh first of all I

4:57:19

will give you the quick recap of all

4:57:21

those all this thing and then I will

4:57:23

come to the lon part so let's understand

4:57:27

this function calling one more time from

4:57:32

scratch

4:57:39

great so over here see we are talking

4:57:42

about this uh we are talking about this

4:57:43

chat completion API and I think you know

4:57:46

about it how many time we have discussed

4:57:48

so we're passing the prompt here is my

4:57:50

prompt and we are getting the output now

4:57:52

Today I Started from the like a

4:57:55

different type of prompt so uh today I

4:57:57

have started from the function calling

4:57:59

so here I have defined one description

4:58:01

and here I'm writing uh the prompts my

4:58:04

prompt is saying that uh here you need

4:58:06

to extract this information from the

4:58:09

given description that's it now here you

4:58:12

can see uh this is my client this is

4:58:15

what this is my client now here I'm

4:58:17

going to call my chat GPT and sorry I'm

4:58:21

going to call my GPT model so after that

4:58:23

what I'm getting I'm getting my response

4:58:25

I'm going to convert into a Json and

4:58:26

this is fine right this is fine anything

4:58:28

you can ask to your model and you can

4:58:30

print as a response you just need to

4:58:32

define a prompt that that's it now here

4:58:35

the same thing I'm going to do by using

4:58:36

this function so here I'm going to do uh

4:58:39

the same thing by using this function

4:58:41

now here I'm going to define a several

4:58:43

parameter so this is my parameter name

4:58:45

College grade and Club it should be a

4:58:47

same similar to this prompt itself

4:58:49

whatever prompt I have defined I have

4:58:50

written right so just look into the

4:58:52

prompt I will share this notebook then

4:58:54

you can check it should be similar to

4:58:55

that only this particular properties

4:58:58

this particular values now over here uh

4:59:01

you will find out that okay I again I'm

4:59:03

going to call it again I'm working I'm

4:59:06

like role I've defined as a user there's

4:59:07

a Content prompt and you are getting a

4:59:10

response and here you are getting a

4:59:12

response now guys here you can see we

4:59:15

are going to print a message and finally

4:59:16

we are getting a same thing by calling

4:59:18

this uh by using this function call as

4:59:21

well now here actually once you will

4:59:22

look into the prompt we have defined one

4:59:24

thing over here we we are saying that uh

4:59:27

return it as a Json object return it as

4:59:30

a Json object so whatever response you

4:59:32

are getting now from from the openi side

4:59:34

also I tested the same thing of the CH

4:59:36

GPT see I given the description this was

4:59:39

my description and CH GPD has given me

4:59:41

output is a Json format so if you are

4:59:44

calling it now uh this uh like a GPD

4:59:47

model so it will give you the output in

4:59:48

a Json format this one so here it is

4:59:51

giving you the output this particular

4:59:52

output in a Json format this one

4:59:54

actually it's a string but yeah we can

4:59:56

convert into a Json and that is what I

4:59:57

did now the same thing why we are doing

4:59:59

by using this function now over here H

5:00:01

it's fine it's clear now here I've given

5:00:03

you a few more uh like functionality

5:00:05

regarding this function I can call it

5:00:07

for the several description in a single

5:00:10

sort I just need to keep the for I just

5:00:11

need to write down the for Loop over

5:00:13

here so I'm getting a multiple responses

5:00:15

for sun for Chris for sansu right so

5:00:18

here I'm getting a multiple responses

5:00:20

now here I given you an assignment so

5:00:23

here I told you that you can call a

5:00:25

multiple function also don't call a

5:00:27

single function here I'm getting an

5:00:28

information from the single

5:00:30

function but you can call a multiple

5:00:32

function and here I shown you the way

5:00:34

you just need to define a function in a

5:00:36

list and that's it so here is a function

5:00:39

you just need to define a function in

5:00:40

the list and just pass it over here and

5:00:42

according to that only you will get a

5:00:44

response getting my point now here I've

5:00:47

shown you the advanced example of

5:00:49

function calling and that's a real use

5:00:50

of the function and here if you want to

5:00:52

Define this function in a single word in

5:00:54

a single line if you want to understand

5:00:56

this function in a single line so here

5:00:58

you can see this is the definition learn

5:00:59

how to connect large language model to

5:01:02

the external tool

5:01:03

so here what I want to do so here let's

5:01:05

say uh this is my model and here I'm

5:01:10

going to write down some sort of a

5:01:12

prompt where uh like it is going to be a

5:01:15

request and here I'm getting a response

5:01:18

now this prompt actually it's something

5:01:20

uh related to a real time I'm asking a

5:01:23

real time question that just give me the

5:01:25

flight just tell me like what all

5:01:27

matches uh we have in upcoming days or

5:01:31

uh just tell me the weather okay

5:01:33

something like that so I'm asking a real

5:01:35

time information it won't be able to

5:01:36

provide it to me in that case what you

5:01:39

will do so you are not going to call

5:01:41

your llm now because it is not trained

5:01:45

on that uh on it it has not been trained

5:01:48

on top of that data actually if you are

5:01:51

talking about this GPT so this GPT

5:01:53

actually train on this uh till actually

5:01:55

till September 2021 so this GPD train

5:01:59

till uh 2021 only now in that case

5:02:02

whatever prompt you are going to be

5:02:03

write it down you won't be able to get a

5:02:05

response right so here this function

5:02:08

calling comes into a picture so once you

5:02:10

will Define the function now so here

5:02:13

what you will do you are going to define

5:02:14

a function you are going to different

5:02:15

Define a different different arguments

5:02:17

and all each and every information you

5:02:18

are passing to this function that's it

5:02:21

now you just need see here this argument

5:02:24

what you will do by using this

5:02:26

particular argument you will call a

5:02:27

third party API third party API

5:02:34

third party API now you will call this

5:02:36

third party API here or whatever

5:02:39

function you are going to Define and

5:02:41

whatever prompt you are writing

5:02:42

according to that you will get a

5:02:43

response because this llm is not able to

5:02:45

provide you the response right and the

5:02:48

same thing the each and everything you

5:02:49

can do by using the chat completion API

5:02:51

only chat completion method you can say

5:02:54

chat completion API or chat completion

5:02:55

method both are fine by using this chat

5:02:57

completion method now let me show you in

5:02:59

terms of coding so over here if you look

5:03:03

into the code so I'm doing the same

5:03:04

thing here I have defined a function see

5:03:07

this is what

5:03:08

uh first of all I'm asking to my first

5:03:11

of all I'm asking to my uh llm model it

5:03:14

is not able to answer now after that

5:03:17

what I did I defined the function got it

5:03:20

after that I defined a prompt I'm

5:03:21

passing to my model I'm passing to my

5:03:25

actually uh this uh like chat completion

5:03:27

method so here is my user here is my

5:03:29

prompt and here is my function

5:03:30

description by doing that what I'm able

5:03:32

to do I able to extract few of the uh

5:03:35

few value whatever is there inside this

5:03:37

function whatever I have defined over

5:03:39

here because here I'm writing in this

5:03:40

function description now after that this

5:03:43

value I'm using and this is what this is

5:03:45

my API okay this this is my like it's

5:03:47

not a real API it's like a virtual API

5:03:50

whatever you can say now whatever value

5:03:52

I'm passing whatever uh thing I'm

5:03:54

collecting from here I'm passing to this

5:03:55

API and I'm getting a response over here

5:03:58

this is the response this is my

5:04:01

response got it now what I will do here

5:04:04

now I compiled each and everything over

5:04:05

here inside this chat chat completion

5:04:07

method so how I compile this is my model

5:04:10

this is my prompt this is my user this

5:04:12

is my prompt this is my function call

5:04:14

this is my function call along with the

5:04:17

argument and over here this is my

5:04:19

function that's it if I'm going to run

5:04:21

it now it is going to extract the

5:04:23

information from the third party API

5:04:25

which is my function as of now now you

5:04:27

can take as assignment you can call the

5:04:29

real time API you can use the rapid API

5:04:31

you can do that you can call a real time

5:04:33

API so now this function calling is

5:04:36

clear to all of you yes or

5:04:42

no correct ran your understanding is

5:04:44

correct

5:04:48

now your understanding is correct and I

5:04:51

think you are able to get

5:05:00

it now let's start with the length chain

5:05:03

so we have a a 10 minute uh now we can

5:05:06

understand the concept of the length

5:05:08

chain and then from Tomorrow onwards I'm

5:05:11

going to start with the Len chain now

5:05:13

first of all let me write it down the uh

5:05:16

code for the Len chain so here I'm going

5:05:18

to write it down Len CH and here uh you

5:05:23

can I can mark down it and uh so first

5:05:27

of all guys what I need to do so I'm

5:05:28

going to start from the Len chain uh so

5:05:31

the first thing very first thing uh I

5:05:33

need to import it so let me give you the

5:05:35

entire code okay so step by step let me

5:05:38

write down each and everything so first

5:05:39

of all I have to import the Len chain so

5:05:42

here I'm going to write it down import

5:05:44

length

5:05:45

chain now here I have imported the Len

5:05:48

chain now from this like in this lure

5:05:50

actually we have a different different

5:05:51

modules we have a different different

5:05:53

module and inside that we have a

5:05:54

different different classes so as of now

5:05:56

we are going to use the open AI so here

5:05:59

I'm going to write it down from Len chin

5:06:01

from Len

5:06:03

we are going to import this open AI so

5:06:07

lenin. llms and here I'm going to write

5:06:09

down this open AI okay so we are able to

5:06:12

import this open AI now what I will do

5:06:16

so initially I told you that this lenon

5:06:19

is nothing it's a wrapper on top of this

5:06:21

open AI so you can think that this is my

5:06:24

open AI right this is what this is my

5:06:27

open AI now on top of this open a on top

5:06:30

of this open API this lench is nothing

5:06:32

it's a

5:06:35

wrapper okay so this is what length

5:06:37

chain now here whatever request we are

5:06:40

making whatever request we are making

5:06:43

right so now we are not directly using

5:06:45

this open a now we are not directly

5:06:48

using this open API instead of that we

5:06:52

are using this L chain so our request is

5:06:54

going through to this a len chain and

5:06:57

then it is hitting this open AI but this

5:07:01

Len chain it is not restricted to till

5:07:03

here itself we have a many uses of the

5:07:06

Len

5:07:07

chain getting my point this Len chain is

5:07:10

not restricted to this one only we have

5:07:12

a many uses of the link chain I will

5:07:15

talk about those uses and this Len chain

5:07:17

actually it's a very powerful uh it's a

5:07:20

very powerful application it's a open

5:07:22

source I will show you the source code

5:07:23

as well uh even we can search about it

5:07:25

so let me show you that uh let me show

5:07:27

you the source code of the Lenin so here

5:07:31

I'm going to write it down Len Chen Len

5:07:34

Chen GitHub so here is what guys here is

5:07:37

a len Chen GitHub uh just a second yeah

5:07:42

so this is a lenion GitHub now you will

5:07:44

see the number of folks the number of

5:07:46

star number of folks number of start

5:07:49

number of watching right so number of

5:07:51

watching in a real time and this length

5:07:53

chain is really amazing let me give you

5:07:55

this link inside your chat please try to

5:07:58

uh explore it by yourself and it's a

5:08:01

very uh Power powerful and very

5:08:03

important as well if you want to build

5:08:04

any llm based application so you can use

5:08:08

this length chain it's a it's completely

5:08:10

op source and here you can see used by

5:08:12

40,000 people and here is a number of

5:08:15

contributor you can also become a

5:08:16

contributor if you like to contribute in

5:08:19

a open source now here you can see the

5:08:20

commits 7 hour ago they committed

5:08:22

something just just go through with this

5:08:24

commits and check what thing they have

5:08:26

committed what what changes they have

5:08:28

made over here try to understand it and

5:08:30

this package actually it is available on

5:08:32

the pii repository so just go over the

5:08:35

pii repository pii Len chain and search

5:08:38

about the Len chain and here you will

5:08:40

find out this Len chain this is what

5:08:42

this is a len chain guys this is a like

5:08:44

they have hosted the package on pii

5:08:46

repository and it is a latest version of

5:08:49

The Lang chain now here also just just

5:08:51

uh scroll down here also you will find

5:08:54

out the same thing

5:08:55

uh deployment so they are doing a deploy

5:09:00

here is a package package see this is

5:09:02

the release so 0.0.3 46 0.0.3 46 this is

5:09:07

the latest uh version which you can see

5:09:10

over here as well this one is uh so far

5:09:13

they did 297 release total 297 release

5:09:18

see this is the total release actually

5:09:19

total number of release now you can see

5:09:21

over here as well just go inside the

5:09:23

real uh just go just click on this

5:09:25

release history and check the uh entire

5:09:28

uh like release related to the length CH

5:09:31

got it right so here is a latest version

5:09:34

of the Len chain similarly we have a

5:09:36

llama index two also and this Len chain

5:09:39

is a open source and the Llama index 2

5:09:41

it's a framework from The Meta we can do

5:09:44

a same thing by using this llama index 2

5:09:46

also I will come to that I will come to

5:09:48

the Llama Index right now over here see

5:09:51

we have this Len chain we have this

5:09:52

openi now let's try to create now let's

5:09:54

try to create object of this open Ai and

5:09:57

here what I need to do guys tell me here

5:09:59

I'm going to here I'm going to pass pass

5:10:02

my open a key so first of all uh I will

5:10:05

have to pass the parameter now let me um

5:10:08

give the parameter over here and here I

5:10:10

need to write it down this my key and

5:10:13

here is what here is my client right now

5:10:16

I just need to call one method and my

5:10:18

method is going to be a predict right so

5:10:21

my the method name is going to be a

5:10:22

predict so let me write it down over

5:10:24

here Cent c l i n t dot predict now here

5:10:27

what I need to do here I just need to

5:10:29

pass the prompt prompt is what prompt is

5:10:32

a input whatever input we are passing to

5:10:34

the model that's it so let me Define The

5:10:36

Prompt so here I'm going to write it

5:10:38

down the prompt and this prompt let's

5:10:40

say I'm going to ask to my model what I

5:10:42

can ask so I can ask can you tell

5:10:46

me

5:10:48

total number of country total number of

5:10:53

country in Asia so here is my question

5:10:56

so I just asked a little tricky question

5:10:59

not a tricky actually it's a

5:11:00

straightforward so uh here is my

5:11:02

question my question is what my question

5:11:03

is can you tell me total number of

5:11:05

country inia now this is called guys

5:11:07

zero short prompting what is this tell

5:11:09

me this is called zero short

5:11:13

prompting this is what guys tell me this

5:11:15

is a zero short prompting now here if I

5:11:17

will run it and here if I will pass my

5:11:19

prompt to My Method client don't predict

5:11:22

so here you will get output so here it

5:11:24

is saying that there are 48 country in

5:11:27

Asia if you would like to uh if you want

5:11:30

to name then here you can mention

5:11:32

can you give me can you give

5:11:37

me top

5:11:40

10

5:11:42

country name so here uh I have extended

5:11:46

the question now and now see over here I

5:11:49

will be getting a name of the country so

5:11:51

it is giving me the sash slash sash is

5:11:54

nothing it means it means that if I'm

5:11:56

going to print it now so it will print

5:11:57

after two line so for that what you can

5:12:00

do you can just call this a strip

5:12:02

SD and it will strip your output so here

5:12:05

you will find out the correct output so

5:12:08

there are 48 continer isia the top 10

5:12:11

country by population in Asia these are

5:12:13

the country now here if I'm going to

5:12:15

write it on print so you will get a

5:12:17

output in a correct format so here guys

5:12:19

you can see you will get output in a

5:12:22

correct format so there are total 48

5:12:24

country in Asia and these are the top 10

5:12:26

countries China India Indonesia Pakistan

5:12:28

Bangladesh Japan Philippines Vietnam

5:12:31

Iran and turkey got it guys how to use

5:12:34

lch I just given you the introduction of

5:12:36

that but there are many more things so

5:12:39

all the things uh uh the remaining thing

5:12:41

definitely we are going to discuss in

5:12:43

next session as of now just think that

5:12:45

this uh lench is nothing it's a rapper

5:12:48

on top of the open AI but it is having a

5:12:50

lots of uses it can call any third party

5:12:53

API it can call any sort of a data

5:12:55

resource it can uh like uh it it it is

5:12:58

having a power to read a different

5:13:00

different documents it's a having a

5:13:02

power to making a change to making a

5:13:05

memory it is having a power it is uh it

5:13:08

is not only for the open AI we can use

5:13:12

this lenen for any open source model any

5:13:15

open source llm model and tomorrow I

5:13:18

will show you here I have used so let me

5:13:21

write down tomorrow's agenda what all

5:13:22

thing we are going to discuss tomorrow

5:13:26

tomorrow uh tomorrow's

5:13:29

agenda so we are going to uh cover

5:13:33

hugging phase hugging phase API with Len

5:13:38

chain uh and we'll try to understand the

5:13:41

use of the Len chain use of the length

5:13:43

chain so we'll try to understand this

5:13:45

use of the Len chain in very

5:13:48

detailed way so this will be the agenda

5:13:52

for tomorrow's uh like this this is the

5:13:54

agenda for tomorrow's class and after

5:13:56

that I will directly jump to the project

5:13:59

we try to create one project and with

5:14:01

that your understanding will be clear

5:14:03

and rest of the topic we'll cover after

5:14:06

uh after the project and all so tell me

5:14:09

guys how was the session did you like

5:14:11

this session uh did you uh did you got

5:14:14

everything yes or no whatever I have

5:14:18

explained yeah meanwhile you can explore

5:14:20

it by yourself that is a good

5:14:22

idea tell me guys fast uh did you like

5:14:25

the session please do let me know in the

5:14:27

chat if you are liking the session if

5:14:29

you're liking my content I have WR and I

5:14:32

I created each and everything from

5:14:33

scratch by myself only and believe me if

5:14:35

you are following this notebook if you

5:14:37

are following my content you won't face

5:14:39

any

5:14:40

issue and even in our interview also you

5:14:42

can answer in a better

5:15:00

way

5:15:04

okay so I think uh now uh we have

5:15:08

covered all the thing whatever I told

5:15:11

you and uh yeah all the resources and

5:15:14

all you can find it out over the

5:15:16

dashboard so we are uploading each and

5:15:18

every resources in a resource section so

5:15:21

just visit the dashboard and here uh we

5:15:24

have all the videos videos and quizzes

5:15:27

assignment each and everything we are

5:15:28

going to update over here so along with

5:15:30

the session you can and practice now

5:15:33

here uh we have our resources regarding

5:15:36

the first session so all the all the PDF

5:15:39

and all all the PPT so at least you can

5:15:42

revise the thing you no need to go

5:15:43

through with the video again and again

5:15:45

you can directly uh download the

5:15:46

resource and you can look into that if

5:15:48

you have attended my live session and

5:15:51

here we have a IPO NV file also so just

5:15:55

visit this uh resource section and this

5:15:58

is the IP VB file now I will update this

5:16:00

IP VB file in my day three video and

5:16:03

along with that we'll be having some

5:16:05

quizzes assignment and don't worry I

5:16:06

will give you more assignment more

5:16:08

quizzes and see in between whatever I'm

5:16:10

leaving so here I told you that you need

5:16:13

to create your own API this one uh in an

5:16:15

advanced example of function calling so

5:16:18

just use any API okay just search over

5:16:20

the internet I told you you can use

5:16:22

Rapid API and try to get a realtime data

5:16:25

instead of this uh dummy function which

5:16:27

I created over here you can take it as

5:16:29

assignment here I told you that you need

5:16:32

to you can use multiple function right

5:16:34

in a single shot just try to create one

5:16:36

more function define it in your in your

5:16:38

own way and then uh run it and uh get an

5:16:41

information so here I'm getting an

5:16:43

information regarding three user you can

5:16:45

add more user and you can add multiple

5:16:48

function over there so now let's start

5:16:50

let's begin so in the previous classes

5:16:53

uh in the uh previous three classes

5:16:55

actually I have talked about the

5:16:56

generative Ai llm and then I came to

5:16:59

this open Ai and yesterday I have I did

5:17:01

the detailed discussion on top of this

5:17:03

open Ai and I have introduced the Len

5:17:06

chain to all of you uh so guys this is

5:17:08

the notebook inside this notebook I have

5:17:10

kept each and everything whatever notes

5:17:12

whatever code and all whatever thing I

5:17:14

was doing all right so uh in terms of

5:17:17

code and all so each and everything I

5:17:18

have kept inside this particular

5:17:20

notebook and this notebook is available

5:17:22

inside your resource section so from

5:17:24

where you will get a resource guys so

5:17:26

for for that uh you need to go through

5:17:28

with the dashboard so here is your

5:17:29

dashboard here you will find out uh here

5:17:32

you will find out all the recordings U

5:17:35

Day One recording day two recording day

5:17:36

three recording so just try to go

5:17:38

through with the day three you just need

5:17:40

to click on the uh day three and here uh

5:17:44

check with the resource so go inside

5:17:46

your resource section and this is the

5:17:48

dashboard guys generative AI Community

5:17:51

Edition English so here you will find

5:17:53

out uh two dashboard uh the two

5:17:55

Community dashboard one for Hindi and

5:17:57

one for English so this is for the Hindi

5:17:59

one U actually I'm taking a same classes

5:18:01

on a Hindi uh Channel as well I on Hindi

5:18:05

I on teag Hindi you can search over the

5:18:07

uh YouTube and the uh it's it is your

5:18:10

one this English one so just go and

5:18:12

check with your dashboard you will find

5:18:14

out all the recordings and all so click

5:18:17

on this day three and here check with

5:18:19

your resource section so okay so

5:18:21

resources is not there I have already

5:18:24

given to my team but don't worry I will

5:18:27

check and here is what guys here is a a

5:18:29

notebook so uh definitely I will provide

5:18:32

you this particular notebook inside the

5:18:34

resource section so you all can run it

5:18:37

you all can run it and by running it you

5:18:39

can uh revise the thing and all and

5:18:41

apart from uh this notebook apart from

5:18:44

this resources you will find out the

5:18:45

quizzes and assignment also so please

5:18:47

try to enroll to this dashboard try to

5:18:50

visit the Inon website sign up over

5:18:51

there login and then uh enroll into this

5:18:54

community session for this commun

5:18:56

session you no need to pay anything it's

5:18:59

just it's a free one okay so just just

5:19:02

go through with the Inon website and

5:19:03

login um after sign up do the login and

5:19:06

you can access this particular dashboard

5:19:08

and you will find out the same dashboard

5:19:10

in a description also so just just try

5:19:12

to check the description of this video

5:19:14

of this live section you will find out

5:19:15

the dashboard or else you can check with

5:19:17

the previous Live recorded session also

5:19:19

which is already available on the over

5:19:21

the Inon YouTube channel got it so this

5:19:24

uh resource uh part is clear to all of

5:19:26

you now in today's session what all

5:19:29

thing we going to discuss so guys first

5:19:30

I will will start from the Len chain

5:19:33

first I will explain you the complete

5:19:34

Len chain that what is a len chain what

5:19:36

all things we have inside the Len chain

5:19:39

why we should use it why it is too much

5:19:41

powerful each and everything we'll try

5:19:43

to discuss regarding the Len chain and

5:19:46

after that I will come to this hugging

5:19:47

phase I will explain you that how you

5:19:50

can uh how you can use any any like open

5:19:53

source model from the hugging face Hub

5:19:56

got it yes or no so in the previous

5:19:58

class I told you that whatever model

5:20:00

whatever model is there over the open AI

5:20:02

platform how you can use that by after

5:20:04

generating a API key now in today's

5:20:06

session after discussing this lench I

5:20:09

will come to the hugging phas and I will

5:20:10

show you I will show you that after

5:20:12

generating a API key hugging face API

5:20:15

key how you can utilize that particular

5:20:17

model so each and everything uh we'll

5:20:20

talk about in today's session uh

5:20:22

whatever I have told you and after that

5:20:24

we'll start with the project so in

5:20:25

tomorrow's session or maybe day after

5:20:27

tomorrow so I will start with the

5:20:29

project end to end project I will use

5:20:31

this openi concept hugging face concept

5:20:33

linkchain concept and I will uh show you

5:20:36

that how you can create a web

5:20:38

application end to end web application

5:20:41

and then we'll come to the advanced part

5:20:43

like vector databases and some other

5:20:45

topic so I think uh everything is fine

5:20:48

uh the agenda is all clear uh so please

5:20:51

give me a quick confirmation in the chat

5:20:52

if we can start then and whatever I have

5:20:54

explain you whatever I have explained

5:20:57

you so far so it is clear or not so

5:20:59

please do let me know in the chat uh if

5:21:01

it is clear and if we can start then I'm

5:21:04

waiting for your

5:21:30

reply

5:21:35

fine so I got the answer now great so

5:21:39

let's start uh let's start with the

5:21:41

topic so in this uh uh notebook itself

5:21:44

I'm going to write it down the entire

5:21:46

code uh of the Len chain so whatever

5:21:48

thing is there regarding the Len chin I

5:21:50

will try to do here itself and whatever

5:21:52

thing uh things will come into the

5:21:54

picture uh whatever other libraries and

5:21:56

all so definitely we'll try to install

5:21:58

all those library in the current virtual

5:22:01

environment now here guys uh I told you

5:22:04

that how to create an environment how to

5:22:06

uh launch the Jupiter notebook how to

5:22:08

install the openi over there how to uh

5:22:10

like install the langen each and

5:22:12

everything I have discussed in my

5:22:14

previous session so if you don't know

5:22:15

about it so please go and check with my

5:22:17

previous session there I did a detailed

5:22:19

discussion regarding the environment

5:22:21

setup got it now here guys um already I

5:22:24

have written some sort of a line some U

5:22:26

like sort of a quotee for the L chain

5:22:28

yesterday actually I I like uh I was uh

5:22:31

I I have imported the Lenin and I have

5:22:33

used the key the openi key and basically

5:22:36

I have imported this openi class and I

5:22:39

created a object then I uh written a

5:22:41

prompt over here and here I was uh like

5:22:45

giving this prompt to my open API and in

5:22:48

the back end it was running the llm

5:22:50

model and here you can see this is what

5:22:52

this is my output got it now here I I

5:22:56

had written actually this this this is

5:22:58

the today's agenda whatever thing we are

5:22:59

going to discuss in today's session so

5:23:01

hugging face API use of Lang CH and all

5:23:04

so each and everything we'll try to do

5:23:06

here itself in the uh in today's class

5:23:08

itself so first of all let me write it

5:23:10

down each and everything over the

5:23:12

Blackboard so with that you will get a

5:23:14

clear-cut understanding regarding the

5:23:16

agenda and all that whatever the thing I

5:23:18

am going to discuss and after that I

5:23:20

will come to the code part code section

5:23:23

so let's start uh with the agenda now in

5:23:25

today's class guys we'll be talking

5:23:27

about the Len chain so let me write it

5:23:30

down over here in today's session we're

5:23:32

going to start with the Len chain now

5:23:35

what is a len chain why we use Len chain

5:23:38

and what is a difference between this

5:23:40

open a and this Lenin so each and

5:23:42

everything we'll be discussing over here

5:23:43

itself now the first thing the first

5:23:45

thing which we going to discuss in the

5:23:47

Len Chen the first thing how to use Len

5:23:49

Chen or how to use open a uh how to use

5:23:56

how to use open AI by a lang chin so how

5:24:00

to use open AI via Len chain that's the

5:24:04

first thing we'll try to discuss got it

5:24:07

after that I will come to the prompt

5:24:08

template prompt uh templating so how you

5:24:11

can do a prompt templating by using this

5:24:13

Len chin so the second thing the second

5:24:15

topic which we're going to talk about

5:24:17

that will be a prompt

5:24:19

templating promp templating the third

5:24:22

thing which we're going to discuss

5:24:23

inside the Len chain that will be chains

5:24:26

we'll talk about the chains that what is

5:24:28

a chains uh how we can utilize this

5:24:30

chains what is the meaning of the chain

5:24:32

how uh what all the different different

5:24:34

type of chains is there each and

5:24:36

everything we talk about over here then

5:24:38

we'll talk about the agents that what is

5:24:40

the

5:24:43

agents okay so we'll talk about the

5:24:45

agent that what is the agent and what we

5:24:47

can do by using this agent so each and

5:24:50

everything we'll try to discuss

5:24:51

regarding this agent and here if uh so

5:24:54

here I will show you that how you can

5:24:56

use the Google API so by using the Sur

5:24:59

API so what I will do so by using the

5:25:02

surp

5:25:03

API I will try to I will try to use the

5:25:07

Google API Google API Google search

5:25:12

API so in the agent section I will

5:25:15

explain you this particular thing and

5:25:17

after the agent the fifth one the fifth

5:25:19

topic which we're going to discuss

5:25:21

that's going to be a memory so we'll let

5:25:24

you know that how we can retain the

5:25:26

memory how we can retain the memory like

5:25:29

chat GPD is doing how we can do the same

5:25:31

thing if we are using this open API so

5:25:35

we will try to discuss this memory uh

5:25:37

memory part as well and which is a uh

5:25:40

like which is available over here inside

5:25:41

the lench and by using this Len Chen we

5:25:43

can implement this particular feature

5:25:46

after this memory I would come to that

5:25:48

uh document loader so uh how we can load

5:25:51

our different different type of

5:25:52

documents so document is nothing

5:25:54

documented just a file like PDF file CSV

5:25:57

file tsv file or any other file how you

5:26:00

and load that particular document so

5:26:02

we'll talk about a document loader as

5:26:05

well so here let me write it down

5:26:07

document

5:26:11

loader after completing all these thing

5:26:15

then I will come to this hugging

5:26:16

phase hugging phase I will show you how

5:26:20

you can I will show you that how you can

5:26:23

uh generate a hugging face API key

5:26:25

hugging face API token and how you can

5:26:27

utilize any sort of a model whatever

5:26:30

model is is there over the hugging face

5:26:32

Hub so how you can use that particular

5:26:34

model so I will talk about the hugging

5:26:36

face after that and finally we'll move

5:26:38

to the project section so uh this is the

5:26:40

agenda for today's session for today's

5:26:42

class and apart from this each and

5:26:45

everything I have explain you how to

5:26:47

generate a open key how to uh like use a

5:26:50

open a what is chat completion what is a

5:26:52

function calling and all even I have

5:26:54

talked about the basics of the langen as

5:26:56

well so if this part is clear to all of

5:26:59

you so please do let let me know in the

5:27:01

chat if till uh like if the agenda is

5:27:04

clear so I just want quick yes in the

5:27:06

chat and please do let me know how many

5:27:09

of you you are writing a code along with

5:27:11

me because today I will go a little slow

5:27:13

so you also can write it down the code

5:27:15

along with me please do let me know guys

5:27:18

please write down the

5:27:29

chat

5:27:43

good I think many of you you are writing

5:27:46

a code

5:27:51

mhm uh just a wait just uh give me a

5:27:59

second

5:28:04

fine so let's start with the uh agenda

5:28:07

now so here guys you can see I have

5:28:09

written a agenda and first of all uh let

5:28:12

me explain you that what is a len chain

5:28:14

why we are not using this openi API why

5:28:17

we are using this Len chain and uh why

5:28:20

it is too much important this Len chain

5:28:22

and this llama index to so first of all

5:28:24

let me talk about uh the differences

5:28:26

between this open Ai and this Len chain

5:28:29

and then I will come to the

5:28:30

implementation part so here uh first of

5:28:33

all let me write it down the limitations

5:28:35

of the chat

5:28:36

GPT sorry limitations of the open a

5:28:40

API uh limitations of open AI

5:28:49

API now here guys see uh if we are

5:28:51

talking about this open API so here you

5:28:54

won't be able to find out a free model

5:28:57

so the first thing actually the first

5:28:58

thing uh in the limitation uh like which

5:29:01

we are going to talk about so here open

5:29:03

a model is not a free one so here let me

5:29:06

write it down open AI model open AI

5:29:10

model open AI model is not a

5:29:13

free now let's see uh let's assume that

5:29:17

okay so the model is not a free one and

5:29:20

if I want to use the llm uh like if if I

5:29:23

want to use the llm capability or that

5:29:25

AI capability in my application I if I

5:29:28

don't have a budget so what I will do I

5:29:30

will go with the other option other free

5:29:33

option open source

5:29:34

option okay so let's say some XYZ

5:29:37

organization some XYZ organization

5:29:40

created one llm now I want to use this

5:29:44

particular llm so yeah definitely what

5:29:47

you can do you can use the uh API

5:29:49

whatever API this XYZ company has given

5:29:51

to you and by using that particular API

5:29:54

you can use this particular llm right

5:29:56

now let's say you don't want to use this

5:29:58

llm you want to use some other llm

5:30:01

now how you will access it by using the

5:30:04

different API now let's say if you want

5:30:05

to use some other llm whatever llm is

5:30:07

there let's say uh one LM is over the

5:30:10

hugging phas Hub right if you want to

5:30:12

use that particular llm large language

5:30:14

model from the hugging phase right if

5:30:16

you want to use it then definitely you

5:30:17

can use it by generating that particular

5:30:19

API key but guys just think over here uh

5:30:22

yes we are using a different different

5:30:24

API over here first of all uh we were

5:30:26

using this openi API but as you know

5:30:29

that openi model is not a free one for

5:30:32

uh uh like if you want to use it so

5:30:34

definitely we'll have to pay something

5:30:36

and how we're going to pay it so based

5:30:38

on tokens yesterday actually uh day

5:30:41

before yesterday I shown you the uh the

5:30:43

token price and all that how much you

5:30:45

will be a charge if you are going to use

5:30:47

this openi API if you are going to use a

5:30:50

different different model over there I

5:30:51

told you regarding the input tokens

5:30:53

output tokens each and everything I have

5:30:55

discussed so just go through and check

5:30:57

with the previous session okay so if you

5:31:00

are not aware about it now let's say if

5:31:01

I want to use any XYZ llm or any other

5:31:04

llm so how you can use it by using their

5:31:07

API key but just think that uh just

5:31:10

think on top of it if why not like if we

5:31:13

have any one solution so the one

5:31:16

solution actually it can interact with

5:31:19

several

5:31:20

apis right so here I'm using this open

5:31:23

API I if I want to access this

5:31:25

particular model definitely I'm using

5:31:26

this XYZ API or let's say some other

5:31:28

model for that I'm using this XYZ API or

5:31:31

maybe I'm downloading it but just think

5:31:33

on top of it if we have any single

5:31:36

solution for all the llms with that

5:31:40

particular solution if we can access all

5:31:41

the llms to that will be well and good

5:31:44

now so lenen provide you that capability

5:31:47

Len chain provide you that capability so

5:31:49

by using this Len chain you can access

5:31:52

any sort of a llm right I will let you

5:31:56

know that uh what all llm and let's say

5:31:58

this openi is not a free one now let's

5:32:00

say if you want to access a model from

5:32:02

this hugging phase let's say you want to

5:32:04

access one model from the hugging phase

5:32:06

so this length chain gives you that

5:32:08

particular capability by using the Lang

5:32:10

chain you can access the model from the

5:32:12

hugging face also and from a different

5:32:15

different apis I will show you what all

5:32:17

apis this Lang Chen is having I will

5:32:19

come to the documentation so Lang Chen

5:32:22

is not

5:32:23

restricted till this open AI it is

5:32:26

having an access of a multiple API that

5:32:29

is the first thing

5:32:30

here is a limitation and here I told you

5:32:32

the advantage of the Len chain I think

5:32:35

you got my point now the second thing if

5:32:38

we talking about this GPD model uh if we

5:32:42

are talking about the GPD

5:32:44

model you know this have been trained

5:32:47

till September 2021 data this train till

5:32:51

September 2021 data if I'm going to ask

5:32:54

anything to my chat GPT or if I'm going

5:32:57

to ask anything to my GPD model

5:32:59

definitely it won't be able to reply me

5:33:02

and you all agree with this thing

5:33:04

getting my point so if you will ask to

5:33:06

the chat GPT that uh just tell me who

5:33:09

won the recent Cricket World Cup will

5:33:12

the chat GPT uh able to answer this

5:33:14

particular

5:33:15

question no it cannot answer to this

5:33:17

particular question because this have

5:33:19

been trained till September 2021 data so

5:33:23

for that what I will have to do I will

5:33:26

have to call any third party API for

5:33:29

extracting the information yesterday I

5:33:32

was doing by using the function C in op

5:33:34

open a right but here by using this

5:33:37

length chain we can do in a more

5:33:39

efficient

5:33:40

way getting my point why we use this

5:33:43

length chain because here if we are

5:33:45

talking about if we are talking about

5:33:47

this uh like if we are talking about the

5:33:49

limitation of the GPT so I can write it

5:33:51

down over here uh it is uh it is having

5:33:54

limited knowledge so let me write it

5:33:56

down over here it is having it is having

5:34:01

it is having a limited knowledge a

5:34:04

limited

5:34:09

knowledge

5:34:11

till 2021 so if I want to extract

5:34:14

something if I want to extract something

5:34:17

if I want to exess some extra if I want

5:34:19

to exess something which is which

5:34:20

happened uh recently or uh any like real

5:34:23

time information so for that also like

5:34:26

we use this length chain and apart from

5:34:28

this you will find out

5:34:31

uh like different different like

5:34:34

function or different different

5:34:35

functionality inside the Len chain this

5:34:36

Len chain actually it's a more powerful

5:34:38

so here there I have given you two main

5:34:40

reason that why you should use the

5:34:42

length chain now here by using this

5:34:44

length chain so let me write it down

5:34:45

over here by using the different color

5:34:47

so we are talking about this length

5:34:48

chain so by using this length chain what

5:34:50

you can do you know so you can access

5:34:53

any model okay so you can

5:34:58

access

5:35:00

different llm

5:35:03

model different llm

5:35:05

model by using by using different

5:35:10

API whatever API this lenion support by

5:35:13

using different

5:35:16

API second

5:35:20

thing you can

5:35:23

access you can

5:35:27

access you can access uh uh private data

5:35:31

resources private data

5:35:37

sources you can access uh any third

5:35:41

party API so here let me write on the

5:35:42

third point you can access you can

5:35:48

access any third party

5:35:57

API got it so this is the

5:36:00

uh like some features of the length

5:36:01

chain now if we are talking about this

5:36:03

length chain so let me do one thing let

5:36:05

me create one Circle here what I'm going

5:36:08

to do so here I'm going to create a

5:36:10

circle now here I can write it down

5:36:12

inside this particular Circle I can WR

5:36:14

write it down this length CH so what I'm

5:36:17

doing here I'm writing

5:36:19

down uh just a

5:36:22

second so here I'm writing down length

5:36:26

chain now what this length chain can do

5:36:30

so this lench actually it is having a

5:36:33

chain so it can create a chain I will

5:36:35

tell you what is a

5:36:37

chain it can read the documents okay so

5:36:42

document loader it is having a document

5:36:48

loader now here I can write it on the

5:36:50

third one so it is having a concept of

5:36:53

agent for accessing any third party API

5:36:57

agent now this can access any sort of

5:37:00

llm so let me create Arrow over here so

5:37:04

here I can do one thing I can uh give

5:37:07

the arrow so what it can do so here uh

5:37:10

let me keep the arrow so it can access

5:37:13

any sort of a

5:37:14

llm large language model from a

5:37:16

different different API whether it's a

5:37:18

open AI or any other API I can give you

5:37:20

the example of two as of over here

5:37:22

hugging face hugging

5:37:25

face and open Ai and open AI

5:37:30

and it it is having a access of a

5:37:32

different different apis as well so it

5:37:34

is having agent it is having a chains it

5:37:36

is having a document loader and it can

5:37:38

retain the memory as well so we are

5:37:40

talking about the fifth one so it it it

5:37:43

can retain the memory so let me write it

5:37:44

down over here what it can do guys tell

5:37:46

me so it can retain the

5:37:51

memory it can retain the memory I will

5:37:53

uh come to that memory part so this one

5:37:56

langin actually it can do a multiple

5:37:58

things it can perform of multiple things

5:38:01

and here I have written a couple of

5:38:03

limitations of the openi API and this is

5:38:07

a limitation which you will find out

5:38:08

inside the openi API openi model is not

5:38:10

a free one and it is having a limited

5:38:13

knowledge so here guys you will uh so

5:38:16

what is this what is this Lang chain so

5:38:18

here this Lang chain actually it's a

5:38:19

open source framework which provide you

5:38:21

a multiple

5:38:23

functionality with that you can create a

5:38:25

agent you can connect with any third

5:38:27

partyy API you can create a memory you

5:38:28

can retain a memory you can uh read a

5:38:31

different different kind of documents

5:38:32

like CSV tsv PDF or whatever and here

5:38:36

you can create a chain you can create a

5:38:39

prompt template also I forgot one thing

5:38:42

so here I can write it down you can

5:38:44

create a different different a prompt

5:38:46

template so let me write it down over

5:38:48

here different different prompt

5:38:54

templates got it are you getting my

5:38:56

point so if we are talking about so see

5:38:58

if we are talking about in terms of

5:39:00

openi the code basically which I have

5:39:02

written inside uh my previous class this

5:39:05

one so what is this it's nothing now

5:39:07

instead of using open API directly I'm

5:39:10

using one wrapper on top of that that is

5:39:12

what that is a len chain so over here

5:39:14

let me write it down one more thing one

5:39:16

more point so just just think over here

5:39:18

that this is what this is my open API

5:39:21

let me let me draw it over here so here

5:39:23

is what guys tell me so here is my open

5:39:26

AI API this one now here we have a

5:39:29

L

5:39:31

chain sorry uh here actually see this is

5:39:34

open a API and how we are making a

5:39:36

request to this open API so this is what

5:39:38

this my Lang

5:39:42

chain now if we are going to run any

5:39:44

sort of if if we are passing any sort of

5:39:46

a prompt right so just just think over

5:39:48

here if we are passing any sort of a

5:39:50

prompt so we are running it we are

5:39:52

running it through this Len

5:39:55

chain okay so we are passing a input

5:39:58

this is what this is my l Len chin

5:40:01

Lenin and here this prom is going

5:40:03

through now to this open

5:40:05

API open AI

5:40:10

API and here is what here is my

5:40:12

llm if we are talking about with respect

5:40:15

to this openi API so like this it is

5:40:17

working it's nothing it's just a

5:40:19

wrapper it's just a

5:40:22

wrapper on top of on top of open

5:40:28

API

5:40:31

on top of open a API it is what guys

5:40:33

tell me it's just a wrapper on top of

5:40:35

this open AI API and not this open a API

5:40:39

actually it can do a multiple thing so

5:40:42

it can do a multiple thing right so let

5:40:44

let me tell you what thing it can do

5:40:46

let's say this is your application so

5:40:48

here what I can do so let's say this is

5:40:49

what this is my application and here is

5:40:51

what here let's say I have used this Len

5:40:53

chain this is what guys tell me let me

5:40:55

change a color so this is what this is

5:40:56

my Len chain now if I'm us using this SL

5:40:59

CH so it can interact with many it can

5:41:03

interact to a many uh like apis like

5:41:06

hugging face open or with any third

5:41:08

party like API so let me draw it over

5:41:10

here this one this one okay now let me

5:41:13

do one more thing so over here let me

5:41:15

draw uh one more Circle and with that

5:41:18

maybe the thing will be more clear now

5:41:20

here what I can write it down let's say

5:41:22

this is what this is your application

5:41:24

okay so over here I can write it down

5:41:26

this is what this is your application so

5:41:28

this is this is

5:41:30

your app now it's making a request so

5:41:33

this request is going through this Len

5:41:36

you can uh think that it just it is

5:41:38

nothing just a prompt is we are passing

5:41:40

we want to interact with llm actually

5:41:42

large language model so here we are

5:41:43

passing a prompt so first it is going

5:41:45

through this Len chain this is what this

5:41:47

nothing this is my Len

5:41:49

chain now this Len chain actually it can

5:41:52

it can interact in a many ways so over

5:41:54

here I can write it down some sort of

5:41:56

API so here I can connect with the open

5:41:58

AI

5:41:59

open API I can connect with the hugging

5:42:04

face hugging face API I can connect with

5:42:07

a bloom

5:42:08

API and I can access a different

5:42:11

different

5:42:12

llm I can access what I can do I can

5:42:15

access a different different large

5:42:16

language

5:42:18

models getting my point yes or no and

5:42:20

apart from this this Len can connect

5:42:22

with a other data resources also with

5:42:25

some third party API like

5:42:27

Google like we

5:42:30

Wikipedia and some other data

5:42:35

sources now tell me guys this length

5:42:38

chain is clear to all of you what is the

5:42:40

length chain here I have uh here here I

5:42:43

created like each and every diagram and

5:42:44

with that particular diagram I have I I

5:42:46

try to explain you each and everything

5:42:49

regarding this Len chain so please do

5:42:51

let me know in the chat if this thing is

5:42:53

clear or

5:42:58

not

5:43:03

I'm waiting for your reply please do let

5:43:04

me

5:43:14

know yes I will share this PDF note with

5:43:16

all of you don't worry uh I will keep

5:43:19

inside the resource

5:43:28

section please do let me know in the

5:43:30

chat guys if this thing is clear then I

5:43:32

will proceed further I will proceed with

5:43:34

the

5:43:52

Practical great so if you are liking the

5:43:54

content then please hit the like button

5:43:56

also so I will get some more motivation

5:43:59

so yeah guys please hit the like button

5:44:02

and please be interactive if I'm asking

5:44:03

something then please try to answer

5:44:05

please please write down the answer in

5:44:07

the chat uh that will be a great

5:44:09

motivation for

5:44:23

me okay now let's start with the

5:44:25

Practical implementation so over here

5:44:28

you can see I uh started with a len

5:44:30

chain so let me uh run it first of all

5:44:32

so here is what here is what here is my

5:44:34

Len chain now uh here I'm going to be

5:44:37

import my open a uh this uh each and

5:44:40

everything I have explained in my

5:44:41

previous class itself now let me uh

5:44:44

import first of all let me check with my

5:44:46

key this uh I will have to generate a

5:44:48

openi key if I want to access the open

5:44:51

API now now I'm not directly going to

5:44:54

hit this open openi API I am hitting by

5:44:57

using this length chain

5:44:59

getting my point so here I will have to

5:45:01

mention the open API key so let me take

5:45:04

my open API key just a second

5:45:10

uh so here I can keep it somewhere just

5:45:17

wait uh so here is my openi key now let

5:45:21

me paste it over here this

5:45:24

one so yes I have created my client

5:45:27

means I have created my object now here

5:45:29

is what here is my prompt here is what

5:45:31

guys tell me here is my prompt now what

5:45:33

is the prompt guys tell me the prompt is

5:45:34

nothing in whatever see prompt is

5:45:37

nothing it's just a sentence which we

5:45:39

are passing to to our llm as a input

5:45:42

it's nothing just a collection of words

5:45:43

collection of tokens so word itself is

5:45:46

called a token that's it that's is a

5:45:48

prompt now over here if I'm going to run

5:45:50

it so let me run this particular prompt

5:45:54

and here you can see I'm asking to my

5:45:56

chat GPT sorry I'm asking to my GPT

5:45:58

model can you tell me total number of

5:46:00

country in the Asia can you give me top

5:46:01

10 country name yes it is able to give

5:46:03

it it is it is able to like provide a

5:46:06

name basically now let's start from here

5:46:08

because still here I've explained you

5:46:10

each and everything in the previous

5:46:11

class now let me give the next prompt

5:46:13

the second prompt so over here I can ask

5:46:15

something else to my uh GPD model now

5:46:18

tell me guys what should I ask any uh

5:46:21

any question anything which uh you would

5:46:24

like to highlight uh which should I

5:46:26

return return over

5:46:27

here

5:46:51

good so over here I didn't get

5:46:55

any okay so let's uh ask like any uh

5:46:58

basic question so can you tell me can

5:47:01

you tell me a

5:47:03

capital of

5:47:06

India so let's uh search about this

5:47:09

capital of India and here what I can do

5:47:13

I can run it and uh let me uh give this

5:47:16

particular input uh let me give this

5:47:19

particular prompt to my uh uh to my

5:47:23

model and I just need to call this

5:47:25

client. predict and here I need to

5:47:27

provide the prompt so client. predict

5:47:31

and here I just need to provide the

5:47:32

prompt so it is giving me answer it is

5:47:34

saying that the capital of India is New

5:47:37

Delhi now here let's try to strip this

5:47:39

uh particular output strip means it it

5:47:41

will remove the slend from here so I'm

5:47:44

going to strip it and here you can see

5:47:46

it is giving me an answer so I am

5:47:48

getting answer without this selection

5:47:50

now I think it is clear to all of you

5:47:52

now one person is asking that what

5:47:54

exactly tokens and Vector uh so here

5:47:58

let's Ty to ask this same question uh to

5:48:00

the GP or uh to the jpt model so what

5:48:04

I'm going to do here I'm going to uh

5:48:06

keep same question from the chat itself

5:48:09

and the question is what is a token and

5:48:12

a vector you can ask anything to your

5:48:14

chat GPT and behind the chat GPT

5:48:16

actually this uh behind the chat GPT the

5:48:19

GPD model is working so let's uh ask

5:48:21

about the tokens and the vectors and

5:48:24

let's see uh what will be the answer uh

5:48:27

which I will get from the GPD side so

5:48:30

let me predict this a prompt three and

5:48:33

here the answer is client. predict prom

5:48:37

three and see the answer tokens are

5:48:39

individual unit that a computer program

5:48:41

used to perform operation they can be

5:48:43

words symbol or numbers so the same

5:48:46

thing I told you now this tokens is

5:48:47

nothing just a words right that are used

5:48:50

in programming language to represent a

5:48:51

specific intersection Vector is data

5:48:53

structure that is store a elements of

5:48:56

the same time it is used to store

5:48:57

sequence of el such as number of

5:48:59

character so a vector is nothing what is

5:49:02

a vector vector is having two unit now

5:49:03

magnitude and the direction so how we

5:49:06

represent the vector in our algebra in

5:49:08

our algebra if you are like little

5:49:10

familiar with the algebric uh algebra

5:49:12

concept um algebra Concept in the

5:49:14

mathematics so we open the square

5:49:17

bracket we write it down some sort of a

5:49:18

number and we close the square bracket

5:49:20

that is the representation of the vector

5:49:22

and along with that maybe the direction

5:49:24

uh might be involved that's it so here

5:49:28

uh you you can see definitely we are

5:49:29

able to call the openi API now let's try

5:49:32

to understand few more thing related to

5:49:34

this length chain now here let's start

5:49:38

to talk about the prompt template the

5:49:40

very first topic which we're going to

5:49:42

talk about uh we want to talk about

5:49:45

related to this prompt template so first

5:49:47

I will show you the example of this

5:49:48

prompt template that how you can create

5:49:51

a prompt template and after that I will

5:49:53

um I will try to explain you that what

5:49:55

is a prompt template first let me run

5:49:57

the code so here is here is what uh we

5:49:59

are going to discuss about this prompt

5:50:01

template now I'm going to write it down

5:50:04

from length chain from length chain and

5:50:08

from here I'm going to import

5:50:10

prompts prompts and let me import this

5:50:13

prompt template class so

5:50:16

prompt prompt uh p r o m PT prompt

5:50:22

templates so I'm going to import this

5:50:24

particular class what is the name of the

5:50:26

class prom template okay it's not a temp

5:50:28

templ actually a template so prom

5:50:30

template now if I will run it so

5:50:32

definitely I will be able to import it

5:50:34

so here my spelling is wrong so let me

5:50:36

correct it first of all and here you can

5:50:38

see we are able to import this

5:50:40

particular class now after that what I

5:50:42

will do so here actually I want to

5:50:45

create my prompt right I want to create

5:50:48

my prompt now let me do it first of all

5:50:50

and then I will come to the explanation

5:50:52

so here what I'm going to do so I'm

5:50:54

going to create an object of this prompt

5:50:56

class so here is what here is my object

5:50:58

so I'm saying that it is nothing it is

5:51:00

my prompt template name so here I'm

5:51:03

going to write it down prompt template

5:51:05

this is what this nothing this is my

5:51:06

variable prom template name got it I

5:51:10

have created my object now inside this

5:51:13

object I have to pass some parameter so

5:51:15

let's try to pass few parameters over

5:51:17

here the first parameter which I'm going

5:51:19

to pass over here the parameter is going

5:51:21

to be input variable so here the

5:51:23

parameter which I'm going to pass over

5:51:25

here that's going to be an input

5:51:27

variable in input variable and the

5:51:29

second parameter which we're going to

5:51:30

pass over here that's going to be a

5:51:32

template so how my prompt will be

5:51:35

looking like so here I'm going to write

5:51:37

it down template and is equal to right

5:51:40

now in the variable actually I'm going

5:51:41

to write it down the name what will be

5:51:43

my variable so here I'm saying city city

5:51:47

will be my variable and here I'm going

5:51:48

to write it down my template now in the

5:51:51

template actually I'm going to write

5:51:53

down that uh can you tell me the capital

5:51:55

of so here I'm just saying that can you

5:51:58

tell me the capital of and here on a in

5:52:03

a curly braces I'm going to write it

5:52:05

down the city right City so c i t by so

5:52:09

here whatever uh this is what this city

5:52:11

is nothing it's my input variable so

5:52:13

here I'm going to write down the city so

5:52:15

this is what this is my object this is

5:52:17

what this is my object for the plum so

5:52:19

here I can put the question mark as well

5:52:21

and if I'm going to run it now here you

5:52:23

will be able to find out it is giving me

5:52:25

an error why because I didn't put the

5:52:27

comma over here now here you will you

5:52:29

can see this is what this is my prompt

5:52:31

template now what is the issue over here

5:52:33

input variable okay so the so the

5:52:37

parameter name is what input variable

5:52:39

now I think everything is fine

5:52:40

everything is clear now here what I will

5:52:42

do I will call one method I will call

5:52:45

one method just just be careful over

5:52:47

here right so here I will call one

5:52:49

method now here I'm going to write it

5:52:51

down format and here what was my

5:52:54

variable what was my input variable

5:52:56

input variable was City now if I'm going

5:52:58

to write down City so here let me write

5:53:00

it down this uh Delhi so here once I've

5:53:04

have done it now so it is giving me a

5:53:06

specific prompt that can you tell me a

5:53:08

capital of Delhi automatically right now

5:53:11

here see again I'm going to ask the here

5:53:14

again I want to create a prompt for uh

5:53:16

for a different country let's say I want

5:53:18

to ask a capital of China c i n now here

5:53:22

you can see it is saying uh it is uh

5:53:24

giving me a prompt that can you tell me

5:53:26

a capital of China can you tell me a

5:53:29

capital of China so what is the meaning

5:53:31

of this prompt template what what what

5:53:33

is the use of it now I think you can

5:53:35

understand so by using this prompt

5:53:37

template we can construct The Prompt

5:53:39

based on a input variable now let's say

5:53:42

you are going to create an application I

5:53:45

can give you very uh good scenario now

5:53:47

here is your

5:53:49

application right here is what here is

5:53:51

your application now you you have

5:53:53

created this application by using the

5:53:56

flas now here you are ask asking to the

5:53:58

user just a city

5:54:00

name just a city name or just a country

5:54:03

name actually and based on that city of

5:54:06

based on that country you want to

5:54:07

provide a specific information and here

5:54:10

you are using any sort of a

5:54:13

llm whether it's from hugging face or

5:54:15

open AI now guys over here uh you don't

5:54:20

want to be here actually you don't want

5:54:23

that that your user is giving a entire

5:54:26

prompt you just want to take take a you

5:54:29

just want to take a city name you just

5:54:31

want to take a variable like we do in a

5:54:34

python you know in a python we we have

5:54:36

an input function yes or no but and by

5:54:40

using this input function we take a like

5:54:42

input from the user and let's say we

5:54:44

have to uh showcase the addition uh

5:54:46

divide or maybe uh multiplication

5:54:49

whatever on top of those input variable

5:54:51

we can do it similarly over here let's

5:54:53

say we are taking just a city name so by

5:54:56

using this city name we can construct

5:54:58

our prompt and that particular prompt we

5:55:00

can pass to the

5:55:02

llm and Leng chain gives you this

5:55:05

particular functionality we don't have

5:55:06

this thing inside open AI API getting my

5:55:11

point now so here I have created my prom

5:55:13

now let's try to pass this prompt to the

5:55:15

length chain so what I can do here I can

5:55:18

write it down this is what this is my

5:55:19

prompt

5:55:20

first p o p

5:55:23

Mt prompt first this is what this is my

5:55:26

prompt first and here I can write it

5:55:28

down prompt second this is what this is

5:55:30

my prompt second and here is prompt

5:55:34

second now let's try to pass this

5:55:36

particular prom to

5:55:37

my to my llm or let's let's try to call

5:55:41

the API open API for that already we

5:55:43

have a method client predict so let's

5:55:45

try to call this particular prompt now

5:55:47

here I'm going to call the prompt first

5:55:50

this is the prompt which I'm going to

5:55:52

call and here uh I'm going to call I'm

5:55:54

going to write down this strip function

5:55:56

also so I won't get any sort of slash or

5:55:58

whatsoever right now here you can see

5:56:00

the capital of Delhi is India the

5:56:03

capital of New Delhi is India okay so

5:56:05

here I need to write it down just just

5:56:08

let me redefine it instead of the city

5:56:09

what I can do I can write down the

5:56:11

country right now uh this is what this

5:56:15

is my country and here instead of the

5:56:18

city let me write it down the country

5:56:20

one more time and here I can write it on

5:56:22

the India I think now it is it is a

5:56:25

meaningful now here I can write it on

5:56:27

the country one more time uh country c u

5:56:32

okay c u n c

5:56:35

o un n and here the

5:56:39

same here is a same and here is also

5:56:43

same now it's a meaningful and let me

5:56:46

run it and see what I will be getting

5:56:48

over here so prompt one prompt second

5:56:50

and here is uh like a it's a New Delhi

5:56:53

and let me check with a prompt two so

5:56:56

guys here what I can do I can pass the

5:56:58

prompt two and let's see the output it

5:57:00

is saying the capital of China is a

5:57:03

Bing so this prompt basically this

5:57:06

prompt template will help you a lot

5:57:09

whenever you are going to create any

5:57:10

sort of application where you just

5:57:13

required a single word from the

5:57:15

user this thing is clear to all of you

5:57:18

if yes then please do let me know in the

5:57:26

chat

5:57:29

please do let me know in the chat if

5:57:31

this part is clear to all of you please

5:57:32

write it on the chat I'm waiting for

5:57:34

your

5:57:39

reply are you liking the session are you

5:57:42

liking the content so please hit the

5:57:44

like button as well if you are getting

5:57:45

everything if you are able to understand

5:57:47

whatever I'm explaining to all of you

5:57:49

please do let me know in the chat and

5:57:53

yeah and whatever questions you have you

5:57:55

can write it down the chat I I I'm

5:57:56

monitoring the chat don't

5:58:04

worry wait S I will come to that again I

5:58:07

will try to explain the L and Advantage

5:58:09

first of all let me uh complete the code

5:58:11

part otherwise we won't be able to

5:58:12

complete all the thing within

5:58:23

R yes correct Vishnu your understanding

5:58:26

is pretty much clear now

5:58:28

since open AI model is not free uh so we

5:58:32

Len access all

5:58:35

API all other API as well like uh uh

5:58:38

hugging face API it can access the

5:58:39

hugging face API it can access the bloom

5:58:41

API or different different API I will

5:58:43

come to the documentation let me uh

5:58:45

clarify the basic basic thing uh

5:58:47

whatever is there inside the Lang chain

5:58:49

I will come to the uh

5:58:56

documentation great now here everything

5:58:58

is clear everything is fine so here we

5:59:00

have this uh here we have this object

5:59:03

name prom template uh name and here is

5:59:06

what here is my method that is what that

5:59:08

is a format now what I'm going to do

5:59:10

here H so here actually we have a second

5:59:12

method also which is doing the same

5:59:13

thing let me show you that at many

5:59:15

places you will find out that particular

5:59:17

method also I written it somewhere uh

5:59:20

just give me a second yeah this one so

5:59:22

it is working in a similar way langen

5:59:25

has given you the two ways actually for

5:59:26

creating this prompt so first of all see

5:59:29

we have this promp template

5:59:31

class we can create

5:59:34

object and we can call this method

5:59:36

format method got it now we have a

5:59:40

second way here you can see this one

5:59:43

prompt template. from template you can

5:59:46

call this particular method also and it

5:59:47

will work in a similar way both are same

5:59:49

don't ask me sir why we are using this

5:59:51

that Lenin is giving you the two option

5:59:53

for creating a prompt template right now

5:59:55

here you can see prompt template prom

5:59:56

template what is the good name of the

5:59:58

company that makes product I can write

5:59:59

it on any like name uh any uh product

6:00:02

name so here uh what I can say I can

6:00:05

give this particular uh okay first of

6:00:08

all let me run it and here is what I'm

6:00:10

going to call this format method over

6:00:11

here so from template do from temp prom

6:00:15

template. frommore template and here is

6:00:17

what here is my template template and

6:00:20

here is what here is my tell me what is

6:00:23

this this is my key now input variable

6:00:26

now right now now let me show you what I

6:00:28

will get over here so I will be able to

6:00:30

construct my prompt what is a good name

6:00:32

of the company that make a

6:00:34

toys here is my key and here is my

6:00:36

template it's going to combine both and

6:00:39

finally I'm getting my prompt so over

6:00:42

here what I can do so over here I can

6:00:43

write it down my prompt so this is what

6:00:46

this is my prompt number three and see

6:00:48

guys if I'm going to run it so what I

6:00:51

will get so here I'm if I'm going to run

6:00:52

it this promt three ah it will give me a

6:00:55

name it's not a 23 basically it's just a

6:00:58

three so let me run it and let's see

6:01:00

what would be the output so p r o p Mt p

6:01:04

r o MPT uh it's a spelling

6:01:08

mistake and now let me check it is

6:01:11

working or not so toy makers unlimited

6:01:14

so this is the company name actually

6:01:15

which I'm getting if I'm giving this

6:01:18

particular prompt to my GPT model you

6:01:21

can test over the chat GPD as well so uh

6:01:24

you will get this type of nam in the

6:01:26

back end we are calling the GPD model

6:01:27

don't forget over here don't forget okay

6:01:30

so we are getting a uh GPT we are

6:01:33

basically calling a GPT model over here

6:01:36

so this part is clear to all of you and

6:01:38

uh I think now this uh prompt part

6:01:41

prompt section is pretty much clear I

6:01:43

believe that it is clear yes or no this

6:01:46

uh prompt template if it is then uh

6:01:49

please confirm in the chat then I will

6:01:51

uh explain you the second topic that is

6:01:53

a agent agent in a lang chain and after

6:01:57

that I will come to the uh chain and

6:01:59

memory and document loader and finally

6:02:01

we start with the hanging phase so tell

6:02:04

me guys it is clear this uh prompt

6:02:06

templating how we can create a prompt

6:02:08

template great it is clear to all of you

6:02:10

now let's understand the agent so what

6:02:13

is an agent guys tell me so agent is

6:02:16

nothing we use this agent in the L chain

6:02:20

for calling any third party tool that's

6:02:24

a simple definition of the agent if

6:02:26

someone is going to ask okay just tell

6:02:28

me who is a

6:02:30

agent who is a agent in a real time

6:02:32

let's say if I'm saying uh there is one

6:02:34

agent uh let's say you uh went to the uh

6:02:37

any uh you want to purchase any property

6:02:41

you want to purchase any property and

6:02:42

you went to the Builder and you are uh

6:02:45

and uh once you visited the property and

6:02:48

you have visited the Builder office or

6:02:50

whatsoever there you will find out agent

6:02:52

so who is the agent actually so it's a

6:02:55

it will so let's say you are a main

6:02:57

person and uh you want the information

6:02:59

of the property so that you want a like

6:03:02

the main person and you want the

6:03:03

information from the of the property

6:03:05

basically so this agent will help you

6:03:07

this agent will collect the information

6:03:09

of that particular property and it will

6:03:11

provide you in a similar way the agent

6:03:14

is working over here getting my point

6:03:17

yes or no I think yes now let me run it

6:03:20

and let's try to understand the agent so

6:03:23

guys over here I will start the thing uh

6:03:26

I will ask ask one question to my chat

6:03:30

GPT so here I'm going to ask one

6:03:33

question to my chat

6:03:35

GPT just a

6:03:39

wait great so let me open my chat GPT

6:03:42

and here let me ask one question the

6:03:45

question is very very simple so here I

6:03:47

want to know that uh can you tell

6:03:53

me

6:03:55

current GDP

6:03:58

of

6:04:00

India so here uh I'm asking to my CH GPD

6:04:04

can you tell me the current

6:04:05

GDP of India now if I will uh run it so

6:04:09

here it is saying to me I'm sorry I

6:04:11

don't know in a real time as my training

6:04:14

only include information up to the

6:04:16

January 22 this that whatever getting my

6:04:19

point yes or no tell me so it is not

6:04:21

having uh this particular information if

6:04:23

I'm asking to my CH gbt can you tell me

6:04:28

who won the

6:04:32

Cricket World

6:04:35

Cup

6:04:39

recently now here see what I will

6:04:44

get so here it is saying guys I don't

6:04:47

have a real time

6:04:50

information only includes data up to

6:04:53

January

6:04:54

2022 or 20 202 20 okay as my latest

6:04:59

updated the most recent information

6:05:01

World Cup was held in 2019 emerged as a

6:05:08

champion defeating New Zealand in a

6:05:10

thrilling final so is giving me an

6:05:12

information from the 2019 match I think

6:05:15

India again uh uh like uh they out uh I

6:05:20

think uh they uh they they got defe from

6:05:23

the New Zealand itself right in a

6:05:25

knockout match in a semi-final itself

6:05:27

uh yes I'm able to remember it so here

6:05:30

uh it is not able to give me an answer

6:05:32

now let's ask the same thing uh through

6:05:34

the open so through the lench itself in

6:05:37

my code I'm going to write down the same

6:05:39

thing over here so here I'm going to

6:05:41

create a prompt for so I'm asking to my

6:05:43

model prompt 4 so here I'm asking to my

6:05:46

model can you tell

6:05:53

me who W the

6:05:56

recent

6:05:58

Cricket World

6:06:00

Cup so this is the question and now let

6:06:02

me ask it let me run it so what I can do

6:06:05

I can write it down this client predict

6:06:07

and here I can pass my prompt prompt

6:06:11

four now see uh okay first of all I will

6:06:15

have to run it p r o m PT p r o m PT now

6:06:21

see guys uh it is saying that uh the 201

6:06:25

won by the England I'm asking about the

6:06:27

recent World Cup but it is saying that

6:06:29

uh the 2019 Cricket World Cup won by the

6:06:33

England only it's completely wrong right

6:06:35

now here what I can do I can ask one

6:06:37

more thing can you tell me the current

6:06:39

GDP of can you tell me a current GDP of

6:06:42

India can you tell me current

6:06:47

GDP current GDP of India so let's see

6:06:52

what will be the answer so here is what

6:06:54

here is my prompt five let me copy it

6:06:56

let me paste it over here and here I can

6:06:59

write it down this prom

6:07:01

five so as of 2039 India GDP was

6:07:04

estimated to be around

6:07:06

2.94 trillion actually it has been

6:07:09

trained till 20 uh 22 data 2022 data

6:07:13

right so till January 2022 data right so

6:07:17

here it is not able to give me a proper

6:07:18

answer uh it is not able to give me a

6:07:21

real time answer so for that what I will

6:07:23

do guys tell me so here I will use the

6:07:26

agent I will use the concept of the

6:07:28

agent which will extract the information

6:07:31

from the third party API now here I'm

6:07:34

going to use Sur API now here so for for

6:07:42

extracting extracting or real time info

6:07:45

real time info I'm going to use I'm

6:07:49

going to

6:07:50

use Sur API Sur API Now by using the Sur

6:07:55

API

6:07:57

Now by using now by using this Ser

6:08:02

API I will now by using the Ser API I

6:08:05

will

6:08:06

call Google search

6:08:11

engine

6:08:13

and I will

6:08:16

extract the

6:08:19

information in a real time so here I

6:08:22

have written this particular uh like a

6:08:24

statement so I hope it is clearly

6:08:26

visible to all of you now let me keep it

6:08:29

in a mark down and it is clear so for

6:08:32

extracting a real time info I'm going to

6:08:33

use Sur API Now by using the Sur API I

6:08:36

will call Google search engine and I

6:08:38

will extract the information in a real

6:08:41

time let's see how you can do it so here

6:08:44

what I'm going to do so first of all I

6:08:45

will have to install this particular

6:08:47

Library pip install Google search result

6:08:52

that is the first thing now install this

6:08:54

library inside your current virtual

6:08:57

environment so here what I'm going to do

6:09:00

here I'm going to install this

6:09:02

particular here I'm going to install

6:09:04

this particular liity in my current

6:09:06

virtual environment where guys tell me

6:09:08

in a current virtual environment clear

6:09:11

fine now after that what I will do so

6:09:13

after that I will create my Sur API key

6:09:16

Sur API key because uh with that only I

6:09:19

can access I can access a different

6:09:21

different API now let me show you the

6:09:23

surp API so just open the Google so here

6:09:27

just open the Google let me show you

6:09:28

from scratch so over the Google what you

6:09:31

need to do you just need to uh okay so

6:09:33

here what I'm going to do I'm going to

6:09:34

write down the surp API so let me write

6:09:36

down this Sur

6:09:38

API so once I will write down surp API

6:09:40

now now here you will get this very

6:09:42

first link so what is a Sur API like uh

6:09:46

we have a rapid API now in a similar way

6:09:48

we have a Sur API so Sur API is a

6:09:50

realtime API to access Google search

6:09:52

result not from the Google actually and

6:09:56

from any search engine Bing or maybe

6:09:58

some other search engine even we can

6:10:00

access the Wikipedia also right I will

6:10:03

show you how so here uh if I will open

6:10:06

it now so you just need to do sign in

6:10:08

first you need to do register and then

6:10:10

you need to do the sign in I already

6:10:11

registered so that's why it is giving me

6:10:13

this particular page now just scroll

6:10:15

down over here just see over here API

6:10:18

documentation now in a over here you

6:10:20

will find out a different different

6:10:21

documentation related to Google search

6:10:23

API Google Map API Google job API Google

6:10:26

shopping API Google image API now apart

6:10:29

from the Google you will find out the

6:10:30

Bing Bing search API also by do

6:10:34

also BYU also it's a Chinese search

6:10:36

engine now Doug du go search API Yahoo

6:10:38

search API yendex search API eBay search

6:10:41

API YouTube search API any API you can

6:10:43

call by using this Sur API now just

6:10:46

click over here API key and here is what

6:10:49

guys here is my API key now you have to

6:10:52

generate your own API key this is my API

6:10:55

key now let me copy this API key from

6:10:58

here and it is having some sort of a

6:11:00

limitation actually you can just do a

6:11:01

100 search in a free version but in a

6:11:03

paid version I think uh you can uh like

6:11:06

increase the number of search so just

6:11:08

see over here just open it and you will

6:11:11

be able to find out entire

6:11:12

detail so plan is a free plan price per

6:11:16

mon

6:11:17

zero uh total plan s 100 plan search

6:11:21

left 995 5 I already did it and yeah

6:11:24

this is it in a free version you can

6:11:26

check check with the plan so just go in

6:11:27

the change plan and here you will find

6:11:30

out the entire detail so production plan

6:11:33

developer plan big data plan all the

6:11:36

plans you'll find out over here and by

6:11:38

using this API you can access the Google

6:11:41

search engine you can access the Google

6:11:43

search API inside your application right

6:11:47

now here what I need to do I just need

6:11:49

to paste this API key in my I just need

6:11:52

to keep this APK in my variable till

6:11:54

here everything is fine everything is

6:11:56

clear now what I will do guys so over

6:11:59

here I will I I have to like import few

6:12:03

uh I have to import few uh like import

6:12:05

uh statement basically uh I have to

6:12:07

import few packages so agent type load

6:12:10

tools and initialize agent so these are

6:12:13

the these are the like these are the

6:12:16

packages basically which I need to

6:12:17

import agent type load tool and

6:12:19

initialize agent so see guys uh let me

6:12:22

import this particular thing first of

6:12:24

all and yeah it is working F now first

6:12:27

of all what I will do first of all I

6:12:29

will create a ag first of all I will

6:12:31

create a client means here I've created

6:12:33

now this open a uh client this

6:12:36

one this one okay let me use this one or

6:12:39

I can create one more time not an issue

6:12:41

as many as time you can do it so here

6:12:43

what I'm going to do so here I'm going

6:12:44

to uh paste this particular code here

6:12:46

I'm going to create my client so this is

6:12:48

what this is my client now after that I

6:12:51

have to load the tools which tool tell

6:12:54

me which

6:12:55

tool which tool like we are going to

6:12:57

load Sur API now we are going to use the

6:12:59

Sur API now so that that's the only tool

6:13:01

right so here what I'm going to do I'm

6:13:03

going to create a object of this

6:13:04

particular method sorry this particular

6:13:07

class so here is what here is my object

6:13:10

now this is what this is my tool now

6:13:12

here I will mention something inside

6:13:14

this tool now let me do it over here so

6:13:16

let me uh mention this particular thing

6:13:19

so here I'm going to mention it so this

6:13:21

is a thing basically which I need to

6:13:23

keep Sur API uh first of all I need to P

6:13:26

The Sur API key and llm so here is what

6:13:29

here is my llm already I've created this

6:13:31

client I'm using open still I'm using

6:13:34

open okay I didn't uh explain you the

6:13:36

hugging face so far so this is my Sur

6:13:38

API key and here is the name which tool

6:13:40

you are using that's it in our square

6:13:42

bracket you need to write it down the

6:13:43

name you can find out each and

6:13:45

everything with the alen tuto lenion

6:13:47

documentation everything is there

6:13:50

everything is there I will come to that

6:13:51

just wait so here is what here is my

6:13:53

tool I created my tool now I have to

6:13:56

inal I have to create my agent type so

6:13:59

here what I want to do uh so here

6:14:02

basically what I want to do guys tell me

6:14:04

so here I want to create my agent type

6:14:07

so U here what I will do I will uh

6:14:10

create an object of this initialized

6:14:12

agent let me create the object of this

6:14:14

initialize agent and here is what guys

6:14:16

tell me here is my agent this is what

6:14:18

this is my agent now inside this

6:14:19

initialize agent again I will keep

6:14:21

something so first of all the first

6:14:22

thing which I will keep that is going to

6:14:24

be a tool so the tool basically which

6:14:26

which I've created the second type will

6:14:28

be a client means my model the third

6:14:30

type will be a agent this agent this

6:14:32

agent uh basically agent type actually

6:14:35

and here we are going to talk about this

6:14:36

zero short react description we are

6:14:38

going to mention this zero short react

6:14:40

description and verbos to means whatever

6:14:42

information um what if I will run it now

6:14:44

so whatever information will be in a

6:14:46

back end I will be able to see not over

6:14:47

the display there's the meaning of the

6:14:49

bbos right so here I mentioned three

6:14:51

parameters the first is tool the second

6:14:53

is client the third is Agent

6:14:56

and the first fourth is barbos great now

6:14:59

let me run it so this is what this is my

6:15:01

agent now what I will do so here I will

6:15:04

write it down agent and I will run so

6:15:07

run now here I will ask the same

6:15:10

question so my question was let me take

6:15:13

this particular question from the chat

6:15:15

jpt can you tell me the okay so can you

6:15:18

tell me who won the recent World Cup so

6:15:20

if I'm going to ask the same question

6:15:22

now to my

6:15:24

agent so here what I'm going to do I

6:15:26

going to ask it and let's see what I

6:15:28

will be what I will be getting so it is

6:15:30

executing the agent and here is search

6:15:32

here is action who won the Cricket World

6:15:34

Cup and here you can see Australia won

6:15:37

the Cricket World Cup it's a recent

6:15:41

information it's a real time information

6:15:42

which I'm getting now it is giving me

6:15:44

many given me some other thing as well

6:15:46

links and all because it is calling the

6:15:48

Google API Google search engine actually

6:15:50

in a back end and here you can see it is

6:15:52

giving me answer a on the recent World

6:15:54

Cup you can ask anything

6:15:56

you can ask anything guys just just uh

6:15:58

write it down over here so you can say

6:16:01

that

6:16:03

uh can

6:16:06

you tell me five

6:16:10

current can you tell me five top current

6:16:19

affairs a f i i RS so if I will learn it

6:16:23

now it will hit the Google search enger

6:16:26

and here it is saying that see uh so it

6:16:31

is saying that top five current affairs

6:16:34

and still it is running so read is not

6:16:37

available tool try to open I should

6:16:40

search engine to find out observations

6:16:42

see here it is giving me

6:16:44

some like top five current affairs

6:16:47

International breaking news uh affairs

6:16:50

from us Europe this is the second one a

6:16:53

current affairs Subs is one of the best

6:16:55

known as a improved life

6:16:56

jagaran Jo affairs.com okay it has given

6:17:01

me a different different website maybe

6:17:03

or uh it here is a news Okay so actually

6:17:07

it is giving me a different different

6:17:08

name it it is not giving me a proper

6:17:11

current affairs I will have to mention

6:17:13

that I will have to write uh that

6:17:14

particular prompt basically so let's do

6:17:17

one thing now let's understand the

6:17:18

Wikipedia also so how we can uh like

6:17:20

call the Wikipedia so here what I will

6:17:23

do I will be writing down pip install

6:17:25

pip P install

6:17:28

Wikipedia now I will have to install it

6:17:31

in a current virtual environment now if

6:17:32

I will run it now pip install Wikipedia

6:17:34

so let it run uh so here you can see

6:17:37

I've installed the Wikipedia now what I

6:17:38

will do first of all guys see tell me

6:17:41

what is the first thing I have to load

6:17:42

the tool so let me load the Tool uh so

6:17:46

here is what guys see here is my tool

6:17:49

and here is my LM means my client open a

6:17:51

client that's it now my tool now what I

6:17:53

have to do I have to create an agent so

6:17:56

here is what here is my agent this is

6:17:58

what my agent I have initialized the

6:17:59

agent here is my tool here is my like

6:18:01

model and here is my agent type zero

6:18:04

short react I will come to that what is

6:18:06

this react description and BOS equal to

6:18:08

two once I will run it and here whatever

6:18:11

I will run now see I'm going to write

6:18:14

down uh agent dot run and here I'm

6:18:19

asking can

6:18:21

you tell

6:18:23

me more can you tell me about this re uh

6:18:28

okay can you tell me more about this

6:18:32

recent

6:18:34

Cricket c i c k e Cricket World

6:18:39

Cup so if I will run it now it is going

6:18:42

to extract the entire information from

6:18:44

the

6:18:47

Wikipedia okay it is it is taking from

6:18:49

the 2019 World

6:18:51

Cup okay it is taking from the 2023

6:18:54

World Cup itself the World Cup for the

6:18:56

39 Cricket World Cup which was H in

6:18:58

India 5th October November 23 Australia

6:19:01

won the

6:19:01

tournament great so it is excting a

6:19:04

information from the uh recent one

6:19:07

itself now here I can ask one more

6:19:10

question to my just a second what I can

6:19:13

do I can copy it first of all let me

6:19:15

copy this particular thing and here what

6:19:18

I'm going to do here I'm going to pass a

6:19:20

next question so the next question is so

6:19:23

let me keep the question over here

6:19:26

uh let me run

6:19:28

it it is taking the information from the

6:19:30

Wikipedia itself are you getting it guys

6:19:33

yes or no yes surf I explain you

6:19:35

everything regarding the surf API s if

6:19:38

you are here if you look into the surf

6:19:40

API right so each and every plan I have

6:19:43

shown you and it give you the free uh

6:19:45

access also but up to uh like it is

6:19:48

having some limitation over there you

6:19:50

can just hit 100 search you can just hit

6:19:53

the 100 100 search in a free version if

6:19:55

you're going to take a plan so in that

6:19:57

case uh there will be a different uh

6:19:59

number of search actually search plan is

6:20:02

there different different plan is there

6:20:03

see Di okay

6:20:06

$2,500 per month $8,000 per month Cloud

6:20:09

for plan many plans is there see guys

6:20:12

how much plans is

6:20:14

there uh which you will find out just go

6:20:17

through with it I let me give you this

6:20:18

particular link inside the chat and

6:20:20

don't worry each and everything will be

6:20:22

available inside the resource section at

6:20:23

the single place uh at the single place

6:20:26

I will keep all the thing and I will

6:20:28

give you that don't worry so now see it

6:20:30

is extracting the entire information

6:20:32

from the uh like uh it is going to

6:20:35

extract the entire information from the

6:20:37

vikkipedia so final answer the total

6:20:39

National dep of the this one and here

6:20:42

you can see this is the GDP of the uh

6:20:45

USA and here observation and all

6:20:49

everything everything now see action

6:20:52

Wikipedia input GDP of United State

6:20:54

observation p economy of United States

6:20:57

summary this is the complete information

6:21:00

complete information which is going to

6:21:01

fetch which it is fetching from the

6:21:03

Wikipedia itself now tell me guys how

6:21:06

many of you you are able to understand

6:21:08

the concept of the agent so please let

6:21:11

do let me know in the chat and then

6:21:12

again I will revise it and I will

6:21:14

explain you uh through the lench and

6:21:16

documentation please do let me know in

6:21:18

the chat first if you are how many of

6:21:20

you are able to understand the concept

6:21:22

of this

6:21:23

agent here from here I have started this

6:21:26

agent tell me guys

6:21:34

fast by using the Sur API we can uh

6:21:37

access uh we can access a real time

6:21:41

information and it is possible in a is

6:21:44

possible in a len

6:21:47

chain please do write it down in the

6:21:49

chat if you're liking the uh session so

6:21:51

please hit the like button also and I'm

6:21:54

waiting for your response guys please

6:21:55

please do let me

6:21:57

know sir please explain the logs which

6:22:00

is coming from the agent so here I can

6:22:02

explain the log so here is what here is

6:22:04

my logs what is this uh what is it uh

6:22:07

just check over here so it is saying

6:22:09

entering new agent executor chain so

6:22:12

after this I'm coming to the chain

6:22:14

concept chain and memory two thing is

6:22:16

remaining and the document loader three

6:22:18

is remaining uh uh then uh you will be

6:22:21

able to understand this chaining and all

6:22:22

in a better way now here entering a new

6:22:25

you execute a chain so action is what it

6:22:29

just want to search now action input top

6:22:31

current affairs so it is making

6:22:33

observation it is searching everything

6:22:34

from the Google then it is thinking

6:22:36

something I need a narrow down the list

6:22:38

of top five internally it is doing

6:22:40

everything internally it is doing

6:22:41

everything and it is giving you the

6:22:43

final answer this one finished chain

6:22:45

actually each and everything has been

6:22:47

coded in the form of chain llm chain I'm

6:22:50

coming to that chain and once you will

6:22:53

understand that particular chain now

6:22:54

this thing will be are like pretty much

6:22:56

clear to all of you believe me just just

6:22:59

read it by yourself as

6:23:05

well what is the use of client in this

6:23:07

what is a just it's just a name now what

6:23:09

is a client see I told you please learn

6:23:12

the python first if your python uh topic

6:23:15

is clear then definitely you will be

6:23:17

able to understand this line of code see

6:23:20

someone has created openi class

6:23:22

somewhere in openi P you just downloaded

6:23:24

that you just downloaded that particular

6:23:27

package by using pip install openi and

6:23:29

now you are creating a object of that it

6:23:31

is just is just a class and here is a

6:23:33

object this is the object name you can

6:23:35

keep it anything here you can give your

6:23:37

name like whatever name your name just

6:23:39

write it down your name this is what

6:23:41

this is nothing this is the object of

6:23:42

the openi class and here you are passing

6:23:44

a different different

6:23:46

parameter someone has created a class

6:23:48

and you are just using it that's it

6:23:51

nothing else so this is what this is my

6:23:54

client and I think this is clear to all

6:23:56

of you now coming to the next part so

6:23:59

here first of all let me show you the

6:24:01

Lenin documentation so I'm going to

6:24:03

write it down over here Lenin

6:24:05

documentation now over here uh like uh

6:24:09

you can see this is what there is

6:24:10

nothing there's a Lenin documentation

6:24:12

and here is an introduction so they have

6:24:14

given you the complete introduction of

6:24:16

the lenen over here Lenin Library lenen

6:24:18

template Lang server Lang Smith

6:24:21

everything you will find out over here

6:24:23

and this document is a

6:24:25

amazing one similar to this open a uh so

6:24:29

yesterday we have seen the open a

6:24:30

documentation right so this length chain

6:24:32

documentation is similar to that openi

6:24:35

documentation it's a pretty amazing each

6:24:37

and everything you will find out over

6:24:38

here itself each and everything you will

6:24:41

find out over here itself now let's

6:24:43

start with the installation so how you

6:24:45

can do that it is very very easy pip

6:24:47

install length chain and pip install and

6:24:49

all what is the meaning of this pip

6:24:50

install hyphen e dot so this thing we'll

6:24:52

try to understand in our upcoming

6:24:54

session once I will start with the end

6:24:56

to end project now L server we try to

6:24:59

understand this also what is the Lang

6:25:00

server all L CLI so many like they have

6:25:02

given you over here as of now this lch

6:25:05

package is required that's why we are

6:25:07

going to download it now over here we

6:25:09

have a quick start so here you will find

6:25:11

out the quick start so you can go

6:25:12

through with this quick start and you

6:25:14

can uh like you can take a glimpse of

6:25:17

this Len CH so everything you will find

6:25:19

out over here in a quick start itself

6:25:21

pip install lch pip install open a you

6:25:24

can export the open a key key and then

6:25:25

you can use it and here is a different

6:25:27

different thing which you will be able

6:25:29

to find out whatever thing we are

6:25:31

running so open a you can uh create

6:25:34

object of this chat openi also now here

6:25:37

is llm model here is U you can use this

6:25:39

particular class also chat open AI now

6:25:42

human messages lch schema human message

6:25:45

there you can check with this what is

6:25:46

this now you can create a prompt

6:25:47

templates already we have created now

6:25:50

just see over here what is a what is a

6:25:52

PR prom template most llm application do

6:25:54

not do not pass user input directly into

6:25:57

llm most of the application you will

6:26:00

find out you just require a single word

6:26:02

I given you the example yes by using

6:26:04

this prompt template you can achieve

6:26:06

that particular functionality and here

6:26:08

is example for that got it now here is a

6:26:11

chat comprom template so each and

6:26:13

everything you'll find out over here and

6:26:17

uh as uh like you will find out the

6:26:19

latest version so there might be some

6:26:21

sort of a changes in a code and all but

6:26:24

don't worry the concept ccept will

6:26:25

remain same we'll find out some changes

6:26:28

in a code in a classes the name of the

6:26:30

classes but the core concept will same

6:26:33

if you're getting any error in a new

6:26:35

version then check with the like

6:26:37

documentation and try to rectify it

6:26:39

that's it so here is a quick start and

6:26:41

you can go through with this quick start

6:26:43

and you can understand a different

6:26:44

different things now security wise they

6:26:45

have given you the different different

6:26:46

thing now let me come to the next part

6:26:48

so over here just click on this G to

6:26:50

started again they have given you the

6:26:52

different different uh thing prompt is

6:26:54

there model is there which model you

6:26:56

going to use output parser entire

6:26:57

pipeline okay R they have included their

6:27:00

R also now okay so retrieve augumented

6:27:03

generation so you can go through with

6:27:05

this and you can understand what is this

6:27:06

R but don't worry I will cover this in

6:27:08

my uh next class this RG it is I'm

6:27:12

having this R in my pipeline so I will

6:27:13

try to cover it this U uh in a live

6:27:15

class itself in a Jupiter notebook

6:27:17

itself I will write it on the code now

6:27:19

over here you can understand about a

6:27:21

different different thing different

6:27:22

different concept just just go through

6:27:23

with this document it's amazing one now

6:27:25

interface is there so prompt chat model

6:27:28

llm out part are retriever tool these

6:27:30

are the things just just go through with

6:27:32

this try to understand it now how to so

6:27:34

here is a different different thing

6:27:36

which they have mentioned Right add

6:27:38

fallbacks bind R time runable Lambda

6:27:41

many things right so here you will find

6:27:43

out the cookbook so inside the cookbook

6:27:44

everything they have given you

6:27:46

everything prompt plus LM so the thing

6:27:48

basically which we are going to do over

6:27:50

here uh which we are going to do as of

6:27:51

now they have mentioned it over here R

6:27:54

RG this was this was not there

6:27:57

previously when I had checked recently

6:27:59

they have added in a new version so R is

6:28:01

there so here you will find out the code

6:28:03

related to the r see this one now here

6:28:05

multiple chains chains I will come to

6:28:07

this chains after this one I will

6:28:08

explain this chains right so here you

6:28:10

can see the change and all so each and

6:28:12

everything they have given you but as of

6:28:14

now we are trying to understand this

6:28:15

particular part we are trying to

6:28:17

understand this agent and we are trying

6:28:18

to understand this model input output so

6:28:21

prompt already we talked about chat

6:28:23

model already I shown you by using the

6:28:24

open

6:28:25

so this is like pretty amazing document

6:28:27

guys so once you will go through with

6:28:29

this document now you will find out uh

6:28:31

it is having so many things and they

6:28:33

have given you the code and all each and

6:28:34

everything they have provided you

6:28:36

believe me guys so just go through with

6:28:37

this one and try to understand uh

6:28:40

different different thing or whatever

6:28:41

thing basically is there so we going to

6:28:43

understand this chains now and we'll be

6:28:45

try we'll try to understand this memory

6:28:47

but apart from this chains and memory it

6:28:49

is having lots of thing which uh we

6:28:51

might uh we might use in our application

6:28:55

if if you are creating application now

6:28:57

so this concept uh like might come into

6:28:59

the picture regarding the RG or

6:29:01

regarding a different different one

6:29:02

different different topic basically

6:29:04

which they have included but over here I

6:29:06

would like to tell you one thing

6:29:07

whatever I'm explaining you in a Jupiter

6:29:09

notebook U if you are a beginner that

6:29:12

definitely it's a more than uh it's more

6:29:13

than enough for all of you and uh in the

6:29:16

next class once uh when I once I will

6:29:18

implement the project now then uh you

6:29:20

will find out the importance of it and

6:29:22

don't worry I will uh keep some latest

6:29:25

thing also like R and all inside my

6:29:27

project and inside my uh future classes

6:29:29

and you will get to know that so here uh

6:29:32

I have given the overview now let me

6:29:35

talk about this uh agent type so there

6:29:37

basically you have seen one thing that

6:29:39

was the agent type now let me talk about

6:29:42

this agent type what is this so here you

6:29:45

can see guys in a agent itself you'll

6:29:47

find out the agent type see agent type

6:29:49

just just click on this agents and here

6:29:51

you will find out the agent type now we

6:29:53

have a different different type of agent

6:29:54

zero short Agent Zero short react agent

6:29:57

structure input react

6:29:59

agent openi function yesterday I have

6:30:02

talked about this openi function and now

6:30:05

it's a legacy people are not using it

6:30:08

people are using this agent concept from

6:30:11

the lench and directory people are not

6:30:13

using this open function uh but still I

6:30:16

have explained you that so here you will

6:30:18

find out the conversation self ass react

6:30:20

documentation and all and this zero

6:30:21

short is nothing it's a basic one so if

6:30:23

you're going to ask something to your LM

6:30:25

model to your GPT model so you will use

6:30:27

the zero shot react now here you will

6:30:30

find out this this agent use a react

6:30:31

framework to determine which tool to use

6:30:33

based on a solar on the tools

6:30:35

description so whatever tool description

6:30:37

you are giving based on that it will

6:30:38

search the uh like compatible tool and

6:30:41

it will provide the prompt to that

6:30:42

particular search engine or to that

6:30:45

particular tool and it will give you the

6:30:46

out that's it zero short

6:30:48

react now here this is the most general

6:30:51

purpose action agent you can see the

6:30:54

node so this thing is clear to all of

6:30:56

you now let's start with the

6:30:58

chains so are you comfortable till here

6:31:01

and if you're not able to write it on

6:31:02

the code along with me sometimes it

6:31:05

happens in the live session don't worry

6:31:07

just listen to me just listen to my

6:31:09

words whatever I'm saying and practice

6:31:11

after the class practice after the live

6:31:14

session recording will be there and

6:31:16

resources also will be there so let me

6:31:18

write it the chain over here and let's

6:31:20

start with the chain

6:31:23

now

6:31:25

so first of all tell me guys this part

6:31:27

is getting

6:31:30

clear how many days you will take to

6:31:33

come up with an end to end project one

6:31:35

day only one day I will take to come up

6:31:36

with an end to end

6:31:39

project so lench is only made for the

6:31:41

NLP use case or any other compete

6:31:43

capabilities also it is having as of now

6:31:45

I have used this for the NLP use cases I

6:31:47

will have to explore the recent uh thing

6:31:49

whatever is there inside the Lenin maybe

6:31:52

uh we can use it for the other uh like

6:31:54

for the other task also but I haven't

6:31:56

explored it for the other task I just

6:31:57

use for the NLP once I will explore it I

6:32:00

will let you know that whatever recent

6:32:01

update is there but if you want to know

6:32:03

about it just go through with the recent

6:32:12

documentation all the llm has only text

6:32:14

or code generation capability yes but

6:32:16

you can do many whatever NLP task is

6:32:19

there now you can do by using the llm

6:32:20

because it is having the code generation

6:32:22

capability with that it can understand

6:32:24

the pattern inside the data so you can

6:32:27

fine tune it it is uh possible you can

6:32:29

fine tune inside your CPU Itself by

6:32:31

using your CPU I will let you know uh

6:32:34

otherwise I will share the resources

6:32:36

with all of you uh don't worry we we'll

6:32:39

come to that and uh we'll try to talk

6:32:41

about it uh not as of now later on but

6:32:44

yeah uh I will give you the glimpse of

6:32:53

that

6:32:58

great uh I think uh now people are

6:33:02

getting many

6:33:06

things we are using uh not completely

6:33:10

actually if you don't know about those

6:33:12

thing you won't be able to understand

6:33:14

this particular part that's why first I

6:33:16

started from the basic from the open

6:33:18

itself otherwise directly I can start

6:33:20

from the lch and then uh again you will

6:33:22

ask to me sun what is this uh

6:33:25

what is this open Ai and what is this

6:33:28

llm what is this genitive AI I can even

6:33:32

I can start from here itself from the

6:33:34

Leng chain so but I started from the

6:33:36

very

6:33:53

basic

6:34:09

okay so let's start with a a new topic

6:34:13

uh that's a chain so what is a chain so

6:34:15

let's understand the

6:34:17

chain so first of all I can uh show you

6:34:20

the documentation and

6:34:23

uh

6:34:25

just a

6:34:31

wait great so here actually what I did I

6:34:33

kept one a simple definition of the

6:34:35

chain and let me copy and paste

6:34:53

it

6:34:58

so here is a definition just try to read

6:35:00

this particular definition and try to

6:35:02

understand the meaning of chain and it

6:35:04

will be more clear once I will write it

6:35:06

on the code so Central to length chain

6:35:08

is a vital component uh known as a lang

6:35:10

chain chains forming the core connection

6:35:12

among one or several large language

6:35:15

model in certain sophisticated

6:35:17

application it become necessary to chain

6:35:19

llm together either with each other each

6:35:23

other or with other element so if you're

6:35:26

not able to understand by this

6:35:28

particular definition so let me open the

6:35:30

documentation for all of you so here in

6:35:33

the go inside this more uh just click on

6:35:35

this more and here is a chain just uh

6:35:38

read about this chain so using an llm in

6:35:42

isolation is fine for a simple

6:35:44

application but more complex application

6:35:47

require chaining llm either with each

6:35:50

other or with other component now what

6:35:53

is the meaning of it

6:35:54

so just uh okay so I have uh explained

6:35:58

you the agent that's why I explain you

6:36:00

the agent at the first place and then I

6:36:01

came to this chain now tell me guys this

6:36:06

llm was not working over there so I

6:36:10

changed what I did now I Chang I changed

6:36:13

the terminology so what I did guys now I

6:36:16

so this LM was not working for that

6:36:18

particular prompt so after coming to

6:36:20

this llm means let's say if I'm not

6:36:22

getting any sort of output so I came to

6:36:24

to this

6:36:25

chain and this chain actually it was

6:36:28

connecting to me it was connecting to me

6:36:31

to The Sur API through the surp API

6:36:35

basically it was connected to me Google

6:36:37

search engine getting my point so here

6:36:41

what is the meaning of chain so chain is

6:36:43

nothing okay if if you're talking about

6:36:45

chain in journal so let's say this is a

6:36:49

chain so something like this you will

6:36:51

find

6:36:52

out so what is this what do this guys

6:36:54

tell me so chain is nothing which is uh

6:36:58

like connecting a several

6:37:01

components which is connecting a several

6:37:04

component getting my point yes or no I

6:37:07

think you are getting try to understand

6:37:08

it what is a chain so chain is nothing

6:37:10

it is just connecting a several

6:37:12

component so here they are

6:37:15

saying using llm in isolation it's fine

6:37:20

but in complex application require

6:37:23

chaining that the example I shown you by

6:37:25

using the agent if you will read it if

6:37:28

you will read the answer of the if

6:37:31

you'll read the answer of the agent

6:37:33

agent I'm running agent don't run and

6:37:34

you are getting an answer so if we'll

6:37:36

read that you'll find out it is chaining

6:37:38

means for is trying to find out

6:37:40

somewhere else it's not able to get then

6:37:42

again it is going to somewhere else and

6:37:44

it's going to take a information then

6:37:45

again it is going to call some other

6:37:47

prompt and it's going to take a

6:37:50

information so what is a chain so chain

6:37:52

is nothing it's a collection of

6:37:54

component now which component what

6:37:56

component whatever component maybe

6:37:59

inside the uh like uh uh like whatever

6:38:02

let's say we are using length chain and

6:38:04

inside that we have a different

6:38:05

different component I'm going to chain

6:38:07

to those particular component and maybe

6:38:09

I'm going to uh like connect with other

6:38:11

llm so I can do that as well or maybe

6:38:13

I'm going to connect any third party API

6:38:16

I can connect that as well so I'm doing

6:38:18

a chaining if I'm running chat agent.

6:38:21

run now internally it is doing a

6:38:23

chaining

6:38:24

getting my point I think you're getting

6:38:26

now let's try to understand in terms of

6:38:28

python code so here first I will start

6:38:31

with a very basic example so what I can

6:38:35

do here so here uh first of all I can

6:38:38

write it on my

6:38:39

client so here is my client guys c r i e

6:38:42

n t this is what this is my client now

6:38:44

what I will do guys so here I'm going to

6:38:47

import The Prompt template so this is

6:38:49

what this is my prompt template and by

6:38:51

using this prompt template I'm going to

6:38:53

create I'm going to

6:38:55

create uh I'm going to create one prompt

6:38:59

so here is what here is my prompt so

6:39:01

what is a good name for a company that

6:39:03

makes a product so here I can run it and

6:39:05

let's say uh I'm going to write it down

6:39:08

any company name so okay I'm going to

6:39:10

write down the uh actually I want a

6:39:12

company name what is a good name for a

6:39:14

company that makes a product so I'm just

6:39:18

asking to my chat GP okay I I'm making

6:39:20

this particular product just give me a

6:39:21

good name for this particular company so

6:39:23

here I'm going to write down let's say

6:39:24

wine so wi so here I uh I'm uh just just

6:39:28

think that uh just think like that that

6:39:30

I'm going to open a company uh and here

6:39:33

I'm going to produce a wine and all uh

6:39:35

okay so I want a name any creative name

6:39:39

okay that I'm asking to my LM model now

6:39:42

here if I will uh like close it so what

6:39:45

I'm going to do so here I'm going to run

6:39:46

it so uh prompt. format so this is what

6:39:50

this is my prompt what is a good company

6:39:52

name for a what is a good name for a

6:39:54

company that makes a wine so that's

6:39:56

going to be my

6:39:57

prompt p r o p Mt so this is what guys

6:40:01

this is my prompt now what I will do so

6:40:03

here actually I'm going to import the

6:40:06

chain here I'm going to import this llm

6:40:09

chain here I'm going to import the llm

6:40:11

chain just just be with me just for uh

6:40:14

next 5 minute everything you will get

6:40:18

it's my promise to all of you I have

6:40:20

simplified every thing every uh like uh

6:40:23

every line of code just be with me next

6:40:25

for 5 minute so here you can see we have

6:40:27

a llm chain now what I'm going to do I'm

6:40:29

going to create a object of this llm

6:40:33

chain now guys uh here I'm not going to

6:40:36

call a predict method I'm not going to

6:40:40

call a predict method what I'm going to

6:40:41

do so here in this llm CH what I'm going

6:40:44

to pass guys I'm going to pass client

6:40:46

right and I'm going to pass my prompt

6:40:49

that's it this two thing I'm going to

6:40:50

pass so llm llm is what c l i n t and

6:40:54

here I'm going to pass my prompt so p r

6:40:56

o p Mt prompt is equal to

6:41:00

prompt so I passed the client and I

6:41:03

passed the prompt here now this is what

6:41:05

this is my llm Chen right I'm going to

6:41:07

connect both component LM and my prompt

6:41:11

now over here what I'm going to do so

6:41:13

this is what this is my chain this is

6:41:14

the object basically which I have

6:41:15

created now here you can see it is

6:41:18

saying that uh it is giving me

6:41:21

a why I'm getting it let me check with

6:41:24

the

6:41:28

prompt so here uh let me run it first of

6:41:32

all what is a good company that makes a

6:41:38

wine okay from template uh I think I

6:41:42

will have to

6:41:43

use format uh I think I will have to use

6:41:48

this particular prompt only uh this one

6:41:50

this only uh let me delete it because it

6:41:52

is asking

6:41:54

I need to provide in the form of

6:41:56

dictionary so I cannot pass a direct

6:41:58

prompt over here what is a uh because uh

6:42:01

here whenever I'm running this uh

6:42:03

whenever I'm calling uh the run method

6:42:05

Now by using this chain then

6:42:06

automatically it will uh like take the

6:42:08

name from here itself so let me delete

6:42:10

it let me delete this particular line

6:42:12

I'm going to delete it guys this one so

6:42:15

here is what here is my prompt now Len

6:42:17

chin llm chain and here now it is fine

6:42:20

now what I will do here I'm going to

6:42:22

write down chain and chain. run and here

6:42:26

actually I need to pass the value so

6:42:28

here I'm going to pass y now if I will

6:42:31

run it now see it is giving me answer

6:42:34

the name of the company is what it's a

6:42:37

uh sdip strip and is the name of the

6:42:41

company is what Vintage Wines Winery so

6:42:44

it it has given me a name of the company

6:42:47

like I want to create this particular

6:42:48

product and here it has generated answer

6:42:52

now I'm going to change

6:42:54

I I'm making a chain by using two

6:42:57

components the first one is llm model

6:42:59

that is that I'm getting from the openi

6:43:02

and which is available inside my client

6:43:04

and the second is what second is a

6:43:06

prompt which I'm passing over here so

6:43:08

now I can directly run it by giving the

6:43:10

keyword and here you can see I'm getting

6:43:12

answer so I'm changing this two thing

6:43:14

this is the simple this is the simplest

6:43:16

uh like uh there simplest example I've

6:43:18

given you now let come to the second

6:43:20

example so over here what I'm going to

6:43:22

do so here I'm giving the the second

6:43:24

example example

6:43:27

two example two so I took one more

6:43:31

example to for explaining uh this

6:43:33

chaining part actually so here uh let me

6:43:36

copy and paste so here is what guys here

6:43:38

is my prompt template this is what this

6:43:40

is my prompt template now here I'm

6:43:42

asking uh this is what this is my

6:43:44

template I want uh to open a restaurant

6:43:47

for cuisin Indian cuine Chinese cuisine

6:43:49

Mexican Cuisine Japanese cuisin American

6:43:51

Cuisine whatever for that I want a f see

6:43:54

name this is my prompt template let me

6:43:56

run it here I'm running it now if you

6:43:59

will find out the prompt template so

6:44:01

here you will find out the prompt

6:44:02

template so this is what this is my

6:44:03

prompt template got it now what I will

6:44:07

do guys here I will make a chain so what

6:44:09

I'm going to do so here I'm going to

6:44:11

make a chain so let's say uh this is

6:44:13

what this is my chain so llm chain and

6:44:16

I'm going to combine two thing first is

6:44:18

client and the second is what the second

6:44:20

is promt template now if I will uh run

6:44:23

it so so here I'm getting my chain then

6:44:25

I will write it down chain do run now

6:44:28

I'm uh let's say I'm giving something

6:44:31

over here let's say I'm giving uh

6:44:34

Chinese so according to that it will

6:44:37

give me answer so the answer which I'm

6:44:39

getting the golden dragon dragon place

6:44:42

so here what I'm getting guys I'm

6:44:43

getting this Golden Dragon place so the

6:44:47

emperor's kitchen that's the name okay

6:44:50

if I'm writing over here uh Indian let's

6:44:52

say what I will be getting so Indian so

6:44:55

here actually I'm getting Maharaja

6:44:56

Delight so just the name it is

6:44:58

suggesting me one name which I'm asking

6:45:01

to my llm model that's it now let me

6:45:04

show you few more thing over here now so

6:45:07

here I'm getting a a response and the

6:45:09

response is fine now let me uh come to

6:45:13

the second thing second example so here

6:45:16

what I'm going to do so here let me show

6:45:19

you something so now over here if you

6:45:22

want to see the detail actually so for

6:45:24

that I have mentioned one more thing

6:45:25

that is a verbos parameter as I told you

6:45:28

earlier if I want to check all the

6:45:29

detail whatever is happening in back end

6:45:31

so for that there is a parameter verbos

6:45:33

is equal to true now if I will run it

6:45:35

now see what I will find out uh let me

6:45:38

predict with some name so let me uh

6:45:41

check uh chain. run and here I can write

6:45:44

it down let's say America so here it is

6:45:48

saying that entering new llm chain

6:45:51

prompt after formatting I want to open a

6:45:54

restaurant for American food suggested a

6:45:56

fancy name for this and here is a name

6:45:58

American spice Visto so you can see the

6:46:01

complete detail over here what is

6:46:03

happening by using the barbos true until

6:46:06

here everything is fine everything is

6:46:08

clear now guys here uh this is the

6:46:11

simple chain basically which I have

6:46:13

created by using this two component now

6:46:15

let me explain you One More Concept over

6:46:17

here so here actually I have written one

6:46:19

definition or I have written one text uh

6:46:22

just let me explain you the this

6:46:23

particular part and then uh again I will

6:46:25

try to revise you so here I'm going to

6:46:28

mark down it and here guys see what I'm

6:46:31

saying if you want to combine multiple

6:46:33

change and set a sequence for that we

6:46:36

use Simple sequential chain simple as

6:46:40

simple as that right so if you want to

6:46:42

combine a multiple chain if you want to

6:46:44

combine a multiple chain and set a

6:46:46

sequence for that we use a simple

6:46:49

sequential chain so let's try to use the

6:46:51

simple sequential chain and let's

6:46:54

understand what is it so for that

6:46:55

basically I have designed one prompt

6:46:58

okay just just understand over here so

6:47:00

step by step we'll try to understand see

6:47:02

Ive already written a code in my doc I'm

6:47:04

just copy and pasting so that I can save

6:47:06

my time that's it everything is same see

6:47:08

I can write it now the code in front of

6:47:09

you also but it will take some time for

6:47:12

writing this particular uh statement on

6:47:14

all it's the same thing okay wherever I

6:47:16

have to write from scratch I will do

6:47:17

that now over here see uh let's try to

6:47:22

understand step by step

6:47:37

now over here this is what this is my uh

6:47:41

second prompt so in the first prompt see

6:47:44

in the first prompt The Prompt template

6:47:46

which I have defined what I'm saying

6:47:47

over here I'm saying uh I want start a

6:47:51

startup right I want want a start a

6:47:54

startup and suggest me a good name so

6:47:57

here is my prompt now here you can see

6:47:59

this is my input variable that is what

6:48:00

that is a startup name yeah it's fine

6:48:03

it's clear to all of you now here I've

6:48:05

created a chain by using this a model

6:48:07

this is my model and this is my prompt

6:48:11

template okay this is the first shap now

6:48:14

here I have created one

6:48:16

more prompt now here I'm saying uh

6:48:20

suggest some strategy for the name so

6:48:22

whatever name name whatever name I will

6:48:25

get from here startup name for that what

6:48:29

I want I want some sort of a strategy

6:48:32

let's say I'm going to open or I'm going

6:48:34

to start my atte startup so for that

6:48:36

what I require tell me so I for that

6:48:38

basically I require audience I required

6:48:39

my team I required my Marketing sales

6:48:41

team if I want to open any fintech

6:48:43

startup or if I want to start any

6:48:45

consultancy or whatever right whatever

6:48:47

uh like company which I want to start so

6:48:50

regarding that what I want I want some

6:48:51

sort of a strategy

6:48:54

getting my point here yes or no so now

6:48:57

what I will do I will combine this two

6:48:58

change see here this this is my first

6:49:01

change this this this is what this is my

6:49:02

first chain this one and this is my

6:49:05

second

6:49:06

chain now I will combine this both Thing

6:49:09

by using simple sequential chain I will

6:49:11

making I'm making a

6:49:13

sequence I'm trying to make a sequence

6:49:15

between these two

6:49:17

chain okay before I I was just running

6:49:20

with a single uh like uh with a single

6:49:22

chain only and we we are having only two

6:49:24

component llm and my prompt now here I'm

6:49:27

going to come my true chain now just

6:49:29

tell me guys here I'm using this

6:49:31

particular llm can I use a different llm

6:49:34

over

6:49:35

here I can try with that I can check

6:49:38

right so here I'm using a same model now

6:49:42

I can check with a different LM also in

6:49:44

this particular case so this chain is a

6:49:46

pretty amazing thing it is connecting a

6:49:49

homogeneous component or it is it can uh

6:49:52

we can connect a hetrogeneous component

6:49:54

also means some other model as well you

6:49:57

can test it with the other model uh so

6:50:00

here you can see we are able to do it

6:50:02

now guys here what I will do so here is

6:50:04

my first template this is my first chain

6:50:07

this is my second template this is my

6:50:08

second chain now what I will do over

6:50:10

here so here I'm going to import a

6:50:12

sequence uh so here I'm going to import

6:50:15

a simple sequential chain here I'm going

6:50:17

to import this simple sequential chain

6:50:20

now once I will run it so here I

6:50:21

imported now let me create

6:50:23

a now let me create a object of it so

6:50:27

here guys here is a object now inside

6:50:29

this object inside while I'm creating

6:50:31

object I will pass some sort of a

6:50:33

parameter so it will call my init method

6:50:35

okay in a back end now here I'm going to

6:50:37

pass some sort of a parameter and that's

6:50:39

going to be a very very easy and here is

6:50:41

the parameter name so chains first is

6:50:44

name chain and the second is stategy so

6:50:46

automatically see what will happen

6:50:48

actually first it will call to this one

6:50:51

it will uh generator startup name

6:50:53

automatically it will give uh it it will

6:50:55

give name to this particular uh like a

6:50:58

to this particular template

6:51:00

automatically it will fetch from there

6:51:01

itself and I will be getting this

6:51:04

strategies I will be getting this

6:51:06

particular strategies automatically

6:51:08

chaining automatically chaining is

6:51:10

happening okay this one now let me show

6:51:13

you how so over here uh what I will do

6:51:16

so let me uh create object and here I

6:51:18

just need to call a method so here I'm

6:51:21

going to call uh method that's going to

6:51:25

be a chain. run now here I want to open

6:51:28

a startup let's say the startup related

6:51:30

to the artificial intelligence so here

6:51:32

I'm going to write it down

6:51:33

artificial

6:51:35

intelligence now here once I will call

6:51:38

it so let me run it and let's see what I

6:51:41

will be getting over here so I'm making

6:51:44

a sequence guys between a

6:51:47

prompts so it is saying that uh develop

6:51:50

a strong marketing strategy and and some

6:51:53

sort of a information let's let me print

6:51:56

it uh so that I won't get this

6:51:59

lesson so here is my

6:52:04

strategies stay informed and up toate on

6:52:07

a latest AI train develop a

6:52:10

comprehensive uh AI strategy utilize AI

6:52:13

tools utilize data driver inside so

6:52:16

these are some sort of a strategy

6:52:17

actually see automatically I'm getting

6:52:19

see this name now which which we have

6:52:21

defined see startup name which is coming

6:52:23

over here okay then whatever name is

6:52:25

coming from there automatically is going

6:52:27

over here this inside this name and we

6:52:29

are getting a strategies we are chining

6:52:31

we are chining right now this is a

6:52:34

simple sequential chain now here uh here

6:52:38

we have one drawback actually uh we it

6:52:41

is giving me a final answer it is not

6:52:43

giving me a answer uh it is not giving

6:52:46

me answer related to the first prom it

6:52:48

is not giving me it is not giving me

6:52:50

that particular answer it giving me a

6:52:52

direct uh the last one answer from the

6:52:54

last uh like a prompt itself if you want

6:52:58

answer like from the entire prompt so

6:53:02

for that also we have one method okay uh

6:53:05

sorry we have one more class let me show

6:53:06

you that particular class now so here uh

6:53:09

what we can do so I already written the

6:53:11

name so let me give you that particular

6:53:14

uh name and here is what here is a name

6:53:18

guys so the name is what now let's try

6:53:20

to understand the sequential chain so so

6:53:22

far actually we have understand the

6:53:24

simple sequential chain now we are going

6:53:26

to understand the sequential chain and

6:53:29

it is having a more power compared to

6:53:30

this SE uh simple sequential chain where

6:53:33

we can uh keep uh the sequence sequence

6:53:36

of the different different prompts and

6:53:38

the different different chains now uh

6:53:41

let's try to understand this sequential

6:53:42

chain and here what I'm going to do here

6:53:45

I'm going to copy one more code now let

6:53:47

me paste it over here so again I'm going

6:53:50

to create okay already I have a client

6:53:52

so let me move it it is not required at

6:53:54

all so here is my prompt template and

6:53:57

what I'm saying here I want to open a

6:53:58

restaurant suggest me a fancy name now

6:54:00

just see over here what I'm going to do

6:54:02

I'm going to mention one key over here

6:54:04

that is what there is my output key and

6:54:06

what is my output key output key is

6:54:07

nothing it's a Resturant name right now

6:54:10

now just see over here where I'm going

6:54:11

to use this output key so here I'm going

6:54:13

to Define one more parameter one more

6:54:15

prompt template and here guys you can

6:54:17

see so in this particular prompt

6:54:19

template prompt template name we have a

6:54:21

prompt template and and here input

6:54:23

variable kin and this is a template now

6:54:25

here is my chain llm chain this is my

6:54:27

model this is my prompt template and

6:54:29

here we have a output key output key is

6:54:32

what restaurant name so whatever name

6:54:35

basically whatever name I will get from

6:54:38

here I will keep inside this restaurant

6:54:41

name and this restaurant name I'm

6:54:44

passing over here this restaurant name

6:54:47

I'm passing over here and here whatever

6:54:50

thing I will get from here from this

6:54:53

particular prompt I'm keeping inside the

6:54:55

menu item and if you are going to create

6:54:57

a next

6:54:59

prompt you can mention over there now

6:55:03

let me run it and let me show you what

6:55:04

will be the final answer over here so

6:55:07

here I'm going to import the sequential

6:55:09

chain and here you can see so this is

6:55:11

what this is my sequential chain and now

6:55:13

let me copy it and let me paste the

6:55:16

final code and here is my uh object of

6:55:20

the sequential chain so let let me keep

6:55:23

it in a single line so here sequential

6:55:25

chain this is the object which I have

6:55:27

created now change what I want to chain

6:55:29

means like in terms of what I want to

6:55:31

make a chain so this is the first name

6:55:33

name chain this is the one now second

6:55:35

chain is what food item chain means I

6:55:37

want a food item regarding that

6:55:40

particular restaurant now over here this

6:55:42

is my input variable and here is my

6:55:44

output variable restaurant name and menu

6:55:46

items this

6:55:48

one Whatever output I'm getting from

6:55:50

here I'm keeping over here inside this

6:55:52

variable whatever output I'm getting

6:55:54

from here I'm keeping over here inside

6:55:55

this variable and I'm going to mention

6:55:58

inside the output variable if you want

6:55:59

to make a further chain you can do it

6:56:02

according to your problem statement now

6:56:04

let me run it and let me show you the

6:56:06

final answer and the final response so

6:56:09

here I am going to call this method

6:56:13

chain okay so this is about this is my

6:56:15

chain and here let me run it and see

6:56:18

what I will be getting so chain and I'm

6:56:22

I'm passing cuisin Indian so it is

6:56:24

giving me cuin is what cuin is Indian

6:56:26

and here is a restaurant name there's

6:56:28

going to be a Taj Mahal Palace Taj

6:56:31

Maharaja Palace and here is a menu item

6:56:34

now so guys this is the response which

6:56:36

I'm getting over here can you see over

6:56:39

here the response which I'm getting all

6:56:41

the thing all the thing in a sequence

6:56:43

now let me revise this particular thing

6:56:46

revise me this particular concept so

6:56:48

chain what is a chain which is going to

6:56:50

connect two components so here what I

6:56:52

did see here I have connected two

6:56:54

component first is model second is

6:56:57

prompt now in example two you can see

6:56:59

what I'm going to do so same thing I'm

6:57:00

going to perform now in the third one uh

6:57:02

with the entire detail actually with our

6:57:04

entire detail now in the third one I'm

6:57:06

calling simple sequential chain in that

6:57:09

I'm getting a output from the last

6:57:12

prompt but if we are talking about a

6:57:14

sequential

6:57:15

chain instead of the simple sequential

6:57:17

chain I'm using sequential chain so I'm

6:57:20

getting a entire output over here means

6:57:23

from first template uh from first prompt

6:57:25

template to last prompt template and

6:57:28

here you can see we are mentioning this

6:57:29

output key so whatever answers I'm

6:57:32

getting over here whatever answers I'm

6:57:34

getting from this particular uh prompt

6:57:37

right we are able to store it over here

6:57:39

and we are passing to the we are passing

6:57:42

to the next prom we are passing to the

6:57:44

next uh like a prompt basically over

6:57:47

here you can see this one same

6:57:48

restaurant name and we are going to

6:57:51

combine it finally

6:57:52

so guys tell me do you like it did you

6:57:55

understand

6:57:57

it I will come to that the purpose and

6:58:00

all everything will be clarified right

6:58:02

so uh we will talk about because

6:58:04

everything should be connected now to

6:58:05

each see whenever uh like if you are

6:58:08

going to ask to anything uh to your chat

6:58:11

GP what do you think tell me so how this

6:58:14

application is working we are are we are

6:58:17

like uh what we are going to do guys so

6:58:20

we are reaching step by step actually we

6:58:22

are trying to reaching to our final

6:58:24

application understand guys so here if

6:58:26

someone has created this chat GPT it

6:58:29

they have implemented everything

6:58:31

whatever we are going to run by using

6:58:33

this Len chain here you will find out

6:58:35

the memory concept okay let me ask one

6:58:37

question to my CH gbt so here here I'm

6:58:40

asking can you tell

6:58:42

me can you tell me about something Taj

6:58:47

okay so here uh I'm asking this question

6:58:49

to my chat jpd now here you can see

6:58:52

uh uh like uh here is the answer now I'm

6:58:56

asking to my chat GPT 2 + 2 how much so

6:59:01

it is saying to me let me run it so here

6:59:03

it is saying to me 2 + 2 is nothing it's

6:59:05

a five okay sorry uh it's a four right

6:59:09

now here if I will ask to my chat GPT

6:59:11

how much 100 uh

6:59:14

multiply by 1,000 now if I will run it

6:59:17

so here you will get the answer now here

6:59:20

if I will ask to my CH GPT

6:59:24

who

6:59:26

uh build the Taj Mahal can you who built

6:59:32

the Taj Mahal so here if I'm going to

6:59:35

ask this particular question so here you

6:59:37

can see the Taj m b by the mul Emperor

6:59:40

so actually it is not going to forget

6:59:42

the context whatever you are asking now

6:59:44

previously it is able to sustain the

6:59:47

that particular memory it's a biggest

6:59:50

power of the CH GPT so we are trying to

6:59:53

reach uh like step by step we are going

6:59:55

to we are trying to understand all sort

6:59:57

of a thing by using this Len CH and then

6:59:59

finally we will move to the uh the end

7:00:02

uh like a goal the our end application

7:00:04

now over here this chain actually is

7:00:05

very important if you want to uh like a

7:00:08

retain the information from the first

7:00:09

prompt to the last prompt for that you

7:00:11

can use this uh you can use this uh

7:00:14

sequence chain I can understand you are

7:00:16

uh trying to understand that where we

7:00:18

are using in a real time in a

7:00:19

application and all I will come to that

7:00:21

part okay but just understand over here

7:00:24

so I was running the Sur API so here

7:00:27

actually once you will read the entire

7:00:29

detail of the Sur API of this agent so

7:00:31

you will find out that in like uh uh

7:00:34

internally it is using the chaining it

7:00:36

is trying to chain each and every thing

7:00:39

back in a back end basically they have

7:00:40

implement the chaining complete chaining

7:00:42

so just just try to read it and finally

7:00:44

it is giving me a the the like

7:00:46

conclusion over here so in a similar way

7:00:49

here I just shown you the example a very

7:00:51

basic example but by yourself what you

7:00:54

can do guys so by yourself uh like you

7:00:57

can uh like create a different different

7:00:58

prompts and you can implement this

7:01:00

chaining concept over there and you can

7:01:03

understand in a better way you can

7:01:05

search about the applications and

7:01:08

all getting my point yes or

7:01:14

no tell me guys this thing is getting

7:01:16

clear to all of you if it is getting

7:01:18

clear then please do let me know in the

7:01:21

chat

7:01:38

so are you able to get it uh please do

7:01:41

let me know in the chat guys if uh this

7:01:44

thing is fine to all of

7:01:50

you

7:02:05

I'm waiting for a reply guys if you can

7:02:07

write it down the chat and if you're

7:02:08

liking the session so please hit the

7:02:10

like as

7:02:20

well great now let's try to understand

7:02:23

uh One More Concept and then I will uh

7:02:25

stop the session uh today I couldn't

7:02:28

reach to the hugging phase but don't

7:02:30

worry tomorrow I will show you that and

7:02:33

memory also so One More Concept is there

7:02:36

memory now let me show you the basic

7:02:37

concept now the uh the very basic

7:02:40

concept of the Leng chain which we are

7:02:42

going to use in a future that is going

7:02:43

to be a document loader so let me

7:02:45

explain this document loader also so

7:02:48

here uh what I'm going to do I'm going

7:02:50

to uh show you that how you can read any

7:02:53

sort of a document by using this uh by

7:02:56

using this length chain now once you

7:02:58

will search uh let me search over the

7:03:01

Google

7:03:03

Document

7:03:06

loader document loader Lang chain

7:03:10

documentation so simply I'm searching

7:03:12

about this uh document loader on top of

7:03:14

the documentation so here uh let me open

7:03:19

this document loader so once you will

7:03:21

come inside this module now and here is

7:03:23

a uh here is a like option retrieval now

7:03:27

inside that you will find out a document

7:03:28

loader so CSV file directory HTML Json

7:03:31

markdown PDF or different different

7:03:33

document you can load and it is required

7:03:37

it is required I will show you where it

7:03:38

is required and once I will reach to the

7:03:40

Practical implementation once I will

7:03:42

create any sort of a project okay so

7:03:44

there I will show you how you can read a

7:03:46

different different files and how you

7:03:47

can utilize let's say uh you have one

7:03:50

information so some information inside

7:03:52

the uh txt file or maybe in the format

7:03:55

of HTML or Json or maybe CSV now you

7:03:58

want to read it from there and you want

7:04:00

to give it to you uh you want to give uh

7:04:02

that particular information to your uh

7:04:05

chat GPT or maybe GPD model so in that

7:04:07

case you will have to use this document

7:04:09

loader so let me show you how you can

7:04:11

use this uh PDF loader so here is what

7:04:14

here is a PDF loader so for that first

7:04:16

the first thing what you need to do you

7:04:18

need to install this P PDF so just open

7:04:21

your notebook and here write it down

7:04:23

this pip install pip install P PDF so

7:04:28

once you will write it down this pip

7:04:30

install P PDF you will be able to

7:04:32

install this Pi PDF inside your virtual

7:04:35

current virtual environment now after

7:04:36

that you need to lo you need to write it

7:04:38

down this particular command uh you need

7:04:40

to write it down this particular import

7:04:41

statement from lench do document loader

7:04:44

import Pi PDF loader right from the

7:04:47

documentary itself I'm going to take it

7:04:50

I I'm I'm I'm not going to write down by

7:04:52

myself here I'm showing you the power of

7:04:54

the documentation so once you will

7:04:56

explore it you will get a many more

7:04:58

thing from here itself right whatever

7:05:01

like you want so here I'm going to uh

7:05:04

what I'm going to do guys so here I'm

7:05:05

going to mention this import statement

7:05:08

now we have one uh ex uh now here

7:05:12

actually we have to call this particular

7:05:14

method sorry we have to create a object

7:05:16

of this particular uh class and here let

7:05:18

me paste it down so this is the pi PDF

7:05:21

Lo now I have to pass my PDF I have to

7:05:24

give the uh I have to like write it down

7:05:27

the my path whatever is there uh in my

7:05:29

local system so inside my download let

7:05:32

me check any PDF is there or not so let

7:05:35

me check with the

7:05:39

PDF LM here is a PDF machine translation

7:05:44

attention so let me copy the path uh let

7:05:47

me paste it down over there let's see it

7:05:49

is able to read it or not

7:05:52

so where is a path guys here is a

7:05:58

path let me copy the path and I have

7:06:01

copied the absolute path now where it is

7:06:04

here is my code so here I pasted my path

7:06:08

and let's see it is going to load or not

7:06:10

it's showing a uni code error so let me

7:06:12

put the r over here and it is done now

7:06:15

let me check inside the loader that what

7:06:17

I have so here it is created the object

7:06:20

now let me I write it down the loader

7:06:24

over here loader do loader so once I

7:06:27

will write down this thing so here you

7:06:29

will see that uh okay l a d r loader do

7:06:35

loader P object no attribute

7:06:37

loader uh what is this let me check the

7:06:40

documentation here they are calling

7:06:42

loader and split and that will give you

7:06:45

the

7:06:45

pages great so let me call this uh

7:06:50

loader and split

7:06:52

and here I have a Pages now let's see we

7:06:54

have a Pages yes I got the entire detail

7:06:58

so see I able to read the PDF by using

7:07:02

this document reader why I've shown you

7:07:04

this thing because uh it will be

7:07:06

required we use now pandas do read CSV

7:07:11

for uh like collecting any any sort of a

7:07:14

data in the form of data frame right so

7:07:16

if I want to uh take any data if I want

7:07:19

to format any data in the form of data

7:07:20

frame so so we use this pd. read CSV or

7:07:23

we use np. aray similarly if you want to

7:07:25

read any a document by using this L

7:07:28

chain you can do it you can do it guys

7:07:31

so here there is another one and uh you

7:07:34

can take it as assignment you can read

7:07:36

the CSV there is a complete code here is

7:07:38

a uh code for the file directory here is

7:07:40

a like HTML here is a Json markdown is

7:07:44

there there's a different different uh

7:07:45

like a uh different different document

7:07:48

loaders you will find out now guys uh

7:07:50

let's try to revise the thing let's

7:07:52

revise the session what all thing we

7:07:53

have learned in today's class in today's

7:07:55

session and then I will conclude it and

7:07:58

in tomorrow's session I will start from

7:07:59

the memory memory and finally hugging

7:08:02

face sorry actually I went uh into some

7:08:05

depth Okay I uh I try to explain New

7:08:08

Concept in a detail way that's why I

7:08:10

couldn't start with a hugging face API

7:08:12

but don't worry in tomorrow's session I

7:08:14

will show you how you can uh how you can

7:08:17

uh download any open source model how

7:08:20

you can use any open source model model

7:08:21

by using the hugging pH API and then uh

7:08:25

right after that we'll try to create our

7:08:27

application that is going to be a McQ

7:08:29

generator we'll see that how you can

7:08:31

generate McQ by giving any sort of a

7:08:34

text and where this document loader

7:08:36

where this chaining memory each and

7:08:37

everything will come into the picture

7:08:39

and even the prompt also prompt template

7:08:41

right now let's revise the thing what

7:08:44

all thing we have learned so let me

7:08:45

revise it over here so in today's class

7:08:48

uh we have talked about so where is my

7:08:50

pen

7:08:52

yeah so in today's class we have talked

7:08:54

about this agent I have shown you that

7:08:56

how to call a third party API so here we

7:08:59

have seen how to call a Google search

7:09:02

engine Google search engine API Google

7:09:05

search engine API so let's say uh your

7:09:10

chat GPT actually has been trained till

7:09:12

uh September 2021 data so if it is not

7:09:15

able to give the information in a real

7:09:17

time in that case you can use this agent

7:09:20

you can call you can can use the concept

7:09:22

of

7:09:23

chain right you can use the concept of

7:09:26

chain in which scenario so where you

7:09:28

have a multiple prompt which is

7:09:29

connected to each

7:09:31

other not a simple application not a

7:09:33

simple prompt just for the testing I'm

7:09:36

talking in a real

7:09:39

time so I'm talking in a real time uh

7:09:43

just a

7:09:50

wait

7:10:12

uh now it is fine so here I was talking

7:10:14

about this uh Google search engine and

7:10:18

uh yep and then we have talked about the

7:10:20

change prompt template also document

7:10:22

loader now this uh two thing is

7:10:24

remaining so in uh tomorrow's session I

7:10:27

will start from the memory uh in

7:10:29

tomorrow session actually I will try to

7:10:30

explain the memory concept and then I

7:10:31

will come to this hugging phas API got

7:10:34

it guys yes or no so how was the session

7:10:37

uh did you learn something new so please

7:10:39

do let me know guys uh did you learn

7:10:42

something new from here whatever I have

7:10:44

explained and uh how was the session how

7:10:46

was the content uh please do write it

7:10:48

down the

7:10:50

chat

7:10:54

should I add a few more things if you

7:10:56

want then uh please do let me know

7:10:58

please uh write it on the chat I I'm

7:11:01

like waiting for your replies and you

7:11:04

you can comment also so if you are

7:11:06

watching re-watching the video and if

7:11:07

you want something from my side you can

7:11:09

write it on the comment section you can

7:11:11

tell me over the LinkedIn and yeah

7:11:14

that's it so I hope you are liking my

7:11:16

session so please hit the like button if

7:11:19

you liking the content if you're liking

7:11:20

the

7:11:37

session GB 3.5 get updated till yeah ah

7:11:41

recently we have seen that today

7:11:50

itself

7:11:58

so why we are using Len chain and

7:11:59

advantages over other API you will get

7:12:02

to know more about it in tomorrow's

7:12:04

session otherwise just try to revisit

7:12:07

the session in a starting itself I have

7:12:09

talked about the limitations of the

7:12:11

openai and I talked about the advantage

7:12:14

of the open a clearly I have written it

7:12:16

over here so just try to revisit the

7:12:17

session you will get it and here I have

7:12:20

tried to explain you everything what is

7:12:22

a lenen it's a rapper or the open Ai and

7:12:25

uh your app here is a lenen which is a

7:12:28

rapper now you can hit a multiple Thing

7:12:31

by using this Len

7:12:35

chain yes day three not day three

7:12:38

notebook will be available in your

7:12:40

resource section soon it will be

7:12:41

available don't worry uh yeah so this is

7:12:44

it guys from my side I hope uh like uh I

7:12:49

already told you the tomorrow's agenda

7:12:51

uh memory and the uh hugging phas right

7:12:55

so thank you guys thank you bye-bye for

7:12:56

joining the session if you have anything

7:12:58

any doubt or any concern or anything in

7:13:01

your mind so just uh do let me know

7:13:03

please uh write down the uh please write

7:13:06

down your thoughts in a comment section

7:13:08

and you can ping me over my LinkedIn as

7:13:09

well okay so let's start with the

7:13:11

session and today is a today is the day

7:13:14

five day five of this community session

7:13:16

Community session of generative AI so uh

7:13:20

I already uh covered um most of the

7:13:22

thing actually in a in with respect to

7:13:25

this open a and this Lin and uh in total

7:13:28

I took four session uh here you can see

7:13:31

all all these four session uh where I

7:13:34

have started from the introduction of

7:13:36

the generative AI then I came to the

7:13:39

introduction of the open Ai and we we

7:13:41

have understood we have understood the

7:13:43

concept of the open API then I have

7:13:45

discussed about the Len chain and

7:13:47

yesterday also I was talking about the

7:13:49

Len chain in today this class uh I will

7:13:51

be talking about the memory Concept in

7:13:54

the Lang chain which was the remaining

7:13:55

one and after that I will start with the

7:13:59

hugging face API and then uh from next

7:14:02

class onwards we'll try to uh Implement

7:14:05

our first end to end project by using

7:14:07

this linkchain and this open AI so uh

7:14:10

guys here we have uploaded all the

7:14:12

sessions all the lecture you can go

7:14:15

through with this dashboard which is

7:14:16

already there over the Inon platform you

7:14:18

just need to sign up and after the sign

7:14:21

up you need to login over there and you

7:14:23

will get this particular dashboard uh

7:14:25

over the in youron platform so already

7:14:27

we have given you the link uh in the

7:14:29

chat so please try to uh enroll yourself

7:14:33

if you are new in this particular

7:14:34

session uh this enrollment is completely

7:14:37

free you no need to pay anything for

7:14:39

this uh for this en for this particular

7:14:41

session uh so you can down uh you can

7:14:44

enroll inside the course and you can

7:14:46

access all the uh lectures and here you

7:14:49

will find out the resource section

7:14:51

inside that all the resources uh is up

7:14:54

to date whatever thing I have discussed

7:14:56

in the live classes each and everything

7:14:58

you will find out over here so let me

7:15:00

show you yesterday I have discussed

7:15:01

about the lure so this file is already

7:15:04

there you just need to download it and

7:15:06

you can uh run inside your system you

7:15:10

can run inside your system you can run

7:15:11

over the Google collab anywhere you want

7:15:14

so I shown you the setup in in the local

7:15:16

system itself you can go through with my

7:15:18

previous session and there you can

7:15:20

understand how to to do a local setup

7:15:21

how to do a h setup with respect to open

7:15:24

Ai and Linkin how to run a code

7:15:26

regarding this open Ai and Lenin each

7:15:28

and everything I have explained you in

7:15:30

the previous classes so please go

7:15:31

through with my session and uh like uh

7:15:34

try to understand at least till here

7:15:37

till this L and this open I so uh you

7:15:39

can implement the project along with me

7:15:41

whatever thing I'm going to explain from

7:15:43

next class onwards uh because in today's

7:15:45

class I will cover this lure memory and

7:15:47

then I will come to this hugging face

7:15:49

API and from Monday on onwards Monday

7:15:51

onwards Monday to Friday so Monday

7:15:53

onwards I'm going to start with the

7:15:55

project Tuesday also I will take a

7:15:56

project and then I will come to the

7:15:58

vector database and then few more

7:16:00

concept few uh like different different

7:16:02

models uh some open source model and I

7:16:04

will try to explain you this uh ai2 lab

7:16:07

also that uh how you can uh access that

7:16:09

Jurassic model uh which I told you in my

7:16:12

initial uh like introduction so yeah I

7:16:15

think everything is clear everything is

7:16:17

fine to all of you so please do confirm

7:16:19

in the chat if uh everything is fine

7:16:21

everything is clear till here then we'll

7:16:23

start with today's concept so I'm

7:16:25

waiting uh for your reply please write

7:16:28

it on the chat

7:16:35

guys and you can find out the same

7:16:37

session over the Inon YouTube channel as

7:16:39

well so just try to visit the Inon

7:16:41

YouTube channel and go inside the live

7:16:43

section there you will find out this

7:16:45

committee session already uh the

7:16:48

recording is uh already we have upd the

7:16:51

recording in the live uh section itself

7:16:53

and in the description you will find out

7:16:55

the uh you will find out this dashboard

7:16:57

link as

7:16:59

well uh let me show you that just a

7:17:09

second yeah so here is Ion YouTube

7:17:12

channel so just uh uh over the click

7:17:15

over the channel and here go inside this

7:17:18

live section click on this live section

7:17:20

there you will find out all the

7:17:21

recordings so uh this is the very first

7:17:24

recording where I have discussed uh each

7:17:26

and everything regarding the generative

7:17:27

Ai and the second recording is this one

7:17:30

the third one this is the third

7:17:31

recording and here you will find out the

7:17:33

fourth recording now just click uh any

7:17:35

of them so after clicking just try to go

7:17:38

through with the description and here

7:17:40

you will find out the uh dashboard link

7:17:43

and other details so each and everything

7:17:45

you can find out uh over the Inon

7:17:48

YouTube channel as well you you can find

7:17:50

out this uh dashboard link over there

7:17:52

just click on that and enroll yourself

7:17:55

it is completely free now let's start

7:17:57

with today's session so here I will be

7:18:00

talking about the Len chain L memory in

7:18:03

Len chain so how you can uh like uh how

7:18:07

you can use this memory con concept by

7:18:09

using this Len Chen but before starting

7:18:11

with the Practical let me give you some

7:18:13

theoretical explanation so what I'm

7:18:15

doing here I'm going to open my

7:18:17

Blackboard and here I will try to

7:18:18

explain you the concept of the memory

7:18:21

right and a what thing we are going to

7:18:23

discuss that also I will be talking

7:18:25

about here I will be writing in front of

7:18:28

you and then finally we'll Implement uh

7:18:30

those particular thing in a python now

7:18:33

uh in the previous class I was talking

7:18:35

about the Len chain and I given you the

7:18:37

complete detail introduction regarding

7:18:40

the Lenin that what is Lenin why we

7:18:42

should use it what is the advantage on

7:18:45

top of this openi API why we should not

7:18:47

use openi API why we should use lenen

7:18:50

each and everything we have discussed

7:18:53

now in future session uh I will explain

7:18:56

about the Llama index 2 so it is similar

7:18:59

to Lenin and I will come to the Llama

7:19:00

index 2 and it's a framework from the

7:19:02

Facebook site so we'll try to discuss

7:19:04

each and everything related to L related

7:19:07

to this llama index 2 as well and I will

7:19:09

give you the differences between Len

7:19:10

Chen and Lama index 2 but as of now here

7:19:12

I'm going to explain you the Len chain

7:19:14

only and most of the concept I already

7:19:16

discussed so if we talking about the Len

7:19:19

chain so what all thing we have

7:19:21

discussed so far let me tell you that so

7:19:25

in the Len chain first I discussed that

7:19:27

how to uh call the open a API by using

7:19:30

this Len chain you can think that this

7:19:32

Len chain is nothing it's a wrapper on

7:19:34

top of this open a API and not only

7:19:36

openi API we can access a various API by

7:19:40

using this Len shed so here we have

7:19:42

openi API we have seen that how to

7:19:44

access and how to uh how to access or

7:19:47

how to use the open API by using the

7:19:50

there is just a simple import statement

7:19:53

which I which we have to write it down

7:19:55

inside the notebook or inside the code

7:19:58

and we will be able to import it that's

7:20:00

it now apart from that we have seen the

7:20:02

concept of the agent I have explained

7:20:04

you that what is the agent then uh I

7:20:06

have explained you the prompt template

7:20:08

that what is a prompt

7:20:10

template prompt template how you can

7:20:13

create a prompt template and all so we

7:20:15

have seen each and everything regarding

7:20:17

that now we have understood the concept

7:20:19

of the chains that what is chains and

7:20:21

what we can do by using the chains if we

7:20:24

are going to define a chain right so uh

7:20:27

what all thing we need to import what

7:20:29

component is required what is the

7:20:31

meaning of the simple uh sequential

7:20:32

chain what is the meaning of the

7:20:34

sequential chain each and everything I

7:20:36

have discussed regarding the chains

7:20:38

after that I came to the document loader

7:20:41

I have discussed about the document

7:20:42

loader if you want to uh load any sort

7:20:46

of a document document is nothing it's

7:20:48

just a like a files and all right so if

7:20:50

you want to read the PDF PDF file if you

7:20:53

want to read the Excel file CSV file

7:20:55

HTML file or maybe any other file so you

7:20:59

can um you can load that particular file

7:21:02

by using this link chain it is possible

7:21:04

now the fifth one now the sixth one

7:21:06

which we're going to talk about that is

7:21:07

going to be a memory so we'll uh discuss

7:21:10

the concept of the memory first I will

7:21:12

write it on the code and then again I

7:21:14

will come to this memory part and try

7:21:16

will try to explain you but before that

7:21:18

uh I would uh I will explain this memory

7:21:20

memory concept by using the chat GPD

7:21:22

also before writing a code now this is

7:21:24

all about the L CH these all are the

7:21:26

thing basically which we need to discuss

7:21:28

regarding the L chain and that's going

7:21:29

to be a very important if you are going

7:21:31

to implement the project end to end

7:21:33

project now after that what I will

7:21:36

discuss so here let me write down the

7:21:37

topic name which we're going to discuss

7:21:39

after this Lon so I will talk about the

7:21:41

hugging phase hugging phas API how you

7:21:46

can generate a token how you can

7:21:47

generate a hugging phas API token and

7:21:50

after that we'll try to access a open

7:21:53

source model whatever model is there on

7:21:55

top of the hugging phase so we'll try to

7:21:57

access those particular model by using

7:21:59

this hugging phase and we'll try to do a

7:22:01

same thing we'll try to do a same thing

7:22:03

basically which we are doing uh by using

7:22:06

this open API but at this uh now at that

7:22:10

time I'll will be using the open source

7:22:12

model not this U uh like not this GPD

7:22:15

model basically which is a uh which is a

7:22:17

like model of the open a now will try

7:22:20

try to access those open source model

7:22:22

and then we'll try to understand that

7:22:24

how uh we'll try to understand that how

7:22:26

you can create a pipeline by using the

7:22:28

hugging face so we'll try to understand

7:22:30

the concept hugging face pipeline

7:22:32

hugging face pipeline I told you this uh

7:22:35

Lenin is nothing this lenen is a wrapper

7:22:39

okay this lench is a wrapper on top of

7:22:40

this uh open ey this lench is a wrapper

7:22:43

on top of the hugging face so not only

7:22:45

open AI we can interact with hugging

7:22:48

face also uh by using this L chain and

7:22:50

not even with hugging phase we can

7:22:52

interact with many API in future I will

7:22:55

explain you that I will come to that and

7:22:57

if you if you want to know about it so

7:22:59

you can visit the documentation

7:23:01

yesterday I shown you the documentation

7:23:02

of the Len chain and you can see over

7:23:04

there not even open AI not even hugging

7:23:06

pH we can access a multiple API by using

7:23:09

Lang chain so Lang chain is nothing just

7:23:10

a rapper on a different different uh on

7:23:14

top of a different on top of different

7:23:15

different

7:23:16

API got it yes or no I think this thing

7:23:19

is clear to all of you then we'll see

7:23:20

how we can create a hugging face

7:23:22

pipeline which we used to do by using

7:23:23

the hugging pH Transformer now here also

7:23:26

we can import the same thing we can

7:23:27

import the hugging face pipeline by

7:23:29

using the Len chain and we can create

7:23:31

the pipeline and we I will show you so

7:23:33

here uh by using the hugging phas API

7:23:36

you can access the model by using the

7:23:38

hugging face API you can access the

7:23:39

model but you can install this model

7:23:41

inside your local environment also

7:23:44

inside a local environment also inside

7:23:45

your local memory also so I will show

7:23:47

you how you can perform the same thing

7:23:50

by

7:23:51

local llm local LM means what nothing

7:23:54

I'm just going to be uh I'm just going

7:23:56

to be download the model I'm just going

7:23:58

to be download the model from the huging

7:23:59

phase and that model itself I'm going to

7:24:02

use similar to this uh GPT and all which

7:24:06

I which I'm like accessing by using the

7:24:07

open API or by using the Len Chen Len

7:24:10

Chen and openi right so same thing I can

7:24:12

do over here as well uh okay by using

7:24:14

the hugging face API but if you want to

7:24:16

download the model in your local memory

7:24:18

in your local system that that also you

7:24:20

can do that also uh you can do and that

7:24:23

is also possible so I will explain you

7:24:26

that part as well and finally we'll

7:24:27

create a hugging phas Pipeline and from

7:24:30

next class onwards we'll start the

7:24:32

project implementation so uh if uh

7:24:35

everything is fine until here then

7:24:38

please do let me know if the agenda is

7:24:40

clear to all of

7:24:41

you and if you are liking the session

7:24:44

then please hit the like button

7:24:46

guys please hit the like button if you

7:24:48

are liking the session

7:24:54

I just started I I just given you the

7:24:56

overview that what all thing we are

7:24:57

going to discuss that's it I haven't

7:25:00

started with the coding and

7:25:08

all no we don't have a session on

7:25:10

Saturday and Sunday uh we have a session

7:25:12

from Monday to

7:25:18

Friday

7:25:28

great so let's start with the

7:25:30

implementation so first I'm going to

7:25:33

start from the memory that what is a

7:25:35

memory inside the L chain and how we can

7:25:39

use that so see first of all let me uh

7:25:42

explain you the same thing by using the

7:25:44

chat GPD so what I'm going to do here

7:25:47

I'm going to open my chat GPD and let me

7:25:50

write it down something over here so

7:25:52

here I'm going to write it down that uh

7:25:55

can you tell me uh can you can you tell

7:25:59

me who won the first World Cup first

7:26:05

Cricket World Cup so I'm going to ask to

7:26:07

my Chad GPD that can you tell me who won

7:26:10

the first Cricket World Cup so that this

7:26:12

is my question which I'm going to ask to

7:26:14

much chbd now let me hit the enter and

7:26:17

let's see the reply so is saying that

7:26:20

the first Cricket World Cup was held in

7:26:22

1975 and uh the Western de emerged as

7:26:25

the champion they defeated Australia in

7:26:27

the final which took place as a l uh

7:26:30

Lords cricket ground in London on uh

7:26:32

June 21

7:26:34

1975 so Western was the uh winner at

7:26:38

that particular time now let's try to

7:26:39

ask something to my chat gbt so here I'm

7:26:42

asking to my chat GPT can you tell me

7:26:45

can you tell me 2 + 10 so here it is

7:26:50

giving me answer 2 + 10 is 12 now let me

7:26:53

ask something else to my CH gbd can you

7:26:55

tell me

7:26:57

about the Indian GDP so here I'm going

7:27:02

to ask my chat GPD can you tell me about

7:27:04

the Indian GDP so it is uh saying that

7:27:07

uh my knowledge up to date till uh U

7:27:10

till January 2022 so I don't have a most

7:27:13

recent data now it is giving up some

7:27:15

more detail now you can ask the GDP you

7:27:18

can ask like GDP the that what was the

7:27:20

GDP in 2021 in 2022 something like that

7:27:23

or whatsoever now here see what was my

7:27:25

first question so here I asked the first

7:27:27

question can you tell me who won the

7:27:29

first World Cup who won the first

7:27:31

Cricket World Cup now here see after

7:27:34

writing this many of after writing a

7:27:36

different different like a question now

7:27:38

is still my Chad GP is able to remember

7:27:41

this particular sentence this particular

7:27:44

sentence because in back end actually it

7:27:46

is using the memory concept it's able to

7:27:48

remember the it is able to remember the

7:27:50

conversation that whatever conversation

7:27:52

is happening over here so here if I will

7:27:54

ask to my chat GPT can you tell me can

7:27:58

you tell me can you tell me the winning

7:28:03

team captain so here I didn't mention

7:28:06

anything and I'm just asking to my chat

7:28:08

GPT can you tell me the winning team

7:28:10

captain so if I will if I will hit the

7:28:12

enter and here guys you can see the

7:28:14

reply

7:28:16

so it is saying okay captain as of my

7:28:20

knowledge and I don't have information

7:28:21

wining team captain uh can you tell me

7:28:24

the winning

7:28:25

team okay let me ask one more time is

7:28:29

saying that uh can you tell me who won

7:28:31

the first Cricket World Cup and here I'm

7:28:33

asking can you tell me

7:28:37

winning

7:28:40

Captain uh winning

7:28:43

team

7:28:45

captain name so if I'm asking to my gp2

7:28:50

so it is saying that uh it seems like

7:28:53

might be a slight

7:28:55

spelling about the okay cap it's a

7:28:58

captain I am writing a wrong spelling

7:29:00

let me correct the spelling first of all

7:29:02

so here uh the spelling will be a

7:29:04

captain just a second let me copy the

7:29:07

correct uh correct spelling and let me

7:29:09

paste it over here and let's see I'm

7:29:11

getting answer or not so here it is

7:29:14

saying information the

7:29:16

tournament okay so it is saying that uh

7:29:19

uh just a second guys what I can do uh

7:29:22

let me delete this chat or let me open

7:29:24

the new chat and let me show you this

7:29:26

particular thing oh yeah just a wait so

7:29:29

it is able to remember the thing uh let

7:29:32

me start from the new one uh first of

7:29:34

all let me delete it don't know why it

7:29:36

is doing like this just a second let me

7:29:39

delete the chat okay now here is what

7:29:42

here is my new chat now here uh let's

7:29:45

start from the beginning so here I'm

7:29:46

asking to my chat GPT can you tell me

7:29:50

who won the first

7:29:54

Cricket World Cup this is a SE uh like

7:29:57

simple question which I'm going to ask

7:29:59

my chat GPT so here uh you can see it is

7:30:03

giving me answer okay no doubt no issue

7:30:06

now here if I'm going to ask my chat GPD

7:30:08

that what will be uh what will be 2 + 2

7:30:13

2 + 2 right so now let's see what I will

7:30:16

be getting over here so here is saying

7:30:18

that 2 + 2 will be four now let me ask

7:30:21

my chat GPT what will be 2 * 5 now here

7:30:26

it is saying that uh the multiplication

7:30:29

will be 10 now I'm asking to my chat GPT

7:30:32

can you tell me can you tell me about

7:30:36

can you tell me who was the winning who

7:30:41

was the captain d a i in captain of a

7:30:46

captain of the winning team now let's

7:30:50

see uh will it be able to answer or

7:30:56

not it's taking time and let's see what

7:31:00

will be the

7:31:01

answer yes it is able to answer now see

7:31:04

so here I asked to my C GPT who won the

7:31:07

first Cricket World Cup so here is my

7:31:09

like answer now I asked to my CH GPT

7:31:11

what is 2 + 2 and the answer is this one

7:31:15

now I asked to my CH GP 2 into 5 so this

7:31:18

is the answer now again I asked to my

7:31:20

chat GPT without giving any sort of an

7:31:22

information regarding this Cricket World

7:31:23

Cup and all and you can see the answer

7:31:26

it is saying that Clive Lord was a

7:31:28

captain uh clyve Lord was a captain of

7:31:30

the West Indies cricket team that was

7:31:32

was the Cricket World Cup in 1975 so

7:31:36

here guys in a back end this chat GPT is

7:31:39

implementing this memory concept now if

7:31:41

you are accessing if you are accessing

7:31:43

your uh if you are accessing llm uh this

7:31:45

GPD and all by using the open AI or

7:31:48

maybe by using the huging phase so how

7:31:50

you can retain the memory because chat

7:31:53

GPT chat GPT is application in backend

7:31:56

uh this GPD model is running getting my

7:31:58

point now if you want to implement a

7:32:00

same thing let's say if you are

7:32:02

accessing the model llm model by using

7:32:04

the open API or maybe by using the Len

7:32:07

Chen basically Len Chen is hitting the

7:32:08

open API only so how you can retain this

7:32:11

particular memory how you can do that so

7:32:13

now let's try to understand that

7:32:15

particular part that particular concept

7:32:17

so if I'm using uh the open API that how

7:32:20

I will be able to retain the memory and

7:32:23

Len chain gives you this particular

7:32:24

facility so by using the memory concept

7:32:27

you can retain the memory like chat GPT

7:32:30

so the problem statement is clear to all

7:32:32

of you please do let me know in the chat

7:32:34

if uh the problem statement is

7:32:38

clear I'm waiting for your reply guys

7:32:40

please do let me

7:32:48

know

7:32:49

what's the purpose of the Len chain so

7:32:51

in the previous class I have clearly

7:32:53

defined the purpose of the Len chain if

7:32:55

you don't know about it so you must

7:32:57

visit the previous class where I have um

7:32:59

I did the detailed discussion about the

7:33:01

Len

7:33:10

chain great so everything is fine

7:33:12

everything is clear now let's uh begin

7:33:15

with the implementation so first of all

7:33:17

guys what I need to do so first of all I

7:33:20

need to import a different different uh

7:33:23

first of all let me import the different

7:33:25

different uh like a uh import a

7:33:28

statement okay so here is my open Ai and

7:33:32

okay it is fine now let me do one thing

7:33:34

over here let me

7:33:37

[Music]

7:33:42

import the same file I already given to

7:33:45

you you can check in a resource section

7:33:47

from there you can download it's a same

7:33:49

file which I'm using over

7:33:51

here so it is for the asent type

7:33:56

uh okay everything is fine now let me

7:33:59

take a prompt template from

7:34:01

here great so here what I'm going to do

7:34:04

here I'm going to write it down the

7:34:07

memory so just a

7:34:09

second yeah so first of all let me write

7:34:12

it on the memory over here

7:34:18

and

7:34:21

memory now let's begin let's start so

7:34:24

here I'm going to import The Prompt

7:34:26

template the first thing which I'm going

7:34:28

to do over here so first of all I will

7:34:31

have to uh create my a client right so

7:34:34

for creating a client actually uh let me

7:34:37

write another the code so here actually

7:34:39

let me import one more thing I'm going

7:34:41

to import llm Chen actually I restarted

7:34:44

my kernel that's why I need to import it

7:34:45

again and here uh let me do one thing so

7:34:49

LM chain I already imported let me

7:34:51

create a client first of all so for

7:34:53

creating a client what I can

7:34:56

do already written a code inside my

7:35:01

file yeah so this is the code for

7:35:03

creating a client so here uh what I'm

7:35:06

going to do guys see here I'm going to

7:35:08

create a

7:35:10

client so this is what this is my client

7:35:13

now open AI key is not defined okay

7:35:16

first of all I will have to import the

7:35:17

open a so from length chain Len

7:35:20

chain do open and here I'm going to

7:35:25

import this open AI now let's run it

7:35:30

again and it is saying open AI is not

7:35:34

there so let me change the spelling of

7:35:36

the

7:35:37

openi I think it is

7:35:40

capital no it is not like that so let me

7:35:43

check with the correct import statement

7:35:45

what is

7:35:47

that

7:35:53

yeah this is

7:35:56

the okay I'm using the length chain just

7:35:58

a wait so by using the Len

7:36:04

chain okay from llm actually we have to

7:36:06

import this open a uh it's my bad so now

7:36:11

it is done yeah it is fine I created a

7:36:14

CLI yep now everything is set so here I

7:36:17

have imported three state M first is

7:36:19

prom template second is llm chain and

7:36:22

third is open AI I restarted my kernel

7:36:24

that's why I uh got a a requirement to

7:36:27

reimport it uh this particular statement

7:36:30

now here I created a client now let's

7:36:32

try to understand the concept of the

7:36:34

memory so first of all guys what I will

7:36:36

have to do I will have to create a

7:36:37

prompt template and I will have to hit

7:36:39

my model right so for that uh what I did

7:36:43

I already written a code so let me uh

7:36:45

keep the prompt template over here so

7:36:48

this is what guys this is my prompt

7:36:49

template I told you that what is the

7:36:51

meaning of the prompt template and how

7:36:53

to create a prompt template each and

7:36:55

everything I have discussed in my

7:36:56

previous classes if you don't know about

7:36:58

it so please go and check with my

7:37:00

previous s so this is what guys tell me

7:37:02

this is my prompt template now here I'm

7:37:04

uh not going to hit my model U like

7:37:08

directly uh instead of that I'm going to

7:37:11

use llm chain I clearly told you in my

7:37:14

previous class that what is llm chain

7:37:16

llm CH LM chain is nothing l l m chain

7:37:19

uh is a like concept where we are going

7:37:21

to connect two components right so what

7:37:24

is the meaning of the chain so inside

7:37:26

chain you will find out that we are

7:37:28

going to connect a multiple component so

7:37:30

here we have llm chain where we are

7:37:33

going to connect a multiple component my

7:37:35

first component is a client uh which is

7:37:37

my object of the open a which I have

7:37:40

created and the second uh the second

7:37:42

component is prompt template let's try

7:37:44

to use llm chain over here and let's see

7:37:47

what I will be getting so for that first

7:37:49

of all I'm going to create a object of

7:37:51

this llm chain now let me create a

7:37:53

object of this llm chain and I can keep

7:37:56

it over here I can keep this particular

7:37:58

object inside this chain variable now

7:38:00

let me pass my llm llm is nothing it's a

7:38:03

client itself because by using this

7:38:06

client only uh we are getting a model we

7:38:09

are getting a model from the open Ai and

7:38:11

by default I think we are using text D

7:38:13

Vinci uh and if you are going to mention

7:38:16

the model parameter you can use your

7:38:18

desired model as well so that is also

7:38:20

possible now over here I'm going to

7:38:21

write down this client and then what I

7:38:23

will do guys so here I will mention my

7:38:25

prom template so let me mention my

7:38:28

prompt template let me write down the

7:38:30

parameter prompt p r o m PT and here let

7:38:34

me copy this name prompt template name

7:38:36

and here I have this prompt template

7:38:39

name so once I will run it so here you

7:38:42

can see we are able to create a chain so

7:38:44

this is what this is my chain now what I

7:38:46

will do I will run uh uh I will I will

7:38:49

like uh I will call the run method and

7:38:53

here I will mention the name so I'm I'm

7:38:56

asking over here what is a good name for

7:38:58

the company that makes so I can uh so

7:39:00

this product actually uh I can I can

7:39:02

give any sort of a product name over

7:39:04

here so let's say here if I'm saying uh

7:39:07

if I'm uh asking to my uh like model so

7:39:11

colorful

7:39:13

colorful colorful uh cup so here I'm

7:39:16

asking to my model colorful cup so if I

7:39:19

will uh run it so here you can see so it

7:39:22

is giving me answer so for if I want to

7:39:24

like uh check that what is the answer

7:39:26

which I'm getting over here so I can

7:39:28

give it to my print statement and let's

7:39:30

see what will be the final answer so

7:39:32

here it is saying holder color cup

7:39:34

Corporation something like that it is

7:39:36

giving me a name so let me call the

7:39:39

strip over here strip will remove

7:39:40

unnecessary thing from here so it is

7:39:43

saying cakes uh Sugarland sprinkle so

7:39:47

this is the name basically which I'm

7:39:49

getting uh if I'm asking this particular

7:39:51

question to my to my model right to my

7:39:55

llm model to my uh GPT model now uh till

7:39:59

here I think everything is fine already

7:40:01

we did uh uh like uh we did it so many

7:40:04

times in our previous classes in our

7:40:06

previous session now let's try to

7:40:08

understand few more thing over here

7:40:09

let's try to understand the memory

7:40:11

concept that how the memory how this

7:40:13

memory is working in terms of this uh

7:40:15

Len chain okay and how we can uh sustain

7:40:18

the memory basically the uh conversation

7:40:20

whatever conversation we are going to do

7:40:22

now here see guys uh I'm going to write

7:40:24

it down uh one more time so let me

7:40:27

create one more prompt over here so

7:40:29

let's say uh there the same prompt uh

7:40:31

same prompt template I have used now

7:40:33

here what I'm going to do um here I'm

7:40:35

going to ask to my uh here I'm going to

7:40:38

ask uh again one thing so let me do one

7:40:41

thing let me again create this chain

7:40:43

over here and I'm going to copy and

7:40:45

paste the same thing and let me run it

7:40:47

so chain do run I'm going to call this

7:40:49

chain. run and instead of this colorful

7:40:52

cup I'm giving a different name so here

7:40:55

I'm giving name let's say drone so

7:40:57

drones I I want to ask a I want to ask a

7:41:00

company name so which make a drones so

7:41:03

here the product name is what the

7:41:04

product name is drones I'm passing the

7:41:06

product name inside this method inside

7:41:09

this run method so chain. run and here

7:41:11

I'm passing this drone let's see what

7:41:12

will be the name so here it is giving me

7:41:14

a name drone X technology so uh it is

7:41:17

giving me a name that that uh don't ask

7:41:20

technology okay so here I can call this

7:41:22

a strip so it will remove the

7:41:24

unnecessary thing uh from the a

7:41:27

beginning so skyron technology so this

7:41:30

is the name basically which is giving to

7:41:31

me and I hope till here everything is

7:41:34

fine everything is clear already we have

7:41:36

learned these many things right now let

7:41:38

me uh explain you the uh like memory

7:41:41

concept so here uh if I'm going to call

7:41:44

one parameter so let me write it down

7:41:46

this chain do memory

7:41:49

so here if I'm going to call this

7:41:50

parameter chain. memory so here I'm not

7:41:53

getting anything here I'm not getting

7:41:55

anything so let's try to see the type of

7:41:57

this chain do memory that what is the

7:41:59

type of this chain do memory so chain do

7:42:03

memory now let me show you the type of

7:42:06

this chain do memory so here you can see

7:42:08

it is giving me a non type means it is

7:42:10

not going to return anything to me

7:42:12

because here we are not going to sustain

7:42:14

any sort of a memory whatever

7:42:16

conversation we are doing to my model

7:42:18

what whatever conversation is happening

7:42:20

right so we are not going to sustain

7:42:22

anything over here we are not going to

7:42:25

sustain anything over here in terms of

7:42:27

the conversation now let's try to

7:42:29

understand how we can do it how we'll be

7:42:31

able to sustain the conversation

7:42:33

whatever conversation we are making uh

7:42:36

like by using the API and whatever

7:42:38

conversation we are making with respect

7:42:41

to that particular model so here for

7:42:43

that we just need to write it down one

7:42:46

parameter so uh first of all let me

7:42:48

write down the heading over here so the

7:42:50

heading uh let me write down the heading

7:42:52

The Heading is nothing heading is

7:42:54

convers conversion buffer memory so here

7:42:57

uh we want to save a memory we want to

7:43:01

save a like conversation memory so here

7:43:04

I return this conversation buffer memory

7:43:06

we have three to four topic inside this

7:43:08

memory so step by step I will try to

7:43:10

explain you each and everything now

7:43:12

first let's try to understand what is

7:43:14

this conversation buffer memory so uh

7:43:16

you can just think about uh this

7:43:18

conversation perform memory uh just like

7:43:20

a memory whatever conversation we are

7:43:22

going to do with respect to our model

7:43:24

right so is going to store all those

7:43:26

thing right it it is going to sustain

7:43:28

all those thing it's going to sustain

7:43:30

the entire memory throughout the

7:43:32

conversation that's it now here what I'm

7:43:34

going to do so here let me uh copy and

7:43:38

paste one more statement and let's see

7:43:41

uh what I have written over here so here

7:43:42

why we have I have written that uh we

7:43:45

can attach memory we can attach memory

7:43:47

to remember on the previous conversation

7:43:49

I just need to uh mention one parameter

7:43:52

the parameter name is what the parameter

7:43:54

name is a memory so I just need to

7:43:56

attach one parameter and we'll be able

7:43:58

to remember all the previous

7:44:00

conversation regarding this model now

7:44:02

how I can do it so here uh let me first

7:44:05

of all let me import this conversation

7:44:07

buffer memory from the lenon itself and

7:44:10

the uh and then I will show you the same

7:44:12

thing by uh from the documentation also

7:44:15

so each and everything I uh pick up from

7:44:17

the doc documentation itself and again I

7:44:19

will go through with the document again

7:44:22

I will go through the documentation and

7:44:24

I will show you the same thing over

7:44:25

there as well so just wait for few

7:44:27

minutes and each and everything uh each

7:44:29

and every part will be clear to all of

7:44:31

you now here uh you can see I'm going to

7:44:34

import this conversation buffer memory

7:44:36

now what I need to do here so this is

7:44:38

the class so I need to create a object

7:44:41

of this class so here I'm going to

7:44:42

create a object of this class and I'm

7:44:44

going to keep uh this object inside the

7:44:47

variable so I've created a variable by

7:44:49

name Memory so this is what this is my

7:44:52

uh like variable where I'm going to keep

7:44:54

a object of this conversation buffer

7:44:55

memory now let me run it so here is what

7:44:58

here is my memory now I just need to

7:45:01

mention this particular parameter inside

7:45:02

my chain that's it and my work will be

7:45:05

done let me show you how so here what

7:45:07

I'm going to do again I'm going to

7:45:09

create a prom template so here is what

7:45:11

here is my prom template as you can see

7:45:14

this is what this is my prom template

7:45:16

now here what I'm going to do here I'm

7:45:18

I'm going to create uh here I'm going to

7:45:19

write it down llm chain so let me write

7:45:22

it down this llm chain and the first

7:45:24

parameter which I need to mention over

7:45:26

here that's going to be a llm and my llm

7:45:29

is nothing it's a client itself so in

7:45:31

the client variable I'm going to keep my

7:45:33

llm so here you can write it down this

7:45:35

CLI c l i n t and here you need to

7:45:38

mention the prompt so here is what here

7:45:40

is my prompt and to this particular

7:45:42

parameter to this prompt parameter you

7:45:43

just need to pass uh this particular

7:45:45

value this prompt template name so once

7:45:48

you will pass this prom template name

7:45:50

and you will what you can do you can

7:45:51

create a object of this Ln chain and

7:45:54

then you can call chain do run getting

7:45:57

my point chain is nothing it's a

7:45:59

collection of

7:46:01

component getting my point yes or no in

7:46:04

a uh like uh in a sequence in a

7:46:06

particular chronology so here you can

7:46:09

see we have llm client prom template now

7:46:12

if I want to retain all the conversation

7:46:14

if I want to retain all the memory which

7:46:17

I'm able to retain in a chat GPT here

7:46:19

you can see so if I'm asking to my chat

7:46:21

GPT can you tell me who won the first

7:46:23

Cricket World Cup so it is answer like

7:46:25

it is generating answer now if I'm

7:46:27

asking to my chat GPD what will be 2 + 2

7:46:30

so here what will be 2 into 5 now again

7:46:33

I'm asking to my chat GPD that can you

7:46:35

tell me who was the camp of the winning

7:46:37

team I'm not giving any such information

7:46:40

in inside my prompt as you can see but

7:46:41

is still it is able to give me an answer

7:46:44

based on a previous conversation so if I

7:46:46

want to do a same thing with my API how

7:46:49

we can do it so that's a thing which I'm

7:46:51

explaining you now let me mention one

7:46:54

parameter over here that's going to be a

7:46:55

memory so m m o r by and here let me

7:46:59

mention me m o r by so once I will run

7:47:02

it so first of all let me uh uh keep all

7:47:05

the thing in a variable variable name is

7:47:07

going to be a chain so here Ive created

7:47:09

a object of this llm chain now here if I

7:47:12

will run so let me run something over

7:47:14

here chain do run so here I'm going to

7:47:17

ask that uh I'm going to ask regarding

7:47:19

the product so what be the good name for

7:47:21

the company that makes a product let's

7:47:23

say I'm asking about the wines so if I

7:47:26

will run it so it is giving me a name so

7:47:28

it is giving me a name it is generating

7:47:29

a name over here now again what I'm

7:47:32

going to do so again uh I'm going to ask

7:47:34

to my uh again I'm going to ask to my

7:47:37

model so here I'm asking to my model so

7:47:40

what would be the good name for the

7:47:42

company that makes let's say here I'm

7:47:43

saying camera so here I'm asking a c

7:47:47

like regarding a camera I just want a

7:47:48

name so it is saying that camera Lum

7:47:50

technology so it is giving me a name it

7:47:52

is suggesting me a name now uh here is

7:47:55

what here is my name now uh let me ask

7:47:58

to something else over here let's say uh

7:48:00

I want a company I want to create a

7:48:02

company so the company related to a

7:48:04

drone so I want a company name which

7:48:07

create a drones so here if I'm saying

7:48:09

that drones now here you can see is

7:48:11

giving me answer drone craft so here I

7:48:14

asked three question to my to my model

7:48:17

by by hitting the API I asked three

7:48:19

question to my model to my LF model now

7:48:22

uh let's see it is able to sustain the

7:48:24

memory or not so now if I will run this

7:48:26

chain. memory now you will be able to

7:48:29

find out yes it is able to retain all

7:48:31

the conversation whatever conversation

7:48:33

is happening because because of what

7:48:35

because of this conversation buffer

7:48:37

memory so whatever conversation we are

7:48:39

doing right whatever previous

7:48:41

conversation is there so each and every

7:48:43

conversation we are able to sustain but

7:48:45

previously we were not able to do it so

7:48:47

here it was was giving me none type here

7:48:49

it was not giving me anything but now

7:48:51

you can see we are able to sustain the

7:48:53

information and if I'm calling chain.

7:48:56

memory it is giving me the entire detail

7:48:58

over here now let's try to understand

7:49:00

let's let's try to like uh uh let's try

7:49:03

to understand a few more thing over here

7:49:04

now here if I will run this chain do

7:49:07

memory chain. memory and here if I will

7:49:11

call this chain do memory. buffer so now

7:49:14

you will find out that this is the

7:49:16

entire conversation now let me uh print

7:49:19

uh let me keep this thing uh in my print

7:49:21

method so I won't get this selection

7:49:23

over here instead of that I will get the

7:49:25

new line because slash and me is what SL

7:49:27

and me is nothing it's a new line now

7:49:29

over here you will find out the entire

7:49:31

conversation that whatever conversation

7:49:32

is happening between me and model so

7:49:35

here human is asking about wines so e is

7:49:37

giving me answer now human is asking

7:49:39

about the camera is giving me answer

7:49:41

human is asking about the drones it is

7:49:42

giving me answ so like this you can draw

7:49:45

uh you can create your prompt template

7:49:47

and you can ask to anything to your

7:49:49

model and you can sustain the entire

7:49:51

memory you can sustain or you can uh

7:49:53

keep the en entire conversation with you

7:49:56

getting my point guys yes or no are you

7:49:58

able to understand it is getting clear

7:50:00

so please do let me know if you are able

7:50:02

to understand this particular concept

7:50:04

I'm waiting for your reply in the chat

7:50:07

please do let me know guys please write

7:50:08

down the chat if you are getting it and

7:50:10

please hit the like button so yeah I

7:50:13

will get some sort of a

7:50:16

motivation I are you able to understand

7:50:18

the concept of the memory how to retain

7:50:20

see here actually we are going to uh

7:50:22

like retain the conversation and uh I

7:50:25

will explain you the further use so uh I

7:50:28

will I will explain you a few more

7:50:30

concept over here just just wait step by

7:50:32

step we'll try to understand each and

7:50:34

everything so don't be in a hurry and

7:50:37

try to understand the entire thing if

7:50:39

you have started something then

7:50:40

definitely I will end it okay so here

7:50:44

people are saying that it is clear and

7:50:46

you are able to they are able to

7:50:48

understand the concept of the memory

7:50:50

that how to sustain the conversation

7:50:52

whatever conversation we are doing all

7:50:55

the previous conversation now let's try

7:50:58

to understand few more thing over here

7:51:01

so uh yes we are able to uh maintain the

7:51:04

previous conversation by using this

7:51:06

conversation buffer memory we just

7:51:09

created a object and we are just going

7:51:11

to keep it over here in our chain that's

7:51:14

it now guys here let me show you one

7:51:16

more thing so here here what I'm going

7:51:18

to do so here uh I'm going to introduce

7:51:20

you with the New Concept that's going to

7:51:22

be a conversation chain now let's try to

7:51:24

understand what is this conversation

7:51:26

chain each and everything we'll try to

7:51:28

understand by using this conversation

7:51:29

chain so here uh I'm saying that here

7:51:33

I'm going to uh like write it down some

7:51:36

sort of a statement and the statement is

7:51:38

something like this so here uh let me

7:51:40

mark down it and let me show you so

7:51:42

conversation buffer memory goes growing

7:51:45

endlessly means uh whatever conversation

7:51:47

you are doing uh so you will be able to

7:51:49

sustain all the conversation by using

7:51:52

conversation buffer memory No Doubt with

7:51:55

that but just remember last five

7:51:57

conversation chain or if you want to

7:51:59

remember just last 10 to 20 conversation

7:52:01

chain in that case what I can

7:52:03

do what should I do over here so here L

7:52:07

chain has given you few more method now

7:52:09

let's try to understand regarding uh

7:52:11

let's try to understand those particular

7:52:13

method that what is the use of this

7:52:14

conversation chain and we have one more

7:52:17

me method now let me uh give you that

7:52:20

particular method also try to understand

7:52:22

about it so here is my second method see

7:52:24

each and everything I kept it somewhere

7:52:26

in my notepad I'm just going to copy and

7:52:27

paste so try to understand please

7:52:29

because I'm doing it uh because I want

7:52:31

to save my time and uh in a short uh

7:52:35

amount of time I want to deliver uh like

7:52:37

uh more and more thing so here you can

7:52:40

see uh there is one more concept that is

7:52:42

conversation buffer window memory so

7:52:45

there is two concept which we need to

7:52:47

understand now here first let's try to

7:52:49

understand this conversation chain that

7:52:50

what is the meaning of it so here uh

7:52:53

what I'm going to say that uh let me

7:52:55

keep it in a single line and if I uh if

7:53:00

just remember let's just remember 10 to

7:53:02

15 convers and that would be great now

7:53:05

what I can do here I can write down some

7:53:06

sort of a code regarding this

7:53:08

conversation chain so first of all guys

7:53:10

what I need to do here first of all I

7:53:12

need to import it so let me import this

7:53:15

conversation chain over here so from uh

7:53:18

the link chain itself from the link

7:53:19

chain do chains I am going to import

7:53:21

this conversation chain now let me run

7:53:24

it and yes we are able to do it now here

7:53:26

what I'm going to do I'm going to create

7:53:28

object of this conversation chain now if

7:53:31

you look into the if you look into the

7:53:33

object so here I'm going to keep a

7:53:35

couple of thing here I'm going to write

7:53:37

down a couple of things so here the

7:53:39

first thing see uh this is what this is

7:53:41

the object this is the object and inside

7:53:43

this object I'm going to mention few

7:53:45

parameter the parameter nothing here I'm

7:53:47

just is going to mention this model LM

7:53:49

model and here I mention open a I can

7:53:51

write it down the client directly or

7:53:52

else I can write it down like this open

7:53:54

a and here is my open a key and this is

7:53:56

the temperature you already know what is

7:53:58

the temperature in the previous session

7:54:00

in my uh day two actually I have uh

7:54:02

explained you the concept of the I have

7:54:04

explained the concept of this

7:54:06

temperature what is the meaning of the

7:54:07

temperature and the value you will find

7:54:09

out of this temperature between 0 to 2

7:54:11

if you are keeping it zero so you will

7:54:13

get a straightforward answer but you

7:54:14

have like increasing the value of this

7:54:17

temperature so it's going to be this

7:54:19

model is going to be a more creative it

7:54:20

will give you the creative answer so

7:54:22

here you can U maintain the temperature

7:54:25

of the answer whatever answer basically

7:54:27

you want whatever output basically you

7:54:29

want you can maintain a temperature you

7:54:31

can maintain the creativity of that

7:54:33

particular answer now here uh to this

7:54:36

particular method to this conversation

7:54:37

chain I'm just going to pass this llm

7:54:40

and here is what here is my object open

7:54:42

Ai and there's couple of parameter which

7:54:45

uh with that you are already familiar

7:54:47

now let me run it so let me create a

7:54:50

object of this conversation chain so

7:54:53

here I created object of this

7:54:54

conversation chain and the uh object

7:54:57

name is what the object name is convo

7:54:59

now I just need to run something over

7:55:01

here so uh here what basically what I'm

7:55:03

going to do here I'm going to write down

7:55:05

convo convo do prompt so here if I will

7:55:09

write convo do prompt so you will find

7:55:10

out that this is nothing it is giving me

7:55:12

a prompt template so here we have a

7:55:14

input variable which is history and

7:55:16

input template so it is a there is a

7:55:18

template the following is a friendly

7:55:20

conversation between a human and AI the

7:55:22

AI is a tative uh provides lots of a

7:55:25

specific detail from its context if AI

7:55:28

does not know the answer to the question

7:55:29

it truthfully say it does not know so

7:55:32

here uh they have written by one by

7:55:34

default message one by default prompt

7:55:36

actually now let's try to see uh

7:55:38

something else over here so here I'm

7:55:39

going to write down con. prom. templates

7:55:43

now uh let me extract this template and

7:55:46

here you will see that uh here basically

7:55:49

we have a template the same message

7:55:50

which I was trying to read from there

7:55:52

from here itself so now you can see the

7:55:55

same message over here now if you will

7:55:57

write it on the print so here you will

7:55:59

get the clear cut message uh without the

7:56:01

selection and all so just write down

7:56:03

inside the print so this is the uh thing

7:56:06

uh this is the message basically which

7:56:07

I'm getting it's a by default message uh

7:56:09

which I'm getting if I'm calling this

7:56:10

con. prompt so here in the template it's

7:56:13

a by default message now uh now let's

7:56:16

try to understand that what is the use

7:56:18

of this uh convo what is the use of this

7:56:20

particular object now here what I'm

7:56:22

going to do here I'm going to ask the

7:56:24

same question to my chat GPD uh to my

7:56:26

GPD model now here I'm saying that convo

7:56:30

convo do run and here I'm asking to my

7:56:34

uh model uh who won the first Cricket

7:56:41

World Cup who won the first Cricket

7:56:43

World Cup who won the first Cricket

7:56:46

World Cup this is the question now if

7:56:48

I'm going to run it so here you will

7:56:49

find out it is giving me answer that the

7:56:51

first Cricket World Cup won by the

7:56:53

Western be in 1975 they beat Australia

7:56:56

by 179 in the final so this is the

7:56:59

information which I'm getting from the

7:57:00

from my model now here what I'm going to

7:57:02

do here I'm going to run uh convo convo

7:57:06

do run now here I'm asking to my model

7:57:09

that uh can you tell me can you tell me

7:57:13

uh can you tell me how

7:57:15

much will be 5 + 5 so it's a simple

7:57:19

question which I'm asking to my model

7:57:21

now let's see the answer the answer is

7:57:23

10 now let's try to ask one more

7:57:25

question over here so let's try to ask

7:57:27

one more question to my uh model so here

7:57:30

what I'm going to do here I'm asking con

7:57:33

can you tell me how much will be 5 * 5

7:57:37

so that's a question or let me keep

7:57:39

something else over here let's say 5 + 1

7:57:42

and here and this is the expression this

7:57:44

is the mathematical explation which I'm

7:57:46

passing now let's see what will be the

7:57:47

answer so it is able to answer me that

7:57:49

the answer is 30 now let's try to ask uh

7:57:53

uh the question to my model that uh who

7:57:56

was the captain of the winning team the

7:57:59

same question which I was asking to my

7:58:01

chat GPT and it was able to answer now

7:58:03

let's see uh will it be able to answer

7:58:06

the same question or not over here if

7:58:08

I'm hitting my API let's see now so here

7:58:11

what I'm going to do so here I'm going

7:58:13

to uh copy it conversion uh convo do run

7:58:17

and I'm going to ask the question the

7:58:18

question is nothing the question is uh

7:58:20

very simple so who was the captain who

7:58:25

was the captain of the

7:58:29

winning team so I didn't give any sort

7:58:32

of information what winning team which

7:58:34

winning team I just like going I'm just

7:58:36

going to follow the conversation now if

7:58:38

I will hit the enter so here you will

7:58:40

find out it is able to give me a reply

7:58:43

the captain of the winning team in the

7:58:45

first Cricket World Cup was the live lck

7:58:48

so it is able to sustain it is able to

7:58:50

sustain the conversation now how we can

7:58:54

do it by using this conversation chain

7:58:56

so first we have understood that if you

7:58:58

want to get the if you if you want to

7:59:00

get all the previous conversation so you

7:59:03

can get it you just need to mention the

7:59:05

memory parameter over here if you're not

7:59:07

going to do it so in that case it will

7:59:09

give you the none but if you're going to

7:59:11

mention it conversation buffer memory so

7:59:13

it will be able to retain all the

7:59:15

previous conversation

7:59:18

now here we are talking about this

7:59:19

conversation chain so by using this

7:59:22

conversation chain I will be able to

7:59:24

retain the I will be able to retain the

7:59:27

tell me I will be able to retain the

7:59:29

memory and uh yes uh like you can ask

7:59:32

anything let's try to uh again check

7:59:34

with a different uh like uh let's try to

7:59:37

check again with a different prompt so

7:59:39

here I'm uh saying to my model

7:59:42

so can you divide can you divide

7:59:47

those uh can you

7:59:49

divide uh the

7:59:51

number numbers and can you give me

7:59:55

answer can you give me a final answer so

8:00:00

here I'm asking through my model that

8:00:01

can you divide the number whatever

8:00:03

number basically is using before

8:00:06

actually it is using so can you divide

8:00:08

those particular number and can you give

8:00:10

me the final answer now let's see what

8:00:12

what I will be getting over here so it

8:00:13

is giving me the five okay so it is

8:00:15

giving me a five uh which uh number is

8:00:18

going to divide I uh so the answer is

8:00:22

five which number it is going to divide

8:00:25

I think uh 5 is six 5 / by uh five if it

8:00:32

is saying like that maybe is going to

8:00:34

divide this uh 30 by six so that's why

8:00:38

I'm getting this five but yeah it is

8:00:39

able to retain the memory it is able to

8:00:42

retain the memory and it is working so

8:00:44

uh I think uh you got to know that how

8:00:47

to uh get all the previous conversation

8:00:50

that is the first thing and how to

8:00:51

retain the memory if you are using the

8:00:53

API now guys see we have one more method

8:00:56

over here the method name is what

8:00:58

conversation buffer window memory now

8:01:01

what's the meaning of that first of all

8:01:03

let me show you first of all let me

8:01:04

write it on the code actually and then I

8:01:06

will explain you the meaning of this

8:01:08

conversation buffer window memory so uh

8:01:11

tell me guys still here everything is

8:01:13

fine everything is clear that whatever

8:01:15

thing my chat GPD is doing I able ble to

8:01:16

do the same thing by using this Len

8:01:18

chain this Len chain is too much

8:01:20

powerful if you if I'm using my API so

8:01:24

in that case how I can sustain the

8:01:26

conversation how I can remember all

8:01:28

those thing so here is a way you just

8:01:31

need to import the classes and all in a

8:01:33

back end already the code has been

8:01:35

written by someone you just you are just

8:01:37

going to use it and uh definitely you

8:01:40

can uh create a application in that you

8:01:42

can use the same concept got it so if

8:01:45

this part is getting clear then and

8:01:46

please do let me know in the

8:01:53

chat no buffer this is a different

8:01:55

object now we are just going to remember

8:01:58

all the previous conversation here see

8:02:00

we are able to retain the previous

8:02:02

conversation this one is giving me all

8:02:04

the conversation but here actually by

8:02:06

using this conversation chain what I'm

8:02:08

doing tell me so here by using this one

8:02:11

I'm able to do like same this chat

8:02:15

GPT okay okay so where we are able to

8:02:17

retain the uh like where we are able to

8:02:20

retain the memory so here I was asking

8:02:23

this thing to my CH to my model to my

8:02:25

API and then I I written this particular

8:02:28

um like me I I written this particular

8:02:30

prompt and then again I asked this

8:02:32

question related to this one and it is

8:02:34

able to give me

8:02:35

answer so that's a difference try to

8:02:38

understand try to observe it here

8:02:40

conversation buffer memory this a

8:02:41

different method by sustaining the

8:02:43

conversation here you can see and

8:02:45

conversation chain is doing a same

8:02:47

Behavior Uh like which we are able to

8:02:49

achieve in a chat GPT so somewhere in a

8:02:52

in the chat GPT application also they

8:02:54

implemented the same concept for

8:02:55

sustaining the memory that's why it is

8:02:57

able to do it we don't know uh uh What

8:03:01

uh what type of code they have written a

8:03:03

backend if you want to check you can

8:03:04

check it you can go through with the Len

8:03:06

chain so here uh you can search a len

8:03:08

chain l a n

8:03:11

g and uh just check with the Lenin

8:03:14

GitHub so here you will get the source

8:03:16

code code of the Lang chain and now you

8:03:18

can uh check that what code they have

8:03:20

written regarding a different different

8:03:21

thing so here go inside the cookbook and

8:03:24

there is like all the code regarding a

8:03:26

different different thing and just try

8:03:28

to read the lowlevel code that what

8:03:32

all what Logics and all they are going

8:03:34

to uh they have written over here

8:03:36

actually so you just need to go through

8:03:38

with the Len and uh GitHub and there

8:03:41

you'll find out all the codes and

8:03:44

all tell me guys now this part is

8:03:46

getting clear to all of you please or do

8:03:49

let me know in the chat if the part is

8:03:51

getting if this part is if this part is

8:03:53

getting clear or not this uh

8:03:55

conversation chain and this uh

8:03:57

conversation buffer memory now let's try

8:03:59

to understand this conversation buffer

8:04:00

window memory but that what is a meaning

8:04:02

of it and then again I will uh I will

8:04:06

try to revise it and I will uh I will be

8:04:08

showing you the same thing by using the

8:04:10

uh documentation so all the thing uh

8:04:12

they have mentioned over there already

8:04:14

uh each and every theoretical is stuff

8:04:16

then uh I will try to explain you that

8:04:19

uh from there itself now here we are

8:04:21

talking about this conversation buffer

8:04:23

window memory then what is a use of this

8:04:25

particular method now let's try to

8:04:27

understand it so here the first thing

8:04:29

which I have to do so first of all I

8:04:31

have to create a object of it now uh

8:04:34

here let me create a object so I'm going

8:04:36

to import it conversation buffer window

8:04:39

memory now if I'm going to run it so yes

8:04:41

I'm able to run it and I'm able to uh

8:04:44

I'm able to like import this particular

8:04:46

statement so here I'm going to create a

8:04:48

object of it so this is what this is my

8:04:50

like object and here I'm going to write

8:04:53

down my object name is nothing it's a

8:04:54

memory now inside this uh uh like object

8:04:59

actually uh there is one parameter so

8:05:01

let me write it on the parameter name so

8:05:03

the parameter name will be a key right

8:05:06

which I represent with which they

8:05:07

represent with K so here I I'm going to

8:05:10

pass one parameter the parameter name is

8:05:12

what the parameter name is K now here I

8:05:14

can pass any sort of a value regarding

8:05:17

this K 1 2 3 4 5 6 7 8 9 10 11 12

8:05:20

whatever now what is the meaning of that

8:05:22

so first of all let me write down that

8:05:24

and let me run it in front of you and

8:05:26

then I will try to explain you this

8:05:28

thing so here I'm going to write it down

8:05:29

K is equal to 1 now here I created a

8:05:32

object so here I've created a memory now

8:05:35

what I'm going to do I'm going to create

8:05:37

a conversation chain again so the

8:05:38

conversation chain which I uh uh which I

8:05:42

imported over here now let me paste it

8:05:44

over here this conversation chain

8:05:46

conversation chain and now what I need

8:05:48

to do I I'm just going to be mention one

8:05:50

parameter over here so I'm going to

8:05:52

mention memory parameter inside this

8:05:54

conversation chain see this is my main U

8:05:57

this is my main class this conversation

8:05:58

chain which I'm using over here though

8:06:01

uh along with that you'll find out two

8:06:03

more so conversation buffer window

8:06:05

memory and conversation uh conversation

8:06:07

buffer memory so buffer window memory

8:06:10

what is the meaning of that after this

8:06:13

uh particular example you will get to

8:06:15

know by yourself on only so here I'm

8:06:17

going to keep it and let me uh write it

8:06:21

on this memory over here and here what

8:06:23

I'm going to do here I'm going to create

8:06:24

a object so convo object so this is what

8:06:27

this is my convo object now uh what I'm

8:06:29

going to do I'm going to run it so here

8:06:31

I'm going to run the same thing so now

8:06:34

let me uh copy it and let me paste it

8:06:37

over here so let me paste it over here

8:06:40

uh this particular thing uh this

8:06:42

particular sentence and here let's see

8:06:45

what will be the answer so here if I'm

8:06:46

going to run it so you can see that it

8:06:48

is saying that the first Cricket World

8:06:50

Cup uh was held in 1975 and it w won by

8:06:53

the wested that is perfectly fine now

8:06:56

again I'm going to ask to my model that

8:06:58

convo. run convo do run and here I'm

8:07:02

asking that what will be 5 + 5 now it is

8:07:05

saying that 5 + 5 will be 10 now I'm

8:07:07

asking to my uh now I'm asking to my

8:07:10

model that who was the captain of the

8:07:12

winning team so if I'm uh giving this

8:07:15

particular code question now let's see

8:07:17

what will be the answer so it is saying

8:07:19

that I sorry I don't know I'm sorry I

8:07:22

don't know because see uh if I didn't

8:07:24

mention anything it is able to uh by

8:07:28

default actually see there is a uh

8:07:29

memory parameter see in a you can create

8:07:32

this conversation buffer memory and if

8:07:34

you are going to create a chain now if

8:07:36

you're going to create a chain now there

8:07:37

you can mention this memory and you can

8:07:39

track the entire conversation that is

8:07:43

perfectly fine now here uh if I want a

8:07:46

same behavior like this chat GPT for

8:07:48

that there is a main method conversation

8:07:50

chain there's a main method so here

8:07:53

conver here I created a object of the

8:07:54

conversation chain and here is what here

8:07:57

I'm going to call this run method now

8:07:59

you can see it is able to sustain the

8:08:01

memory it is able to sustain the memory

8:08:04

now here you will find out one more

8:08:06

thing uh like one more class

8:08:08

conversation buffer window memory now

8:08:10

here Ive created a object of this

8:08:12

conversation buffer buffer window memory

8:08:14

and I passed the key value key equal to

8:08:16

1 so key equal to 1 means what is the

8:08:18

meaning of this key equal to 1 so it is

8:08:21

just able to sustain or it is just able

8:08:24

to remember all the thing uh like till

8:08:27

the one prompt till the first prompt

8:08:29

only after that it won't be able to

8:08:32

remember anything if I'm writing over

8:08:34

here K is equal to 4 now in that case

8:08:37

just see the effect so here if I'm going

8:08:39

to create K is equal to 4 so see uh

8:08:41

convo is there now I'm going to run it

8:08:43

okay great now I'm going to ask to my

8:08:45

model okay

8:08:46

now see see now it is giving me answer

8:08:49

so I can Define the window size I can

8:08:51

Define the number of prompt here if I'm

8:08:53

saying uh K is equal to 2 so now let's

8:08:57

see what it is giving to me so here I'm

8:08:59

saying K is equal to 2 that's great this

8:09:01

one is fine this one is fine now it is

8:09:03

saying the first Cricket World Cup was

8:09:05

held in 1975 now it will stop over here

8:09:09

now if I'm going to ask to my uh like

8:09:11

this one so here it is giving me answer

8:09:13

because now I'm going to sustain this

8:09:15

both both conversation see K is equal to

8:09:18

1 means what let me tell you that K is

8:09:21

equal to 1 means what see k equal to 1

8:09:24

means what this one only the first one k

8:09:27

is equal to 2 means what this both this

8:09:29

both K is equal to 2 so if I'm writing

8:09:31

over here K is equal to 2 so it is going

8:09:33

through with this particular sentence

8:09:34

and it's going through with this

8:09:35

particular sentence and if it is seeing

8:09:37

this sentence now so it is able to

8:09:38

remember it is able to see this one now

8:09:40

this one and this one so in that case it

8:09:43

a it is able to generate answer but if I

8:09:45

mention k equ Al to one so after this

8:09:47

one is not able to remember anything

8:09:49

that's the last one okay so I can select

8:09:52

the window size over here you can select

8:09:54

the window size if you're not going to

8:09:56

select it will be tracking the entire

8:09:58

conversation by default it will be

8:10:00

tracking the entire conversation now

8:10:02

let's try to see the same thing by using

8:10:04

uh like on top of the documentation also

8:10:07

so they have mentioned the same thing so

8:10:09

let me open the Len chain documentation

8:10:11

l n Len chain documentation and over

8:10:16

here uh let me open it first of all so

8:10:19

Lin memory where you will find out go

8:10:22

inside more and here is a memory so

8:10:24

let's try to understand uh about the

8:10:26

memory that uh what all typee of

8:10:29

memories we have and what all thing

8:10:33

basically they have written over here

8:10:34

let's try to understand that thing so

8:10:36

most llm application have a

8:10:38

conversational interface so an essential

8:10:40

component of the conversation is begin a

8:10:42

it's conversation uh is being able to

8:10:45

refer to information introduced earlier

8:10:47

in the conversation means uh whatever

8:10:49

conversation we are making so it should

8:10:50

be like uh like it should have a

8:10:52

connectivity in between so at bare

8:10:54

minimum a conversational system should

8:10:56

be able to access some window of past

8:10:58

message directly so a comp more complex

8:11:01

system will need to have a world model

8:11:03

that is constantly updating which allow

8:11:05

us to do thing like Mentor information

8:11:07

about the entities and their

8:11:09

relationship so here they have given you

8:11:11

the complete detail now building memory

8:11:13

into a system how how state is stored

8:11:15

how state is queried so there are like

8:11:18

some sort of a theory they have given

8:11:20

over here now here they have given that

8:11:23

this get is started so let's try to read

8:11:24

it from here so let's look at what

8:11:27

memory actually looks like in L chain

8:11:29

here we will cover the basics of

8:11:30

interacting with the arbit memory class

8:11:32

so here the same memory class uh which

8:11:35

we were using so here I have created a

8:11:37

like object of the memory class now here

8:11:39

I'm asking so memory. chat. memory add

8:11:42

user and what is up so something like

8:11:45

that uh there calling basically this

8:11:46

particular method over here which is

8:11:49

there inside this conversational buffer

8:11:51

memory itself now what variable get

8:11:54

written from memory so here if you will

8:11:56

load the memory you are getting this

8:11:57

particular thing the same thing I was

8:11:59

able to get by calling this parameter

8:12:01

the parameter which I was calling chain.

8:12:03

memory actually I'm not directly using

8:12:05

this thing I'm not directly using a

8:12:07

method from this particular class from

8:12:09

this conversation buffer memory instead

8:12:11

of that what I'm doing instead of that

8:12:13

I've have created a object of this llm

8:12:16

chain and here I'm passing my all the

8:12:18

component I'm making a chain okay I'm

8:12:21

stacking all the component and then

8:12:23

basically I'm calling this chain. memory

8:12:26

and I'm getting here I'm getting this

8:12:27

particular output and the same output

8:12:30

you can see over here as well you you

8:12:32

you are getting the same output over

8:12:34

here as well right so yes I'm able to

8:12:36

get the same output by using that

8:12:38

particular parameter chain. memory.

8:12:40

buffer or chain. memory now here uh we

8:12:43

have other one also so like you can give

8:12:46

the key and all you can explore about it

8:12:48

now there are few more parameter like

8:12:50

return return message and all each and

8:12:51

everything you will find out over here

8:12:54

now end to an example so they have given

8:12:55

you the endend example over here so open

8:12:57

a prompt

8:12:58

template conversation buffer memory now

8:13:01

see I'm using the same thing I'm using a

8:13:03

same thing over here I'm using the llm

8:13:06

chain I'm I'm running the same example

8:13:08

in my jupyter notebook so you can go

8:13:10

through with the documentation and you

8:13:12

can copy from there also and you can

8:13:13

test it they have given you like a small

8:13:15

small code is snipp it just for the

8:13:17

testing just for the learning and

8:13:18

directly you can integrate this thing

8:13:20

inside your application got it now here

8:13:23

uh you can see using a chat model so one

8:13:26

more example they have given you and

8:13:28

then next step inside that you will find

8:13:30

out few more thing uh memory in llm

8:13:32

chain memory types okay now customized

8:13:35

conversation custom memory multi uh

8:13:37

multiple memory classes there are so

8:13:39

many thing you will find out so if

8:13:41

you'll go inside this memory type so

8:13:43

just just see uh with the memory types

8:13:45

and and then conversation buffer

8:13:47

conversation buffer the same thing um

8:13:49

the entire code you will find out then

8:13:51

conversation buffer window now let's see

8:13:53

what is the meaning of the conversation

8:13:54

buffer window so conversation buffer

8:13:57

window memory keep a list of interaction

8:13:59

of the conversation over the time it

8:14:01

only uses the K interaction the number

8:14:04

of interaction so this can be useful for

8:14:06

keeping a sliding window of of most

8:14:09

recent interaction so the buffer does

8:14:11

not go too large so if we are talking

8:14:14

about buffer so it is having a complete

8:14:18

uh like a complete uh conversation

8:14:21

whatever conversation we are doing but

8:14:22

if you want to keep it short so you can

8:14:25

mention the K over there so here I I was

8:14:27

doing that so here if I'm writing K is

8:14:29

equal to 1 so here if I'm writing K is

8:14:32

equal to 1 in that case is not able to

8:14:34

remember anything so simply it is saying

8:14:36

that I don't know about it it it it is

8:14:38

just going to stop over here itself so

8:14:40

this one and this one now uh if I'm

8:14:43

going to ask this uh particular thing so

8:14:45

it is saying I don't know about it

8:14:46

because after this one is not going to

8:14:48

track anything K is equal to 1 means

8:14:50

what just one sentence means it is not

8:14:53

going to remember anything uh over here

8:14:55

now if I'm going to write it down over K

8:14:57

is equal to 2 in that case it will be

8:14:59

able to sustain something right by using

8:15:01

this two particular prompt and if I'm

8:15:02

going to ask something after this one so

8:15:04

it is saying that yes now it is knowing

8:15:08

okay now it knows about it so here uh if

8:15:11

you're not mentioning any sort of a

8:15:12

window is is going to keep a track for

8:15:15

the ENT entire conversation but if you

8:15:17

are going to mention a window parameter

8:15:19

over here in that case it will be

8:15:21

restricted each and everything they have

8:15:23

mention inside the documentation itself

8:15:25

try to read it from here got it now how

8:15:28

to use a chain means how to like uh uh

8:15:31

like how to uh sustain a memory and all

8:15:34

means if you're going to make any sort

8:15:35

of a conversation and all so this

8:15:37

conversation buffer memory conversation

8:15:39

buffer window memory is just for sustain

8:15:41

the the memory basically the

8:15:43

conversation but actual conversation how

8:15:45

you make the actual conversation which

8:15:47

we are doing over here actually here so

8:15:50

by using this particular class

8:15:51

conversation chain class this is the

8:15:53

main class and this two class for

8:15:56

sustaining a conversation this is for

8:15:57

the entire conversation and this is just

8:15:59

for the limited window means a

8:16:02

customized window whatever number you

8:16:04

are going to write it down till that

8:16:06

particular window now it is clear what

8:16:09

is a memory yes or no please do let me

8:16:11

know in the chat if uh this part is

8:16:13

getting clear to all of you

8:16:19

are you able to get it guys uh are you

8:16:21

able to understand the concept of the

8:16:22

memory how to do that how to make a

8:16:25

conversation how to import the different

8:16:27

different import statement how to like

8:16:30

uh how to go through the

8:16:32

documentation yes or no please do let me

8:16:35

know in the chat if you're getting it

8:16:37

I'm waiting for your

8:16:44

reply

8:16:59

clear clear clear great

8:17:03

uh if you have any doubt you can ask me

8:17:05

in the chat and then I will start with

8:17:08

the next

8:17:13

concept what is the limit of of memory

8:17:15

Li limit you can Define now you can def

8:17:17

Define the limit according to your

8:17:19

problem

8:17:20

statement you don't want to be create uh

8:17:22

to Long buffer so in that case you can

8:17:25

uh you can uh like uh mention this K

8:17:28

parameter it's up to you it's up like uh

8:17:31

up to your requirement up like how much

8:17:34

what uh how much uh like your

8:17:36

configuration and all what all resources

8:17:38

you are using according to that you can

8:17:44

decide where the memory concept used in

8:17:46

a real uh life exam application

8:17:49

so here what I explained tell me so it

8:17:54

is not a real time explain this chat

8:17:56

GPT so this chat GPT is a real time

8:17:59

application now that that that's why

8:18:01

first I have explained this one only so

8:18:04

let's say if you are making a

8:18:05

conversation to the

8:18:07

chatbot if you're making a conversation

8:18:09

to the chatbot and if you ask to the

8:18:10

chatbot let's say you visited a website

8:18:12

any website and let's say I your own

8:18:14

website side there you are asking uh

8:18:17

let's say we have a chatboard on in own

8:18:18

website you are asking to the chatboard

8:18:20

okay what is the price of this

8:18:21

particular course then U like let's say

8:18:24

you are getting some sort of a prize and

8:18:26

then you are asking something else who

8:18:27

was a mentor and all now again you are

8:18:29

asking a question related to that course

8:18:31

itself that what all thing you covered

8:18:32

in this course now it is saying that

8:18:34

which course I don't know about any

8:18:38

course even though you mention the name

8:18:40

over there gener course but it is saying

8:18:41

no I don't know about it because is not

8:18:43

able to S it is not sustaining the

8:18:46

conversation the conversation is not in

8:18:48

buffer so like there it can go and it

8:18:51

can like read each and everything the

8:18:53

model actually it is not able to sustain

8:18:55

the context is able to sustain a context

8:18:57

in terms of the a sentence but not in

8:18:59

terms of the

8:19:01

conversation so that's a real time

8:19:03

example so that's why I have explained

8:19:06

you this chat GPT at the first place and

8:19:08

then I back to this uh I uh went to this

8:19:12

uh like python implementation by us

8:19:15

using like if we are implementing the

8:19:17

same thing like by using the API by

8:19:19

using the openi how we can achieve this

8:19:21

particular thing how we can achieve the

8:19:23

memory and all how we can sustain the

8:19:24

memory so it's all about that only

8:19:28

please try to run it by yourself please

8:19:30

revise it you will be getting and one

8:19:32

more thing uh before implementing with

8:19:35

uh before implementing any sort of a

8:19:37

concept from the Lan chain try to go

8:19:39

through with the documentation theyve

8:19:40

given you each and everything along with

8:19:42

the theory so first read the theory and

8:19:45

read the uh like uh code snipp it and

8:19:48

all whatever they have given you and

8:19:49

then you can uh run it inside your

8:19:52

system and then uh basically you can run

8:19:54

my file as well whatever like code and

8:19:56

all I'm writing it don't worry I give

8:19:58

you I will give you the each and

8:20:00

everything in a resource section so from

8:20:02

there itself you can download

8:20:04

it okay so if this thing is clear do

8:20:07

please do let me know because I'm going

8:20:09

to start with a new thing uh with a new

8:20:11

topic and now let me create a new

8:20:13

notebook over here

8:20:16

I think this Lang chain is clear in the

8:20:17

Lang chain I have explained you five to

8:20:20

six concept which is going to be a very

8:20:22

much important once uh we'll start with

8:20:24

the project you will get to know the

8:20:26

importance of this thing this topic and

8:20:29

inside this particular top inside this

8:20:31

particular notebook I have kept

8:20:33

everything related to this open API and

8:20:35

this L chain so here let me rename it so

8:20:38

test open AI

8:20:40

API test open AI API and Link Chain so

8:20:44

everything you will find out regarding

8:20:46

this openi API and Lenin inside this

8:20:49

particular notebook guys you just need

8:20:51

to visit this notebook everything I have

8:20:54

written over here along with the code so

8:20:56

let's start with a new topic and the new

8:20:58

topic is going to be a uh hugging face

8:21:01

hugging face with Len chain uh hugging

8:21:05

face with Len

8:21:12

chain hugging face face is

8:21:17

fce so can we start now have you open

8:21:20

the new

8:21:26

notebook yes correct aishu uh your

8:21:29

understanding is

8:21:32

correct tell me guys uh have you opened

8:21:35

the new jer notebook so uh I can start

8:21:38

with the thing I can start with a new

8:21:39

topic hugging Faith with Lin and after

8:21:41

this one after explaining you this thing

8:21:44

I will move to the uh like I will move

8:21:46

to the project I will I start with the

8:21:48

project from Monday onwards and first I

8:21:50

will explain you the use case and then I

8:21:53

will code in front of you only first I

8:21:56

will explain the use case and the

8:21:57

project setup and all and then we'll

8:21:59

start with the implementation of that so

8:22:02

let's start with the hugging phase with

8:22:04

lench it's going to be a new thing new

8:22:07

concept so let's understand uh this uh

8:22:10

particular thing so first of all guys

8:22:12

what you need to do so first of all you

8:22:14

need to log into the hugging face

8:22:16

hugging face Hub so just search in your

8:22:18

Google hugging face and you will get a

8:22:21

very first website this is the website

8:22:24

of the hugging phas sdps do hugging U

8:22:27

hugging face.com so uh try to visit to

8:22:30

this particular website and uh if you

8:22:33

didn't uh sign up so first do the sign

8:22:35

up and then sign in and after that you

8:22:39

will be able to create your profile so

8:22:41

first you need to do sign up and then do

8:22:43

the sign in so automatically you will

8:22:45

get your profile and this is what this

8:22:46

is my profile I already did a sign up so

8:22:49

no need to do anything you can do the

8:22:51

sign up by using the Google s well by

8:22:53

using your Gmail ID as well so just try

8:22:55

to sign up first and try to like create

8:22:57

your profile and then sign in

8:22:59

automatically you'll find out your

8:23:01

profile over here so after getting your

8:23:04

profile guys see uh here they have uh

8:23:06

see this is the uh like uh homepage now

8:23:09

just click on this model so once you

8:23:11

will click on the model actually you

8:23:12

will find out so here it is saying no re

8:23:15

uh activity display here we have a data

8:23:17

set spaces papers papers collection

8:23:19

Community there are so many thing right

8:23:21

so if I'm following something so it will

8:23:23

be visible over here now just click over

8:23:25

here this one this model so what I can

8:23:28

do I can click on this model so I will

8:23:30

be getting all the model these are these

8:23:31

are the model basically so just click on

8:23:33

this all so here basically you will find

8:23:35

out all the model and here actually it

8:23:37

is showing you the trending model what

8:23:39

trending model is there over here now uh

8:23:42

directly you can search about this model

8:23:44

so what you can do I'm not able to open

8:23:47

let me check with this models yes guys

8:23:49

so over here you can see these are these

8:23:50

all are the model which is there over

8:23:52

the hugging phase now you can uh short

8:23:55

it uh which is a trending one which is a

8:23:57

most download one which is a recently

8:23:59

one recently updated most uh liked llm

8:24:03

so there you will find out like all the

8:24:05

llms and all now let's check with the

8:24:07

most like so here I'm going to short all

8:24:10

the model with this most like okay so

8:24:13

stable diffusion is is a model which is

8:24:15

the most liked one now you will find out

8:24:17

Bloom is there uh okay so here orange

8:24:20

mix is there a control net is there open

8:24:23

journey is there chat glm is there star

8:24:25

coder so there are so many model even

8:24:28

Lama 2 is also there this one Dolly V2

8:24:31

it's a model from the uh data brakes

8:24:33

this llama 2 it's a model of the meta

8:24:36

it's a model from The Meta now stable

8:24:39

diffusion is also there stability AI

8:24:41

there's the organization name stability

8:24:43

Ai and here you will find the table

8:24:44

diffusion and here you can see the

8:24:46

number of downloads as well so there you

8:24:48

will find out the number of download now

8:24:50

see llama this llama 2 how many times it

8:24:54

has been downloaded

8:24:56

947k around 1 million now here you will

8:24:59

find out gpt2 gpt2 is also there it has

8:25:02

been downloaded 17 million times 170

8:25:05

million download is there okay so okay I

8:25:08

think it's not a download it may be a

8:25:10

size

8:25:11

uh let me check with the download so

8:25:14

most

8:25:16

downloaded so here now I'm going to

8:25:19

check with the most downloaded I think

8:25:21

it's a download only it's not a size

8:25:23

actually so 73.3 million and distal GPD

8:25:27

is also there robot is there there are

8:25:29

so many model you will find out and you

8:25:32

can see the number 4 lakh 27,000 so if

8:25:35

you are talking about the open API so

8:25:38

you are restricted with the open API let

8:25:40

me show you that what all model is there

8:25:42

so if you search over the open a so just

8:25:45

open the opena website and check with

8:25:47

the models just do the login First and

8:25:50

try to uh like click on this API and go

8:25:53

inside this model now here you will find

8:25:56

out all the model this all the model has

8:25:58

been developed by the openi itself and

8:26:01

you will find out a different different

8:26:02

variants of this model like this chat

8:26:04

GPT there are so many variant of this

8:26:07

Chad GPT but if we are talking about

8:26:09

this hugging face Hub so it's a open

8:26:11

source repository anyone can contribute

8:26:14

over over here so whoever has created

8:26:16

their llm so they have uploaded to this

8:26:18

hugging face Hub now you can see the

8:26:20

number of model you can see the

8:26:22

different different uh like a task over

8:26:24

here that what you want to do feature

8:26:26

extraction text to image or text to text

8:26:29

image to video text to video whatever

8:26:31

you want to do you will find it find it

8:26:33

out over here let's say what I want to

8:26:35

do let's say I want to perform text to

8:26:36

text generation so if I will click on

8:26:38

this one so you will find out so you

8:26:41

will find out all the model from text to

8:26:43

text generation you can perform text to

8:26:46

text Generation by using this particular

8:26:48

model let's say you want to perform a

8:26:50

conversation so for the conversation

8:26:52

basically there is a different model

8:26:54

dialog GPD is there and go is there and

8:26:57

you will find out other model as well so

8:27:00

from a different different organization

8:27:02

you you can go through with it and you

8:27:04

can check got it yes or no so this part

8:27:07

is getting clear to all of you you can

8:27:09

check with the training you can check

8:27:10

with the training and you will find out

8:27:12

like which is a trending one now let's

8:27:14

say I want to do a text to text

8:27:15

generation so here I'm going to use this

8:27:17

particular model FL T5 base so I'm going

8:27:20

to use this particular model now how I

8:27:22

can do that what will be the procedure

8:27:24

if I want to use this open source model

8:27:27

without any charges so here I'm not

8:27:29

going to pay anything as of now for this

8:27:31

particular model so how I can use it how

8:27:34

I can like uh perform text to text

8:27:36

Generation by using this particular

8:27:37

model now let me tell you that so first

8:27:40

of all what you need to do so just click

8:27:41

on your profile and here click on the

8:27:44

setting so once you will click on the

8:27:46

like this setting so here you will find

8:27:48

out the token access token so click on

8:27:51

this access token so already I have

8:27:53

created a token over here so you can

8:27:55

click on the new token you can click on

8:27:58

the the create token and you will be

8:28:00

able to create a new token over here now

8:28:02

this is going to be a API key this is

8:28:05

going to be a token you can delete it

8:28:07

you can recreate it whatever you want

8:28:09

you can do it and here uh you will find

8:28:11

out access token probability

8:28:13

authenticated your identity to the

8:28:15

hugging face Hub allowing application to

8:28:17

perform specific acction specify the

8:28:19

spoke of permission read write and admit

8:28:21

so here you can visit the documentation

8:28:23

and you can read more about it so first

8:28:25

of all guys you need to sign up and then

8:28:27

you need to log in and after that you

8:28:29

will be able to create your profile and

8:28:31

then you can go inside your profile and

8:28:33

go inside the setting and there you will

8:28:35

find out the token this access token

8:28:38

this particular option and try to create

8:28:40

the new token after creating a new token

8:28:42

what you need to do you just need to

8:28:44

copy this token and uh I will tell you

8:28:47

step by step what you need to do so from

8:28:49

scratch only I'll be writing all the

8:28:50

code so first of all see before starting

8:28:53

with the hugging face you need to

8:28:55

install some Library some other

8:28:57

libraries as well so let me give you the

8:28:59

name of all those Library I I like kept

8:29:02

it somewhere I'm just going to copy and

8:29:03

paste all the thing now here are the

8:29:06

first thing first Library which I'm

8:29:07

going to be install that's going to be

8:29:09

hugging face Hub the second one is a

8:29:11

Transformer and the third one is

8:29:13

accelerate and bit sendy bytes so here

8:29:16

this is to the this two is not a

8:29:18

mandatory one but yeah you need you can

8:29:20

install it because I was getting some

8:29:21

sort of a error and for that only I have

8:29:25

used this I have like installed this

8:29:27

libraries so if uh U like uh so yes

8:29:31

please uh like download uh this thing

8:29:34

this particular uh like packages

8:29:36

accelerate and bit sendy by so you won't

8:29:38

get any sort of error throughout this

8:29:40

implementation but this two is a

8:29:42

mandatory one the first one is a hugging

8:29:44

ph up and the second one is a

8:29:45

Transformer so you cannot SK skip this

8:29:47

two thing and L chain should be there

8:29:50

inside your virtual environment because

8:29:52

this hugging phase actually we are going

8:29:53

to access by using the Len chain only by

8:29:56

using the Len chain only we are going to

8:29:58

access the this hugging phase so I

8:30:00

already did it I already installed it

8:30:02

you just need to run it and uh if I

8:30:05

already installed then it will uh it

8:30:07

will give me the message that

8:30:09

requirement is already satisfied so here

8:30:11

you can see it is giving me that

8:30:13

requirement is already already satisfi

8:30:15

got it now guys what is the next thing

8:30:17

which I need to do so step by step I

8:30:19

have written each and everything I'm

8:30:21

going to write it down over here as well

8:30:23

so the step first what you need to do so

8:30:25

in the step first you need to uh

8:30:27

download all the required Library so let

8:30:30

me write it down over here the step

8:30:33

First Step first is

8:30:38

nothing

8:30:41

download all the required Library

8:30:45

now let me keep it over here and see we

8:30:47

are able to download now in the step two

8:30:49

what I'm going to do here in the step

8:30:51

two I'm going to import it so let me

8:30:53

import all the required Library so I

8:30:55

have written it over here let me import

8:30:58

it uh over here so this is the library

8:31:01

which I have imported so the first one

8:31:03

is H prompt template hugging phase from

8:31:05

the lenon itself of okay so I'm going to

8:31:08

import this hugging face Hub and here is

8:31:10

what here I'm having the llm chain I'm

8:31:12

using this hugging face with Len chain

8:31:15

I'm using this hugging phase with this L

8:31:16

chain try to remember this thing guys

8:31:19

okay so if you are implementing it by

8:31:20

yourself please try to remember that we

8:31:22

are using this hugging phase by using

8:31:24

this Len chain I told you this H Len

8:31:27

chain is a wrapper on a different

8:31:28

different API not even op open AI we can

8:31:31

access many API by using this Len chain

8:31:33

many open source model and all it has

8:31:35

been designed in such a way now here uh

8:31:38

I have imported this thing now what I

8:31:40

need to do guys so here I'm going to

8:31:43

write it down the Third thing so the

8:31:45

third one is what you need to uh like

8:31:47

set the environment variable so for

8:31:49

setting up the environment variable let

8:31:51

me tell you what is a step so here is a

8:31:54

like code basically which you need to

8:31:55

run so let me copy and paste each and

8:31:58

everything I have written uh somewhere

8:32:00

so I'm just going to copy and paste the

8:32:01

small small lines and all now you need

8:32:03

to uh you need to set the environment

8:32:05

variable and here first of all you need

8:32:07

to import this opening system so import

8:32:10

OS os. environment and here is what here

8:32:13

is your hugging phase API token and set

8:32:15

the environment variable set the

8:32:17

environment variable by using this

8:32:19

particular uh like a command now if I

8:32:22

will run it so here I'm able to set the

8:32:24

uh like hugging fish token okay this is

8:32:26

my variable name and this is my value

8:32:28

value of the variable now from where I

8:32:30

got this particular value so I got this

8:32:33

value from here itself from the token

8:32:35

itself so just try to click on this

8:32:37

access token and you will get this value

8:32:39

you will get the value of the token got

8:32:42

it yes or no now here guys just click on

8:32:44

this hugging face and here I seted this

8:32:46

token I set this token and this is the

8:32:48

variable and this is the value now what

8:32:51

is the fourth thing which I need to do

8:32:52

so here let me write it down uh this

8:32:54

particular thing so step by step I have

8:32:57

written each and everything now the next

8:32:59

thing which I'm going to do over here

8:33:00

I'm going to do text to text generation

8:33:03

I'm going to do text to text generation

8:33:04

I'm using sequence to sequence model

8:33:06

this Transformer is what it's a sequence

8:33:08

to sequence model now if we are talking

8:33:10

about the uh different different llm

8:33:12

actually as a base archit Ure it is

8:33:14

using the same Transformer architecture

8:33:16

right so either you can say sequence to

8:33:18

sequence model encoder decoder model

8:33:19

anything anything will be fine for the

8:33:21

Transformer also now I want to do a text

8:33:23

to text generation so I shown you over

8:33:25

here itself in the hugging face model so

8:33:28

let me show you where it is so once I

8:33:30

will click on this model and here let's

8:33:33

say text to text generation I want to do

8:33:34

text to text generation so this is a

8:33:36

model this a flan T5 base it's a model

8:33:40

from the Google side it's a Google model

8:33:42

flan T5 base you can read uh everything

8:33:45

about this uh T5 model for what this has

8:33:48

been trained what uh which data they

8:33:51

have used what is a model size 2848

8:33:53

million parameters is the it is having

8:33:56

like 248 million parameter and here the

8:33:58

number of here you can see the number of

8:34:00

downloads here you can see the table of

8:34:02

content each and everything basically

8:34:04

they have defined they have written over

8:34:06

here regarding this particular model and

8:34:08

this is a Google model and yes you can

8:34:12

uh check about it you can use use it

8:34:14

actually uh how to use it uh let me tell

8:34:16

you that but yeah you can check about it

8:34:18

uh just go through the hugging face Hub

8:34:20

hugging face model and click on this

8:34:22

model click on this text to Tex

8:34:24

generation and you here you will get

8:34:26

this FL T5 base now guys what I need to

8:34:29

do what will be the next thing so the

8:34:30

first of all I need to Define my prompt

8:34:33

and here what I'm going to do guys here

8:34:35

I'm going to Define my prompt so let me

8:34:37

copy The Prompt and here is what guys

8:34:39

here is my prompt this is what this is

8:34:41

my prompt now here I'm going to uh like

8:34:44

Define the chain so let me create a

8:34:46

chain over here now inside the chain

8:34:49

just just try to focus guys what I'm

8:34:51

going to do over here so here guys let

8:34:53

me remove this max length I'm not going

8:34:55

to write it down as of now so initially

8:34:58

like uh not initially in my previous

8:35:00

example just look into the chain uh what

8:35:03

I was doing over

8:35:05

there so if you look into the chain

8:35:08

there I was writing there I was defining

8:35:10

the model from the open a API so let me

8:35:13

show you uh let me show you the chain

8:35:14

prom template agent and here we have a

8:35:19

chain so where is a chain where is a

8:35:21

chain where is a chain this is a chain

8:35:23

now see prom template is there chain and

8:35:25

here I was I was defining a model from

8:35:28

the opena itself what what I was doing

8:35:30

guys tell me I was defining a model from

8:35:32

the open itself now instead of the open

8:35:35

now instead of the open now I'm using

8:35:38

the hugging phas so what I did I created

8:35:41

a object of this hugging face Hub and I

8:35:43

given the repo ID means uh this is the

8:35:45

ID of the model and here is a argument

8:35:48

that U like I need to set the

8:35:50

temperature and all so in this

8:35:52

particular format let me take it in a

8:35:54

different uh let me take it in a

8:35:56

different cell let me show you so here

8:35:58

I'm going to copy it and let me paste it

8:36:00

over here so what is happening just see

8:36:04

what is happening let me take it as a

8:36:06

command so this is the code which I'm

8:36:09

running see this is the code so here now

8:36:12

I'm using now I am going to access the

8:36:15

llm okay which llm this Google FL T5

8:36:18

large now instead of the openi I'm going

8:36:20

to use this particular llm FL T5 large

8:36:23

and this is the uh this is hugging pH

8:36:25

actually which we already imported from

8:36:27

the lenen itself this is the one and

8:36:30

before that actually you need to install

8:36:31

this hugging phase so what you need to

8:36:33

do guys tell me you need to install this

8:36:34

hugging phase pip install hugging phase

8:36:36

otherwise you might face issues so here

8:36:39

uh you have you are using this

8:36:40

particular model this is some sort of

8:36:42

argument uh which you need to mention

8:36:44

now let's try to create a chain and here

8:36:46

the same thing you need to pass the

8:36:47

prompt only now see the power of the

8:36:49

length chain what it is able to do now

8:36:52

uh instead of the hugging open AI I'm

8:36:54

able to connect with the hugging face

8:36:55

also like likewise we will be able to

8:36:57

connect with many apis just check with

8:36:59

the documentation uh so now here you can

8:37:02

see we are able to create a object I'm

8:37:04

getting some sort of a warning you can

8:37:06

ignore it because just a uh it's not an

8:37:08

error actually it's a dependency warning

8:37:11

that uh don't use this version that

8:37:12

version what whatever now here I have

8:37:14

created a chain now what was my prompt

8:37:17

so here I'm saying what is a good name

8:37:19

for the company that make a product

8:37:21

whatever like uh regarding whatever

8:37:23

product I can ask over here so here I'm

8:37:25

saying that chain do run the same thing

8:37:27

I'm going to ask over here chain dot run

8:37:31

now here uh let's say I'm going to ask

8:37:33

uh which product I want so I want uh

8:37:36

let's say mic or I want camera again so

8:37:40

if I'm asking regarding the camera so

8:37:42

let's see so here it is giving me answer

8:37:45

uh Nikon what is a good company name for

8:37:47

a uh what is a good name for a company

8:37:51

uh that makes product so it is giving me

8:37:52

a neon regarding this camera Let's uh

8:37:55

let ask to the different uh uh product

8:37:58

let's say watch so here let's see it is

8:38:01

giving it Tata now let's see uh here if

8:38:04

I'm asking colorful cloths colorful

8:38:08

cloths so here you will see that it is

8:38:11

giving me a DE

8:38:13

so different different name I'm getting

8:38:15

in a similar way uh which I was getting

8:38:17

by using this open API now instead of

8:38:20

the open API I'm using this flan T5

8:38:23

large model you can use any sort of a

8:38:25

model any other model as well there are

8:38:27

like lots of model which you will find

8:38:28

out regarding this text to text

8:38:30

generation you can use this model also

8:38:32

Mard you just need to mention the ID

8:38:34

Mard this is the basically ID just open

8:38:37

it and just copy it from here just copy

8:38:39

it and keep it over here like uh keep it

8:38:42

like this let let me show you that so

8:38:44

here is your model name and what you can

8:38:46

do just copy this hugging pH from here

8:38:49

uh this the complete uh sentence and

8:38:52

just change the name just change the

8:38:54

name of the model just copy it and paste

8:38:56

it over here that's it so just copy it

8:38:59

and paste it over here and you'll find

8:39:00

out this Facebook ambot large 50 now you

8:39:03

can use this particular model if you

8:39:05

want few more a few creativity over here

8:39:07

you can uh pass the temperature M uh

8:39:10

like temperature uh value 1.5 let's say

8:39:12

so so this is what this is a model from

8:39:14

the hugging face and now this time you

8:39:16

are using a different model so the model

8:39:18

name is what Facebook MB large 15 so

8:39:20

like this you can access a different

8:39:22

different model by using the length

8:39:24

chain now what you can do you can create

8:39:26

a one more chain so here I'm going to

8:39:28

copy the same thing now let me change

8:39:30

the envir variable name there's going to

8:39:32

be a chain two and here what I'm going

8:39:34

to do I'm going to copy this hugging

8:39:35

face Hub so from here I'm going to copy

8:39:38

this hugging face Hub and let me paste

8:39:39

it over here so this is what this is my

8:39:41

hugging face Hub this is my repo this is

8:39:43

my model here I'm setting the

8:39:45

temperature and this is what this is my

8:39:47

prompt now if I'm going to run it so yes

8:39:49

I'm able to create a object now here

8:39:51

what you can do here you can call the

8:39:53

method run so run and here you can ask

8:39:56

anything so let's say here I'm asking uh

8:39:59

which product so you can ask uh a mobile

8:40:03

so here let's say regarding any sort of

8:40:05

a product you can ask so it is running

8:40:07

so what is the good name of the company

8:40:09

that makes mobile uh it is saying that

8:40:12

uh it is giving me a prompt only over

8:40:15

here I think I need to follow something

8:40:18

else uh chain do run let's ask regarding

8:40:23

the same thing colorful cloths and let's

8:40:28

see what will be the

8:40:31

answer it is giving me a prompt only I

8:40:34

think in between I need to run something

8:40:36

over here that's

8:40:38

why so Transformer this is a pipeline h

8:40:43

okay

8:40:46

tokenizer I think it is not giving me a

8:40:48

correct answer what so so prompt is fine

8:40:51

I'm passing a same prompt and this is

8:40:54

the

8:40:54

prompt now let's say I'm saying zero

8:40:58

let's set the different value of the

8:40:59

temperature or

8:41:02

05 and see what I am getting over here

8:41:06

uh chain

8:41:09

two what is a good company that makes a

8:41:12

colorful Clause it's not giving me

8:41:14

answer instead of that it's giving me a

8:41:16

uh like a complete prompt

8:41:20

itself so llm hugging face and M large

8:41:24

50 model is what there is a parameter

8:41:28

okay no issue I will check with that if

8:41:30

I need to mention something over here

8:41:31

but that's a way maybe it is not able to

8:41:33

uh like predict correctly whatever I'm

8:41:35

asking but yeah it is giving me answer

8:41:37

this flan T5 large model and even the CH

8:41:39

GPD the GPD uh model also from the open

8:41:42

AI but it is giving me something else it

8:41:44

is running but uh I'm getting other

8:41:47

answers or other answer over here not

8:41:50

related to our related to our prompt I'm

8:41:53

asking something El it is giving me the

8:41:54

complete prompt over here okay so this

8:41:57

is fine now tell me guys how to use any

8:41:59

open source model did you get it please

8:42:01

do let me know in the chat if you got

8:42:03

this particular part that how to use a

8:42:05

different uh how to use any open source

8:42:08

model from the hugging

8:42:11

phase

8:42:15

because it is not a rule-based system

8:42:16

now if I'm again running a query so it

8:42:19

is not giving a same name because it's a

8:42:21

AI based system again and again if you

8:42:24

asked to the chat GP now it will do the

8:42:25

same thing all right it won't repeat the

8:42:28

thing it won't repeat the thing based on

8:42:30

your uh like query it will give you the

8:42:32

different different suggestions and all

8:42:35

so that's why it is giving you the

8:42:36

different

8:42:38

name tell me guys fast uh it is free

8:42:41

actually this hugging pH uh like token

8:42:44

is free you can read more about it uh

8:42:46

just go through the documentation there

8:42:47

is some sort of charges and all U okay

8:42:50

so but as of now it is free uh means uh

8:42:53

like up to some sort of a tokens and

8:42:55

regarding some sort of models it is free

8:42:58

okay so here guys I think this hugging

8:43:01

face part is clear to all of you please

8:43:03

do let me know in the chat if this part

8:43:05

is

8:43:08

clear yes make question answer board

8:43:11

will create in the next class first of

8:43:12

all let let me explain you that how to

8:43:14

use any uh open source uh model so here

8:43:18

I'm using this open source model Google

8:43:20

FL T5

8:43:24

large tell me guys fast uh so this part

8:43:27

is getting clear to all of you if it is

8:43:29

getting clear then please do let me know

8:43:31

in the chat I'm expecting yes or no in

8:43:33

the chat if you have any sort of a doubt

8:43:35

you can ask me I try to clarify that and

8:43:37

then I will explain you how to create a

8:43:39

pipeline how to create a pipeline by

8:43:42

using the uh Transformer so uh we can

8:43:46

import the Transformer over here we can

8:43:48

write it down Leng ch. Transformer and

8:43:50

we can create a complete pipeline as

8:43:52

well means we can uh download the model

8:43:55

we can download the model in our local

8:43:58

okay and in our local memory actually we

8:44:01

can do it uh we can download it and then

8:44:03

we can do the prediction and all the

8:44:05

same thing which I'm doing over here by

8:44:07

using the API I will show you the

8:44:09

pipeline over here so first of all tell

8:44:11

me till here everything is clear think

8:44:12

is fine yes you can use the Lama 2 also

8:44:15

here you will find out the Llama 2 just

8:44:17

try to check with a different different

8:44:18

model related to a different different

8:44:19

task got it so here you will find out of

8:44:22

different different model you can use

8:44:23

the Llama 2 here is a llama 2 this one

8:44:26

llama 2 B Lama 2 13 billion actually

8:44:29

it's from the Billy U but you can check

8:44:32

from The Meta also so here I think there

8:44:36

was a meta you can search about it so

8:44:39

here you can write it down Lama 2 so

8:44:42

once you will search it so you will find

8:44:44

out the Llama just a

8:44:49

second uh you can use llama from the

8:44:52

hugging phase I just seen that uh

8:45:02

training lamba lamba where is a lamba oh

8:45:06

I think I need to check with a different

8:45:08

page So Meta Meta Nick

8:45:14

snip Q see

8:45:17

Stark why I'm not getting it just a

8:45:21

second I think I kept this text

8:45:23

generation that's why now yeah there

8:45:25

there is a llama so here meta Lama so

8:45:28

this is the model from the Facebook side

8:45:30

from The Meta side and uh you will find

8:45:32

out a different different variants of

8:45:34

this llama just uh take it and use it

8:45:37

and it updated uh 25 days ago this

8:45:41

one

8:45:44

got it guys yes or no I think you are

8:45:47

getting it and you are able to get this

8:45:49

particular thing this particular part

8:45:51

now let's try to understand that how you

8:45:53

can download this model in your local so

8:45:55

for that there is a certain step so let

8:45:58

me write it down those particular step

8:46:00

and step by step we'll try to understand

8:46:02

how we can create a pipeline and how we

8:46:04

can in download this model in our local

8:46:07

is whatever model we want to use it we

8:46:09

can download it now for that uh I will

8:46:12

have have to perform some sort of a step

8:46:14

so here uh let me write it down the

8:46:16

heading uh here guys this is the heading

8:46:18

uh basically just a second uh let me

8:46:21

copy and paste um so here what I'm going

8:46:23

to do here I'm going to do a text uh

8:46:25

here I'm writing text generation model

8:46:26

decoder only model so now I will use the

8:46:28

decoder only model any model where I I

8:46:31

will just have a decoder so what I'm

8:46:33

going to do here so the first thing

8:46:34

again I'm going to create a prompt so

8:46:36

there's my prompt a same prompt I'm

8:46:38

going to use or maybe I written a

8:46:39

different prompt over here can you tell

8:46:41

me a famous fitw footballer so here I I

8:46:44

will give the name so I I can remove

8:46:46

this famous from here and see the prompt

8:46:48

over here that what is my prompt so here

8:46:50

I'm asking that can you tell me uh about

8:46:52

a footballer can you tell me about the

8:46:54

footballer and here I will just give the

8:46:56

name so this is what this is my prompt

8:46:58

actually now what I will do guys here I

8:47:00

will create a chain now in the chain uh

8:47:03

what I'm going to do so just a

8:47:07

[Music]

8:47:09

second fine so here uh let me do one

8:47:12

thing for first of all so here I'm going

8:47:13

to import some sort of a library

8:47:15

otherwise I will get the issues I will

8:47:17

get the error so here I'm going to

8:47:19

import a few libraries so these are the

8:47:22

name so these are the name hugging face

8:47:24

pipeline which I'm going to import from

8:47:26

the lenen itself actually this is

8:47:28

available in a like if you are directly

8:47:30

installing the hugging phas hugging face

8:47:32

have in your system in your local

8:47:33

environment so by using the Transformer

8:47:36

also you can import this hugging face

8:47:38

hugging face pipeline but as I told you

8:47:40

this Len CH is a wrapper on top of this

8:47:42

uh apis on top of this libraries so by

8:47:45

using this lenon also you can use this

8:47:47

hunging face pipeline now what is the

8:47:49

meaning of the rapper so uh you know

8:47:51

right so tensor flow so this Kass

8:47:54

actually it's a repper on top of the

8:47:55

tensor flow if you have seen the Kass so

8:47:57

there you must have seen that uh like we

8:48:00

are just going to call a Kass Dot and

8:48:02

pipeline we are just going to write it

8:48:04

down Kass ad and we are creating a

8:48:06

number of note and then kasas or this

8:48:08

that whatever so in back end this T the

8:48:11

tens code is running but on top of this

8:48:14

T tensor flow they have created one UI

8:48:17

or they have created one interface now

8:48:19

you are not interacting directly with a

8:48:21

lowlevel API low level code you're not

8:48:23

going to write it down that instead of

8:48:25

that what you are going to do you are

8:48:26

using the rapper Kass so it is easy to

8:48:28

use for you so similarly see the similar

8:48:31

thing you can see over here this Len is

8:48:33

nothing it is a wrapper on top of the

8:48:34

other apis okay on top of the other

8:48:37

packages so over here you can see uh

8:48:40

like I need to import this particular

8:48:42

thing so the first thing I'm going to

8:48:43

import that is a like Pipeline and the

8:48:46

second thing which I'm going to import

8:48:47

that is a auto tokenizer auto model uh

8:48:50

for uh casual LM Pipeline and auto model

8:48:53

for sequence to sequence llm I will come

8:48:55

to each and every import statement uh

8:48:57

once I will write on the code step by

8:48:59

step I will try to explain you that why

8:49:01

I writing this a particular thing right

8:49:04

now here what I'm going to do I'm going

8:49:05

to download the model the same model in

8:49:08

the local instead of using this API I'm

8:49:10

downloading the same model in my local

8:49:12

local memory in my current uh memory in

8:49:14

my volatile Ram actually so here what

8:49:17

I'm going to do first of all I need to

8:49:19

mention the model ID now model ID wise

8:49:21

you will find out like I'm using a same

8:49:23

model FL T5 large and this is a model

8:49:27

from the Google side Google has given

8:49:28

this model this particular model fly T5

8:49:30

large so this is what this is my model

8:49:32

ID from where you will get a model ID

8:49:34

you just need to click on the model name

8:49:36

and from there itself you can copy this

8:49:38

model ID so let's say I want to get a

8:49:40

model ID so just copy from here just

8:49:43

copy from here copy model name to the

8:49:45

clipboard that's it so here's what here

8:49:48

I'm having a model ID now guys what you

8:49:50

want to do so here actually you need to

8:49:52

uh like create a like a the object of

8:49:56

this tokenizer and here actually you

8:49:58

need to create one uh here you need to

8:50:01

here you need to call one method from

8:50:03

tokenizer it's a standard processor if

8:50:05

you want to use this hugging face

8:50:07

pipeline so uh at the first place you

8:50:09

will have to perform the tokenization

8:50:11

and uh here I'm going to do a same thing

8:50:13

so whatever data which I'm going to pass

8:50:15

right so this tokenizer will

8:50:16

automatically uh take care of it and

8:50:19

back end actually some mathematical like

8:50:22

like some mathematical equations and all

8:50:24

it's going on uh maybe like with respect

8:50:26

to the tokenization uh you know like

8:50:28

different different tokenization

8:50:29

technique what is the meaning of the

8:50:30

tokenization so whatever prompt you have

8:50:33

that a text prompt actually are going to

8:50:34

convert into a numbers so that is

8:50:36

nothing that is my uh token means like

8:50:40

uh the in a numbers itself so that is

8:50:42

what that is your encoded value so by

8:50:44

using this Auto encod auto tokenizer you

8:50:47

are going to do the same thing you are

8:50:48

going to encode the values got it yes or

8:50:51

no I think you are getting my point so

8:50:53

here uh you are going to use this Auto

8:50:56

tokenizer and here I'm going to call

8:50:59

this particular method so from uh model

8:51:02

ID from pre-train from pre-train and

8:51:04

this is what this is my method and here

8:51:06

I'm passing this model idid so now what

8:51:08

I'm going to do I'm going to keep this

8:51:10

particular thing inside the variable the

8:51:11

variable name is going to be a tokenizer

8:51:14

so here is what here is my variable name

8:51:16

so once I will run it now over here you

8:51:18

can see we are able to create a object

8:51:20

and we are able to call this particular

8:51:22

method by passing this model ID now what

8:51:25

I will do guys so here uh I will uh I

8:51:29

will uh like uh call I will call this

8:51:32

particular method let me show you the

8:51:34

next one it's a standard procedure don't

8:51:36

worry again I will give you the quick

8:51:37

revision first of all let me run it the

8:51:39

entire thing now over here I'm writing

8:51:41

down Auto model for sequence to sequence

8:51:43

LM and here I'm I'm calling this method

8:51:46

from pre-train and here is what my model

8:51:49

ID and here is device map is auto right

8:51:51

just just like a like ignore this

8:51:53

particular parameter just look into this

8:51:55

model ID so here actually I'm passing

8:51:57

this model ID Google fly T5 large so

8:52:00

this model this is my model actually

8:52:02

which I want to which I want to get so

8:52:04

here I have a method Auto model here is

8:52:07

I'm basically Class Auto model for

8:52:09

sequence to sequence LM and from here

8:52:12

I'm going to call this from pre-rain

8:52:14

this particular method I'm passing this

8:52:16

parameter model ID parameter now if I

8:52:19

run it so here you will be able to see

8:52:21

that we are able to run it so here we

8:52:23

have created a object for this one also

8:52:26

now guys the next thing what I have to

8:52:27

do so here actually I'm going to create

8:52:29

my pipeline so uh here uh I'm going to

8:52:32

create my Pipeline and for this one uh I

8:52:35

have written a code so this is a code

8:52:38

this is what is my pipeline here I

8:52:39

already imported it now here I'm going

8:52:41

to pass the key text to text generation

8:52:43

here is my model this is what this is my

8:52:45

model now here is what here is a

8:52:47

tokenizer this is a tokenizer and here

8:52:49

is a max length so you can remove it you

8:52:51

can uh remove the max length also not an

8:52:53

issue with that so here uh I'm going to

8:52:55

create my pipeline so for first thing

8:52:57

what I need to do I need to create a

8:52:58

tokenizer and the second thing I need to

8:53:00

create a model I need to download the

8:53:02

model see uh first time if you will

8:53:05

download this model now you will get the

8:53:07

uh the progress bar I'm not getting it

8:53:09

why why because I I did it actually I

8:53:12

was practicing with the thing so at that

8:53:14

time I downloaded this I downloaded that

8:53:17

particular model and this tokenizer and

8:53:19

it is in a buffer itself so it is it is

8:53:22

like taking from the caching memory so

8:53:23

that's why you are not seeing this that

8:53:25

particular progress bar but in your case

8:53:27

if you're doing first time you will see

8:53:28

the progress bar you will see the prog

8:53:31

progress bar okay so here you are going

8:53:33

to create a pipeline so this is what

8:53:35

this is my Pipeline and here I passed

8:53:37

the two thing the first one is a key

8:53:39

text to text generation this is my key

8:53:41

and here uh is what here I have written

8:53:43

the model and here is my tokenizer

8:53:45

that's it you just need to focus on this

8:53:46

two part now here I'm going to create a

8:53:49

pipeline so this is what guys this is my

8:53:50

pipeline now after that what I'm going

8:53:52

to do I have to pass this particular

8:53:54

pipeline to my hugging phase Pipeline

8:53:57

and here actually you will find out this

8:53:58

is what this is my local llm means see

8:54:02

what I'm going to do so this is my model

8:54:04

this is my tokenizer which I'm going to

8:54:06

download from the pre-train one from the

8:54:08

pre-train one and this is the model ID

8:54:10

the same uh tokenizer

8:54:12

which has been used to this particular

8:54:14

model from the pre-train see I'm calling

8:54:15

this method so here is my tokenizer and

8:54:18

here is my model from this particular ID

8:54:20

I'm not getting any progress bar why

8:54:22

because I already did it it is taking

8:54:23

from a cachia memory okay but if you are

8:54:26

doing it first time you will be getting

8:54:28

a progress bar and you will be seeing

8:54:29

that all the parameters getting

8:54:31

installed over here right got it now

8:54:33

here what I need to do I need to keep

8:54:35

all the thing in a pipeline and then

8:54:36

finally I'm passing it to the hugging

8:54:38

face Pipeline and this is what this is

8:54:40

my local llm now everything is done

8:54:42

everything is clear now let me run this

8:54:44

prompt so here is what here is my prompt

8:54:47

so what I can do let me keep this prompt

8:54:50

over here this is my prompt and here

8:54:53

this is my prompt and this is what this

8:54:55

is my local llm now let me run it and

8:54:57

here what I will do guys so now uh let

8:55:00

me call the chain and to the chain I'm

8:55:03

going to do a same thing what I'm going

8:55:04

to do guys tell me to the chain actually

8:55:06

see what is a chain I told you chain is

8:55:08

nothing it's a it's a like a collection

8:55:11

of of the components right you are going

8:55:13

to uh you are going to you are you are

8:55:16

stacking the components a different

8:55:18

different component have you seen the

8:55:19

chain right so uh there I was stacking

8:55:22

the llm and this prompt so I'm doing the

8:55:24

same thing now see the power of the Len

8:55:26

chain not even with the open AI we are

8:55:28

able to use it with the different

8:55:30

different apis with the hugging face

8:55:31

also directly and even in the with uh

8:55:35

with respect to the local one also with

8:55:36

respect to the local LM also so it works

8:55:39

with in every scenario this lenion works

8:55:41

with every scenario okay now here if I'm

8:55:44

going to run it uh so now I I'm able to

8:55:46

create this chain now if I will ask

8:55:48

anything to this chain so let me write

8:55:50

it down over here chain do run now here

8:55:53

what I'm going to do here I'm going to

8:55:54

pass let's say Messi okay Messi now if I

8:55:57

will run it so you will find out that it

8:55:59

is generating a answer so Messi is a

8:56:02

footballer from Argentina and I just

8:56:04

asked what I asked guys so here I asked

8:56:07

what was my prompt can you tell me about

8:56:09

footballer so here is a name name which

8:56:11

I'm passing now let me write it down

8:56:14

some any Indian Indian like footballer

8:56:17

name so Sunil

8:56:19

Chri so let's see uh what will be the

8:56:24

answer it is able to get it or not sonil

8:56:28

chetri uh okay Sunil chetri born 24th

8:56:31

August 1971 it's a former Indian Indian

8:56:34

footballer who played up forward so

8:56:37

great guys it is able to give me an

8:56:38

answer and here you can see I have

8:56:40

installed I downloaded the model in a

8:56:42

local itself so tell me guys this part

8:56:45

is clear to all of you how to use the

8:56:47

hugging face API by using the lenen and

8:56:50

how to download the model and how to use

8:56:52

it please do let me know in the chat if

8:56:55

this part is getting clear to of all of

8:56:57

you so yes this is the number of tokens

8:56:59

max length So within that itself within

8:57:01

uh it is not going to exceed the answer

8:57:04

and this is the max length basically it

8:57:05

will be uh within that itself you will

8:57:08

be getting an

8:57:10

output

8:57:13

tell me guys fast so is it clear to all

8:57:15

of you if this part is clear then please

8:57:17

do let me know please hit the like

8:57:19

button and uh yes if you have any sort

8:57:22

of a doubt then you can ask

8:57:26

me you can ask about the vat kohi you

8:57:28

can check over here so here you can

8:57:31

write it down the vat kohi even though

8:57:33

he's not a footballer let's see what

8:57:34

will be the answer it depends on the

8:57:36

model our GPT model is very much uh

8:57:38

powerful let's see uh this uh Flame T5

8:57:47

large so okay so I'm getting verat kohi

8:57:52

is a s linkan footballer who plays it is

8:57:54

completely wrong now you can see so it

8:57:57

is uh not giving me a correct answer

8:58:00

let's try to design a different prompt

8:58:01

over here so here I can uh do that let

8:58:04

me this let me design one more prompt

8:58:06

and can you tell me about cricketer so

8:58:09

here I can write it down cricketer c r i

8:58:12

c k uh cricket so this is the spelling

8:58:16

now let me take this thing and here is

8:58:19

going to be my chain two this is my

8:58:22

chain two and this is my prompt two and

8:58:24

I'm using a same llm over here so this

8:58:26

is my chain two now what I will do here

8:58:30

I'm going to run it and let's see will I

8:58:32

will I get a correct information or not

8:58:35

will this model is capable or not this

8:58:37

uh which is a name what is the name

8:58:40

flame T5 large so let's see it is a

8:58:42

capable or not so chain two. run and uh

8:58:46

if I'm running it

8:58:50

so in the district of balut prad is

8:58:53

giving me a wrong answer I think uh

8:58:56

cricketer Koh he does not belong from

8:58:59

the bhalpur it belong he belong or not I

8:59:01

don't know about it let's uh talk about

8:59:03

the suchin uh let's talk about the sain

8:59:06

or Ms D so here I can ask about the MS

8:59:13

Tony chain. run and let's see who play

8:59:18

the Indian Premier League site Mumbai

8:59:21

okay it is saying mson plays a cricket

8:59:23

from the Indian Premier League from

8:59:25

Mumbai Indian so it is like a completely

8:59:28

it is giving a wrong answer this flain

8:59:30

T5 so you should use a different model

8:59:33

in that case actually see GPD is a

8:59:35

better one it always gives a correct

8:59:37

answer and and is like a much more

8:59:39

capable that's why I started from the

8:59:40

open a and that's why I didn't started

8:59:42

from the hugging page but yeah according

8:59:44

to the task according to data according

8:59:45

to requirement so now that will be your

8:59:48

responsibility as an NLP engineer as a

8:59:50

generative engineer you have to check

8:59:52

you have to like check with a model that

8:59:54

uh like on which data it has been

8:59:56

trained okay on which data has been fine

8:59:58

tuned how many parameters is there what

9:00:00

is a performance performance of that if

9:00:03

uh like uh we are doing a text

9:00:04

generation that what is a blue score

9:00:06

like blue score with that we can

9:00:08

identify the uh that like how much it is

9:00:10

capable for generating a text so each

9:00:12

and everything you will have to read

9:00:14

about the model and then only you can

9:00:16

use in a production not directly so

9:00:18

there will be so many uh like uh uh uh

9:00:22

there will be so many experiment which

9:00:24

you will have to

9:00:26

perform okay there will be so many back

9:00:28

and forth you will have to perform

9:00:29

before deciding any sort of a model and

9:00:32

here I have given you the approach guys

9:00:34

here you can append the memory here you

9:00:36

can play with the chains here you can uh

9:00:38

like play with a different different

9:00:40

prom template you can download the

9:00:41

document you can import the document

9:00:43

each and everything I have shown you

9:00:45

inside this two notebook now you are

9:00:47

enough capable to implement uh for

9:00:49

implementing any sort of a project now

9:00:51

whatever project I'm going to teach you

9:00:53

definitely you will be able to grab it

9:00:55

and uh I will uh after the like jupyter

9:00:58

notebook implementation of the project I

9:01:00

will uh explain you that how you can

9:01:02

convert into an end to endend one so uh

9:01:04

from next class onwards we are going to

9:01:07

start our Inn project by using this Len

9:01:09

chain open ey hugging fish and all and

9:01:11

apart from that we are going to use some

9:01:13

other thing as well and I will show you

9:01:15

the complete setup of the project the

9:01:17

project name is going to be McQ

9:01:20

generator got it yes or

9:01:23

no yes you can fine tune the model as

9:01:26

well if you want like if you want to

9:01:28

find uh if you want the process of the

9:01:30

fine tuning I will give you that also I

9:01:32

will give you the fine tuning process

9:01:34

also just wait for some time step by

9:01:36

step we try to do each and everything if

9:01:38

I'm going to explain you everything in a

9:01:40

single class so it might be a difficult

9:01:42

for you so uh step by step we'll try to

9:01:45

do it don't worry we are not going to

9:01:48

like conclude or we are not going to

9:01:50

step stop this community session uh like

9:01:52

uh we'll be continue this uh like in

9:01:54

know next week also and there uh we

9:01:57

going to talk about

9:02:00

many you can use uh like which open stes

9:02:04

model you can use for the machine

9:02:05

translation you can check over here just

9:02:07

go through with the hugging phase API

9:02:10

and click on the model model uh just uh

9:02:12

click on the model and here you will get

9:02:14

the machine translation so maybe machine

9:02:17

translation is there classification

9:02:19

question answering yeah here is a

9:02:20

translation so just see the model what

9:02:23

all models is there just try to use this

9:02:25

particular model open source model apart

9:02:27

from that you'll find out other model as

9:02:29

well so see llama 2 is a open source

9:02:31

model you will find out a different

9:02:32

different variants of this llama you'll

9:02:34

find out a different different variants

9:02:36

of this llama okay so you can use this

9:02:38

llama 2 model for your image translation

9:02:41

as I click on this translation here you

9:02:43

can see the result got it now you can do

9:02:46

your own research you can go through

9:02:47

with the different different API as I

9:02:49

told you if you don't want to use the

9:02:50

chat GPT so here I have created one more

9:02:53

API for all of you so like I have

9:02:56

written a code regarding one more API

9:02:57

that's going to be a AI 21 lab so in the

9:03:00

next class I will show you means after

9:03:01

the project actually after completing

9:03:03

the vector databases and all I will come

9:03:05

to some Mis mous topic there I will show

9:03:07

you the code regarding this a21 lab okay

9:03:10

so here actually uh like we'll talk

9:03:13

about the Jurassic model uh which is a

9:03:15

very powerful model with that also you

9:03:17

can do a multiple thing Falcon is there

9:03:19

you can use the Falcon so Falcon you

9:03:21

will find out here itself you know uh

9:03:23

let me show you where is a falcon so

9:03:25

once you will search over here Falcon so

9:03:28

it's a model from the Google yeah uh no

9:03:31

it's a not of Google one it's a not of

9:03:34

Google model actually it's a model from

9:03:36

this particular

9:03:38

organization I think it's a Chinese

9:03:40

organization maybe and one more model

9:03:43

let me write it on the name Falcon let

9:03:46

me recall the name Falcon was there

9:03:49

Bloom is there uh let me check with the

9:03:51

bloom yeah Bloom is there and apart from

9:03:54

that farm is also there p a LM Palm is

9:03:58

also there it is not actually you won't

9:04:01

be able to find out this pal over here

9:04:03

uh you uh you will have to access it

9:04:05

from the separate API so it's a Google

9:04:08

model pal p a l m 2

9:04:11

Palm 2 API just search over the Google

9:04:13

and you will find out it this Palm

9:04:16

API so it's a uh model from the Google

9:04:20

research Google researcher it's a model

9:04:22

from the Google community so you can

9:04:24

explore about the API and you can

9:04:26

utilize this all you can see generate

9:04:28

your API key just generate a API key and

9:04:30

try to use this form model as well and

9:04:33

after like so many back in fors after so

9:04:35

many research and all then only you can

9:04:38

decide that which is which is my best

9:04:39

model which one I should which one

9:04:41

should I productionize this is working

9:04:43

fine or that is working fine but gpd1 is

9:04:46

a like trusted one and here you we can

9:04:48

you can see the clear application of the

9:04:50

GPD model where they are using GPD 3.5

9:04:53

turbo and GPD 4 itself so many people

9:04:55

are using the GPI even though it is a

9:04:57

paid one but people are checking with

9:05:00

the other open source model as well like

9:05:02

this Palm Falcon Bloom and all okay

9:05:04

Cloud a is one of the model you can

9:05:06

check about the cloud as well so I think

9:05:10

now uh each and every uh thing is clear

9:05:12

to all of you so guys if you're liking

9:05:15

the session if you uh like the content

9:05:17

then please do let me know in the chat

9:05:19

or please hit the like button if you are

9:05:22

able to understand everything whatever I

9:05:24

have explained you in today's

9:05:28

session here I will explain you how to

9:05:30

build the applications and all and from

9:05:32

next uh class onwards I will give you

9:05:34

the different different assignments

9:05:39

also

9:05:41

yes we can use the mlops tools now like

9:05:43

we'll do the development now in between

9:05:45

we can use any mlops tools ml flow we

9:05:48

can use ml flow DBC or Q flow we can use

9:05:51

the uh like other melops tools like

9:05:53

Docker and all don't worry regarding

9:05:56

that so once I will come to come to the

9:05:59

development there I will uh do

9:06:05

that okay great now yeah jimin also come

9:06:08

you can check with that also recently

9:06:10

Google has released the

9:06:15

gemin fine so I think uh now we can uh

9:06:19

close the session uh now we'll meet on

9:06:22

Friday uh Saturday and Sunday we don't

9:06:24

have any session uh the session is going

9:06:26

to be from Monday to Friday only and the

9:06:29

timing is 3: to 5: p.m. IST so let me

9:06:32

write it down over here uh Saturday

9:06:34

Sunday we don't have any session

9:06:37

Saturday and Sunday there won't be any

9:06:40

session

9:06:43

s session will be

9:06:47

continuing

9:06:49

continuing uh from Monday

9:06:53

onwards Monday onwards and the timing

9:06:56

will be timing will be

9:06:58

sa so it's going to be from 3:

9:07:01

to 5 p.m. ISD so here guys it's a short

9:07:06

notice for all of you uh we don't have

9:07:09

any session on Saturday and Sunday day

9:07:11

the session will be going on uh from

9:07:13

Monday to Friday only and the timing

9:07:15

will be same 3 to5

9:07:17

istd fine I think

9:07:21

uh I have finished the data loader topic

9:07:24

uh if you will check into this uh this

9:07:27

particular notebook already I have uh uh

9:07:30

like shown you this data loader and all

9:07:32

now I told you now just try to check

9:07:33

with the different different data

9:07:34

loaders and all CSV tsv Excel or

9:07:38

whatsoever just go and check you can do

9:07:40

it by using the documentation but here I

9:07:43

given you the example of the to data of

9:07:45

this document loader so I have imported

9:07:48

this uh PDF I think you missed the

9:07:51

previous sess that's why you are asking

9:07:53

this question fine so I think uh we can

9:07:56

start with the session so welcome back

9:07:58

to this community session of generative

9:08:00

AI uh this is day six and today we going

9:08:04

to start with our first end to end

9:08:06

project that's going to be a McQ

9:08:08

generator so guys uh this is this is our

9:08:11

first uh like end to end project which

9:08:13

we are going to implement by using this

9:08:16

generative AI uh by using the LMS and

9:08:19

all and in this particular project we'll

9:08:21

try to use the all the concept basically

9:08:24

whatever we have learned so far in our

9:08:26

course in our committee session so first

9:08:29

of all uh let me show you that uh where

9:08:31

you will find out all the session all

9:08:34

the uh resources and all because we have

9:08:36

updated each and everything over the

9:08:38

dashboard and each and everything you

9:08:41

will find out uh in the uh resource

9:08:44

section so let me show you that uh

9:08:47

particular thing and for that guys you

9:08:50

just need to visit the Inon website and

9:08:53

after visiting the website you need to

9:08:55

search about the generative AI so search

9:08:57

about the generative Ai and there you

9:08:59

will find out two dashboard so first One

9:09:03

dashboard for the English and One

9:09:05

dashboard for the Hindi so yes I'm

9:09:07

taking a same session on my on the I on

9:09:11

Hindi YouTube channel as well so you can

9:09:13

search ion Tech Hindi so there I'm

9:09:15

taking a same session and uh there also

9:09:18

I'm uh explaining the concept of the

9:09:20

generative a and all so guys here what

9:09:23

you need to do here you need to click on

9:09:25

this particular dashboard generative AI

9:09:27

Community session and once you will

9:09:30

click on that so it will ask you for the

9:09:32

enrollment and here we are not going to

9:09:35

charge you anything any cost so if you

9:09:37

are new then please do sign up and then

9:09:40

uh try to enroll in this particular

9:09:42

course now here guys uh just enroll to

9:09:46

this particular course and after that

9:09:48

you will be redirected uh redirecting to

9:09:51

the dashboard so after sign in you will

9:09:53

get a dashboard uh here you can see this

9:09:56

is uh this is a complete dashboard uh

9:09:59

just a second let me show you

9:10:02

that this is the one so this is the this

9:10:05

is the dashboard guys and here you will

9:10:06

find out all the recording so uh so far

9:10:10

I took five session day one day two day

9:10:13

three day four day five and in this

9:10:16

particular session I covered each and

9:10:18

everything regarding the generative AI

9:10:20

whatever uh is required if you want to

9:10:22

start with the projects and all so uh

9:10:25

just go through with the very first

9:10:27

session there you will find out complete

9:10:30

introduction and in the second one so in

9:10:33

the second session uh there I have

9:10:35

discussed each and everything about the

9:10:36

open Ai and in the third session I have

9:10:39

discussed about the Len chin and then I

9:10:42

talked about the a few more concept like

9:10:45

Len chain memory and all even I have

9:10:47

discussed about the hugging face API so

9:10:50

if you want to use any open source model

9:10:53

if you don't want to use a model from

9:10:55

the open AI so uh you can access the

9:10:58

model from the hugging phase also that

9:11:00

thing also I taught you so if you will

9:11:02

go through with my session each and

9:11:04

everything you will find out now it's

9:11:06

time to implement the project so we'll

9:11:08

try to implement a project and and the

9:11:10

project is going to be end to endend and

9:11:13

not even single so uh not even this

9:11:16

project so we are going to implement to

9:11:18

more project with a few more advanced

9:11:21

concept like vector databases and there

9:11:24

will discuss about the r and there we

9:11:27

are going to create our web API by using

9:11:30

the fast API and flast so each and

9:11:33

everything we are going to do here

9:11:35

itself in a live session so please make

9:11:37

sure that you enroll uh for this

9:11:40

particular dashboard and please try to

9:11:42

check with the ion YouTube channel as

9:11:44

well there we are uploading each and

9:11:46

every video so once you will search over

9:11:50

the Inon so let me show you that so uh

9:11:52

first of all you need to open your uh

9:11:54

open your YouTube and there search about

9:11:57

the uh Inon so here you can see so open

9:12:02

the Inon YouTube channel and inside that

9:12:04

uh like uh there you'll find out one

9:12:06

live section so just click on this live

9:12:09

section and you will find out all the

9:12:12

recordings so here you will find out all

9:12:14

the recording from day one to day five

9:12:17

and uh today I'm uh teaching a project

9:12:19

it's a day six and uh if you will open

9:12:22

any sort of a video so here in the

9:12:24

description also you will find out each

9:12:26

and every detail so here you will find

9:12:28

out a course detail here you find out

9:12:30

each and every detail basically whatever

9:12:32

is required so please make sure that uh

9:12:35

like you are enrolling to the dashboard

9:12:36

for the entire resources and all and yes

9:12:39

recorded video is available over the

9:12:40

Inon YouTube channel as well got it so I

9:12:44

think uh this is fine this is clear now

9:12:47

let's start with the project so as you

9:12:49

have seen the uh the topic uh so the

9:12:52

topic is what topic is the project name

9:12:55

is what the project name is a McQ

9:12:56

generator using open Ai and langen chain

9:12:59

now why I took this a particular project

9:13:02

because see uh we have learned each and

9:13:04

everything we have learned each and

9:13:05

every concept so far related to the open

9:13:08

API related to The Lang chain now how we

9:13:10

can utilize those information until we

9:13:13

are not going to implement the project

9:13:16

so in that case we won't be utiliz that

9:13:18

particular information whatever we have

9:13:20

learned even we won't we won't be able

9:13:23

to relate those thing with a real time

9:13:25

thing so that's why I kept this project

9:13:27

for all of you in between and then we'll

9:13:30

try to move into some Advanced concept

9:13:33

like databases and all and we'll try to

9:13:35

create a few more a few more project in

9:13:38

our upcoming session but yeah so here uh

9:13:41

we are going to start from the very

9:13:43

basic project and then we'll go to the

9:13:45

advanced label got it now what all thing

9:13:49

I'm going to discuss in today's class in

9:13:51

today's session along with the project

9:13:53

so here I will teach you the entire

9:13:55

setup of the project so here uh we are

9:13:58

not going to implement this project in a

9:13:59

jupyter notebook so for that we are

9:14:01

going to create a complete development

9:14:04

environment so I will show you how you

9:14:06

can create a like and to and development

9:14:08

environment and then we'll try to deploy

9:14:10

this project as well so in tomorrow's

9:14:12

session I will show you how you can

9:14:14

deploy this project along with the cicd

9:14:17

concept along with the continuous

9:14:18

integration and continuous deployment

9:14:20

concept so in today's session we'll try

9:14:22

to see that how we can set up our uh

9:14:25

development environment and then uh

9:14:27

we'll try to uh implement the Jupiter

9:14:30

notebook regarding a different different

9:14:31

application and then we'll try to

9:14:33

convert that jupyter notebook into a

9:14:36

endtoend application got it yes or no so

9:14:39

the agenda is clear to all of you please

9:14:42

uh do let me know in the

9:14:44

chat yes or

9:15:09

no

9:15:14

great so I think uh we can start and uh

9:15:17

yeah if you are liking the session then

9:15:19

please hit the like button and uh keep

9:15:22

watching so guys uh the first of all let

9:15:24

me write it down each and everything

9:15:26

each and every step uh whatever we are

9:15:28

going to do here and whatever uh we'll

9:15:30

be doing throughout the session so for

9:15:33

that uh I'm using my Blackboard and here

9:15:35

itself I'm going to write it down the

9:15:37

each and everything so first of of all

9:15:40

let me remove it and yes uh I have

9:15:43

opened the fresh one now let me write it

9:15:45

down each and everything uh regarding

9:15:48

today's session so guys see the first uh

9:15:50

thing which we're going to do uh that is

9:15:53

uh environment setup so at the first

9:15:56

place uh we're going to uh set up our uh

9:15:59

environment our development environment

9:16:02

I will show you the complete a project

9:16:04

setup so here let me write it down so

9:16:06

setup development environment so the

9:16:10

first thing which we're going to do uh

9:16:11

we going to set the development

9:16:13

environment now after that what I will

9:16:15

do after setting the development

9:16:17

environment then uh we'll try to uh run

9:16:21

a few experiments run few experiments uh

9:16:25

few experiment in a Jupiter notebook so

9:16:28

we we'll run a few experiment in a

9:16:31

Jupiter notebook after that we'll create

9:16:33

a end to end will'll create a modular

9:16:36

coding like by using this particular

9:16:38

experiment and all so I will do a like

9:16:41

modular coding I will create a several

9:16:43

file and then I will uh try to segregate

9:16:45

the code so uh after uh doing a few

9:16:49

experiment in a Jupiter notebook I will

9:16:51

convert this jupyter notebook into a

9:16:53

modular

9:16:55

one got it modular coding now after that

9:16:59

after uh converting to a model one

9:17:01

Modular One definitely uh like uh uh my

9:17:04

code will be uh my code will be uh ready

9:17:08

and then I will create my web API then I

9:17:10

will create my web API by using the

9:17:13

stream lid so here by using the stream

9:17:15

lid I will be using I will be creating

9:17:17

my web API and after uh creating this

9:17:20

web API definitely for sure I will test

9:17:22

it and finally we'll try to deploy our

9:17:26

application on my cloud platform in my

9:17:28

AWS or aor got it so these are few step

9:17:32

uh these are the these are few things uh

9:17:35

uh basically which we're going to

9:17:36

perform uh regarding this particular

9:17:38

project so today uh I will be uh cover

9:17:41

this two point the first one second one

9:17:43

and maybe the third one and tomorrow I

9:17:45

will create a web API because we have a

9:17:48

time restriction the session is just for

9:17:50

the 2 hour otherwise I can complete this

9:17:53

thing within a uh class itself so today

9:17:56

I'm going to complete this two thing and

9:17:59

tomorrow uh I will be converting uh the

9:18:01

entire code in a modular one and then uh

9:18:04

we are going to create a web API and

9:18:06

finally we're going to deploy the

9:18:08

application got it now after that now

9:18:11

after that what uh we are going to learn

9:18:13

so after completing this thing we're

9:18:15

going to learn about the vector

9:18:17

databases we'll try to learn a vector

9:18:19

databases we'll try to see that what all

9:18:22

options we have if we want to store the

9:18:24

embedding not even the vector databases

9:18:27

what all other options we have so we'll

9:18:29

try to explore about the mongodb

9:18:32

cassendra and we'll try to look into the

9:18:34

SQL base database also and then finally

9:18:37

uh we'll look into the vector databases

9:18:39

different different options we have and

9:18:41

then uh we'll try to use the RG concept

9:18:44

on top of that and we'll create a few

9:18:46

more project so yes uh from today's

9:18:50

onwards our project journey is going to

9:18:52

be start so don't miss it and within 2

9:18:54

week uh our aim to complete at least

9:18:57

three and to end project in a live

9:18:59

session itself got it so I hope this

9:19:02

idea is clear to all of you now uh let's

9:19:05

start uh first uh with the project setup

9:19:08

so the implement impation the project

9:19:10

basically I'm going to implement in a

9:19:12

jupyter notebook so entire development

9:19:14

setup I'm going to create in my uh sorry

9:19:17

I'm going to create in my vs code so for

9:19:19

the entire development I'm going to use

9:19:21

my VSS code and today I will show you

9:19:23

how you can set up your vs code for the

9:19:26

end development got it so for that guys

9:19:29

uh what you need to do first open your

9:19:31

CMD uh uh Implement along with me

9:19:34

because uh I will share the GitHub link

9:19:36

with all of you so that you can uh write

9:19:39

it down the code you can copy each and

9:19:41

everything from there itself and along

9:19:43

with the uh code I will I will be

9:19:45

writing all the commands and uh all

9:19:47

whatever I'm going to use in my uh in my

9:19:50

project so in my project setup and all

9:19:52

so each and everything I will be uh I

9:19:54

will be writing in my GitHub U I will be

9:19:56

writing in my readme file and then I

9:19:58

will give you uh through my GitHub link

9:20:01

so guys uh you can follow uh uh each and

9:20:03

everything along with me so uh first let

9:20:05

me start from the project setup so uh

9:20:09

here here guys uh first of all what you

9:20:11

need to do so in any directory in C

9:20:13

directory in D directory in whatever

9:20:15

folder you need to create uh one folder

9:20:18

you need to create one fresh folder okay

9:20:21

so go in uh go with any directory C

9:20:23

drive uh C directory D directory C drive

9:20:26

D drive e Drive and inside that you need

9:20:29

to create one folder so here you can see

9:20:31

this is my location C user sunny and

9:20:34

here I'm going to create my folder one

9:20:37

fresh folder so for create a folder

9:20:40

there's a command like mkdir by using

9:20:43

this particular command I can create a

9:20:45

folder so here I'm going to write it

9:20:47

down mqd and my project name so let's

9:20:50

say my project name is what McQ

9:20:53

generator so this is the like uh this is

9:20:55

the folder name which I have written now

9:20:58

uh yes I have created my folder now what

9:21:00

I need to do I need to move into my

9:21:02

folder now I need to change the

9:21:04

directory so here I need to move into my

9:21:06

folder I need to change the directory so

9:21:07

for that we have a command like CD CD

9:21:11

McQ generator this is my folder name now

9:21:14

you can see I'm into my folder now I'm

9:21:17

inside my folder and from this

9:21:19

particular folder I need to launch my vs

9:21:21

code so for launching the vs code from

9:21:24

the command promp there is a command the

9:21:26

command is called code dot code space

9:21:29

dot so once you will write it down on

9:21:31

this particular command code space dot

9:21:34

so in that case you will be able to

9:21:36

launch your jupyter notebook in a

9:21:38

current for folder right so here is my

9:21:41

folder name my folder name is what my

9:21:42

folder name is McQ now here you can see

9:21:45

I'm able to launch my j i I'm able to

9:21:48

launch my vs code inside this particular

9:21:51

folder now if you want to verify so for

9:21:53

that what you can do you can go with

9:21:55

your terminal so just click on the new

9:21:57

terminal and here you will find out the

9:21:59

same location which you are seeing over

9:22:02

the command prompt so guys here you can

9:22:04

see you are into the same location which

9:22:07

you were seeing over the command prom

9:22:09

got it now let's say uh if you don't

9:22:11

have this vs code so from there you can

9:22:13

install this vs code so for that you

9:22:16

just need to go through the Google just

9:22:18

search over the Google just search about

9:22:19

the google.com and here write it down vs

9:22:22

code download so write it down here vs

9:22:25

code download so you will get a link for

9:22:27

downloading the vs code and here uh this

9:22:30

is the link guys I'm giving you this

9:22:32

particular link inside the chat and here

9:22:35

uh like you can go through with this

9:22:37

particular link and you can download the

9:22:39

vs code according to your operting

9:22:41

system so if you are using Mac uh so you

9:22:44

can download from here if you are using

9:22:47

the Linux so from uh for the Linux you

9:22:49

can download from here if you're using

9:22:51

Windows so for the windows you can

9:22:52

download from here you will find out all

9:22:55

the three option for a different

9:22:57

different operating system now uh once

9:22:59

you are done uh uh like with the

9:23:01

download and all so after that what you

9:23:03

need to do so after that you need to

9:23:05

install it so just try to do a double

9:23:06

click and install this vs code in inside

9:23:09

your system and then you can follow the

9:23:12

same procedure so you can create a

9:23:14

directory you can uh write it down this

9:23:16

first and then you can change the

9:23:18

directory and from on that particular

9:23:20

directory you can launch the vs code got

9:23:23

it now if you not able to do it by using

9:23:25

this command line so by using uh by

9:23:28

using the UI also you can do the same

9:23:30

thing so for that uh just uh go inside

9:23:33

your directory and here create a new

9:23:35

folder so create a new folder and then

9:23:38

do the right click and check with the

9:23:40

show more option and here you will find

9:23:42

out option for launching this vs code so

9:23:46

by using this uh GUI also you can do a

9:23:49

same thing and by using the command prom

9:23:51

also you can do a same thing so I took

9:23:53

this command promt approach and here you

9:23:55

can see I'm able to launch my VSS code

9:23:59

inside this particular folder so if you

9:24:02

are done till here so please do let me

9:24:04

know in the chat please uh tell me guys

9:24:07

if uh you are done till here

9:24:09

tell me first have you opened your vs

9:24:13

code in a folder if you did it then

9:24:15

please write it on the chat

9:24:31

yes yeah I'm waiting for 1 minute so

9:24:34

until you can open

9:24:38

it

9:24:53

yeah you can use the pyam

9:24:56

also uh not an issue with that py Cham

9:24:59

will also work any ID so here I'm using

9:25:01

this vs

9:25:04

code okay so I think uh now everyone is

9:25:08

done so so let's start with a further

9:25:11

step so after opening this vs code so F

9:25:13

the first thing uh the first thing which

9:25:15

you need to do you need to initialize

9:25:17

the git so here guys uh what you need to

9:25:20

do you need to initialize the git so uh

9:25:22

here see we have a uh like a various

9:25:25

option here once you will click on this

9:25:26

drop- down so here you will find out of

9:25:29

various option like Power Cell G bash

9:25:31

command prom Ubuntu Kali so in your case

9:25:34

it there might be only G bash command

9:25:36

prompt or Powershell but in my case here

9:25:39

you will find here you can see I have a

9:25:41

different different terminal right but

9:25:42

maybe in your case you just have this

9:25:44

git bash and command prom that's that's

9:25:46

all fine right so either you can work

9:25:48

with this G bash or you can work with

9:25:50

the command prom but don't work with

9:25:51

this poers shell because otherwise

9:25:53

unnecessarily you will get uh uh errors

9:25:55

and all so I won't recommend you to uh

9:25:58

work with this poers shell and all so if

9:26:00

you want to work uh with the like with

9:26:03

the terminal so here either use this git

9:26:06

bash or this command Pro don't select

9:26:08

this Powershell so here I'm using this

9:26:10

git bash so here I can easily run my uh

9:26:14

like Linux command also so yes uh if you

9:26:18

don't want to use this git bash so you

9:26:20

can use this command prom also that is

9:26:22

also fine now guys here uh you'll find

9:26:24

out that okay so this is what this is my

9:26:27

G bash now uh here if you are not able

9:26:29

to see the base environment so for that

9:26:32

what you need to do so just try to click

9:26:34

on this View and go with the command

9:26:36

pellet so here you need to go uh you

9:26:38

need to click on The View and click on

9:26:40

the command PL and then select python

9:26:43

interpreter so here you will find out

9:26:45

various interpreter so you need to

9:26:47

select this base interpreter and after

9:26:49

that you need to relaunch this git bash

9:26:51

so in that case uh if if you are not

9:26:54

getting that base environment in your uh

9:26:57

G bad so after uh like following this

9:27:00

step uh definitely you will be able to

9:27:02

see that so here now you can see I have

9:27:05

a Bas environment on my good bash now uh

9:27:07

let me uh let me run the further thing

9:27:10

so the first thing what you need to do

9:27:12

over here like so the first thing you

9:27:14

need to initialize the git right so

9:27:16

inside this directory you need to

9:27:18

initialize the git so for initializing

9:27:21

the git I just need to write it down a

9:27:23

simple command that is what that is git

9:27:25

in it so by using this particular

9:27:27

command I can initialize the git in my

9:27:29

current folder in my local folder so now

9:27:32

this local folder will be treated as a

9:27:34

local repository and then I can uh I can

9:27:38

upload this same folder on my uh GitHub

9:27:42

and yes like that's going to be my

9:27:45

central representing so GitHub is going

9:27:46

to my central repository and as of now

9:27:49

if I'm going to initialize the git in my

9:27:51

local folder so this is what this is my

9:27:52

local repository each and every thing

9:27:55

each and every track actually I'm going

9:27:56

to keep it keep over here itself in my

9:27:59

local folder so that uh like the entire

9:28:02

data you will find out inside the dogit

9:28:04

folder I will show you that so here you

9:28:06

need to write it down this git in it so

9:28:08

once you will write down this g in it uh

9:28:10

so you will be able to initialize the

9:28:11

git inside this particular folder okay

9:28:15

now uh here you can create a file so

9:28:17

here I'm going to create my readme file

9:28:19

so r e a d MD so

9:28:23

readme.md so it's going to be a markdown

9:28:25

file MD means what it's be it's it's a

9:28:28

markdown file so here uh guys you can

9:28:30

see I created my markdown file right now

9:28:34

uh if I want to publish see as of now

9:28:36

see if you will look into this

9:28:37

particular folder so let me reveal it

9:28:39

inside the file explorer so just try to

9:28:41

click uh do the right click on this file

9:28:43

and reveal in the file explorer so here

9:28:46

you will find out this dogit and here

9:28:49

you will find out each and every

9:28:51

information so because of this dogit

9:28:53

folder actually uh this a local folder

9:28:56

is being treated as a local repository

9:28:58

now here you will find out each and

9:29:00

every metadata so regarding your commits

9:29:02

and all so whatever codes you are going

9:29:04

to upload whatever like changes you are

9:29:06

going to made and all right whatever uh

9:29:09

changes you are going to commit and add

9:29:11

so each and every metadata you will find

9:29:13

out inside this dogit folder and why we

9:29:17

use this uh git guys tell me we use this

9:29:19

git for the code versioning got it I

9:29:22

think uh you have a basic idea about the

9:29:24

git so I'm not going into the depth of

9:29:27

this git and all as of I'm just like

9:29:29

giving you the uh the high level

9:29:31

overview that's it now here uh you can

9:29:34

see I have create I have initialized the

9:29:36

git and here you can see this do git

9:29:38

folder inside my uh dogit folder inside

9:29:41

my local repository so is it fine to all

9:29:44

of you I think yes now what I can do

9:29:47

here so here I can publish the branch so

9:29:49

I can publish the this local repository

9:29:52

to my GitHub so for that what you can do

9:29:54

see you can use this uh terminal also

9:29:58

and here this vs code has given you the

9:30:00

GUI option so just click on that just

9:30:02

click on this particular option and here

9:30:05

you will find out uh the various thing

9:30:08

right so uh here you will find out the

9:30:11

various options and all now let me show

9:30:13

you step by step so the first thing what

9:30:15

you need to do so first you need to add

9:30:17

your file so for adding the file you

9:30:19

just need to click on this plus icon so

9:30:22

uh if you want to add the file uh so for

9:30:25

that you need to click on this plus icon

9:30:27

and after that uh like you need to uh

9:30:29

write it on the message so you write

9:30:31

down now that first you run this git in

9:30:33

it and then you run this git ad git ad

9:30:36

and the file name so I'm doing the same

9:30:38

thing over here so by using this plus

9:30:40

icon I'm adding this particular file

9:30:42

right so uh in my uh like staging area

9:30:46

right so and then I will do the commit

9:30:48

after writing a message so here I'm

9:30:49

writing down writing the message uh this

9:30:51

is my first commit so here uh my

9:30:54

messages this is my first commit now

9:30:57

after writing the message what I will do

9:30:59

I will commit it after committing is uh

9:31:02

after committing uh it okay so it will

9:31:04

ask to me would you like to publish this

9:31:06

Branch so I would say yes I would I want

9:31:08

to publish this particular Branch so

9:31:10

here it is asking to me how you would

9:31:13

like to publish it so whether uh as a

9:31:15

private repository or as a public

9:31:17

repository is going to publish over the

9:31:19

GitHub actually so here it is asking to

9:31:22

me how You' like to publish it whether

9:31:24

as a private repository or as a public

9:31:26

repository so as of now I'm going to

9:31:28

publish publish this particular Branch

9:31:30

as a public repository so you can click

9:31:32

on this public repository and yes it

9:31:35

will publish a branch so it is uploading

9:31:37

all the file here you can see and then

9:31:40

it will give you this a particular popup

9:31:42

so here it is telling you that please

9:31:44

sign in with your browser so once I will

9:31:46

uh click on this uh sign in with your

9:31:48

browser so yes it is uh doing that and

9:31:53

uh just wait it is publishing the branch

9:31:57

so it has given me uh this particular

9:32:01

page now let let me authorize it so here

9:32:04

I need to click on this confirm and

9:32:07

after that guys you can can see

9:32:08

authentication succeed so now uh my

9:32:12

branch is uh published let me show you

9:32:15

that so here you can see you can open it

9:32:18

and this is guys this is my Branch okay

9:32:21

so I published this branch on my GitHub

9:32:23

so I hope this thing is uh clear to all

9:32:26

of you and you are able to publish your

9:32:29

branch yes or no guys tell me are you

9:32:33

able to publish your branch um just a

9:32:37

second great so now let me give you this

9:32:39

particular link and so that whatever

9:32:42

code and all I'm going to write it down

9:32:44

so directly you can copy and paste from

9:32:46

here itself from my git so let me give

9:32:49

you this uh particular uh link uh so

9:32:53

that you can copy each and everything

9:32:55

from here itself just a second so did

9:32:58

you get it please uh do let me know in

9:33:01

the chat if you got my

9:33:03

code tell me guys fast sorry if you got

9:33:06

if you got my link then uh please do let

9:33:08

me know in the chat again I'm pasting uh

9:33:11

this particular link so this is my

9:33:13

GitHub link

9:33:17

guys yes please do confirm if you got my

9:33:21

GitHub I given you the GitHub

9:33:33

guys yes or no I am waiting for a reply

9:33:42

please check it check with the popup so

9:33:44

first you need to sign in through the

9:33:45

browser and then only you will be able

9:33:48

to log in if you're not able to follow

9:33:50

this GUI approach uh in that case uh

9:33:53

what you can do so you can uh like uh

9:33:57

push it through the command line

9:34:07

also

9:34:11

yeah if you are not able to log in so

9:34:12

through this uh command line you can uh

9:34:15

configure the username and the uh like

9:34:18

email ID so for that there is a like

9:34:21

command so let me show you that

9:34:22

particular Command right just a second

9:34:25

so what I can do I can show you over

9:34:27

here itself uh so you can search over

9:34:29

the Google how to configure how to

9:34:33

configure get uh username so you can

9:34:38

search over the Google and then you will

9:34:40

get a command so let me give you those

9:34:42

particular command if you are not able

9:34:44

to uh sign in but please make sure that

9:34:46

if you're getting the popup then then

9:34:48

directly you can sign in but if you're

9:34:50

getting any sort of error right so for

9:34:52

that there is a command so get config

9:34:54

hyphen global hyph iph global user.name

9:34:58

and here you need to pass your username

9:35:01

so like whatever username you have so

9:35:03

you just need to pass your username and

9:35:05

then you need to pass the you need to

9:35:07

configure the email also so okay so here

9:35:10

uh for the username and in a similar way

9:35:12

you need to configure the uh you need to

9:35:15

configure the email so let me give you

9:35:17

this uh two command now here let me

9:35:20

write it down that you need to write it

9:35:22

down your your

9:35:24

username

9:35:27

your user

9:35:30

name and here is a command guys so first

9:35:33

try to configure your username and here

9:35:35

again I'm giving you the same command

9:35:37

along with the username you can

9:35:39

configure your email also so let me

9:35:42

write it on the email and in the double

9:35:45

code actually you need to pass your

9:35:47

email so here your email ID so guys uh

9:35:52

run this two commands on your uh on your

9:35:55

uh command line actually and then you

9:35:57

will be able to sign in from here itself

9:36:00

got it yes or no till here uh everything

9:36:03

is fine everything is clear I given you

9:36:06

the GitHub Link in the chat so so um you

9:36:08

can click on that and you can uh like

9:36:11

you can check with my repository each

9:36:12

and everything I'm going to update over

9:36:14

there itself so that uh you can copy and

9:36:17

paste the code directly from there now

9:36:19

guys uh here uh if you're not able to

9:36:21

find out uh if you're not able to click

9:36:23

on this link so you can search uh with

9:36:26

my username also so or over the Google

9:36:29

you can write it down s Savita GitHub

9:36:31

you will get the GitHub directly it will

9:36:32

give you the link link of the GitHub and

9:36:35

this repository is a public repository

9:36:37

so Direct you can go through with my

9:36:39

repository and you will find out this

9:36:41

particular project got

9:36:43

it great yes uh from the same terminal

9:36:46

you need to configure your username and

9:36:49

email ID okay now here we have published

9:36:53

uh this code as a uh like to my GitHub

9:36:57

right this this particular repository

9:36:59

this a local repository I publish to my

9:37:01

GitHub now I need to follow few more

9:37:03

step for setting up my environment so

9:37:06

the next thing what I need to do here I

9:37:08

need to create my environment because

9:37:10

I'm not going to work in my base

9:37:12

environment and I'm going to create a

9:37:14

virtual environment over here okay so

9:37:17

for creating a virtual environment there

9:37:19

is very a simple command so let me write

9:37:21

it down on that command so cond condu

9:37:24

create condu create hyphen P okay hyphen

9:37:29

p and here you need to write it on the

9:37:31

environment name so here my environment

9:37:33

name is going to be en EnV en EnV and

9:37:36

then you can write down the python

9:37:38

version python is equal to 3.8 so I'm

9:37:41

using over here 3.8 and then hyphen y so

9:37:44

this is my command uh which I'm going to

9:37:46

run and by using this particular command

9:37:49

I can create the environment in a

9:37:51

current directory itself in a current

9:37:53

repository so here you can see this is

9:37:56

what this is my environment uh which is

9:37:58

being created so just wait for some time

9:38:00

it will take uh few second let it create

9:38:04

so my environment name is what my

9:38:06

environment name is ENB

9:38:08

now here my environment is getting

9:38:11

created and it is done now after that

9:38:14

what I need to do guys so here I need to

9:38:16

activate my environment so for

9:38:17

activating the environment you need to

9:38:19

write it down Source activate if you are

9:38:21

using this git terminal so in that case

9:38:23

instead of this cond you can write down

9:38:25

this Source because sometimes this cond

9:38:28

gives issue so I'm not going with this

9:38:30

cond here so I'm using this source of

9:38:32

over here so you need to write it down

9:38:34

the source activate activate and here

9:38:37

Dot dot means current directory and from

9:38:39

this current directory there is a folder

9:38:41

folder name is environment e andv right

9:38:44

so here you can see I'm able to activate

9:38:47

my environment and here you can see this

9:38:49

is what this is my virtual environment

9:38:51

got it now let me clear it first of all

9:38:54

so here now you can see it is giving me

9:38:56

a uh like uh it is giving me a how it is

9:38:59

giving me so many files uh for adding

9:39:01

right so U like here it is giving me

9:39:04

more than 5,000 file but I cannot like

9:39:07

add all all the files I cannot like add

9:39:10

all the files on my GitHub right so for

9:39:12

that what I will do if I want if I don't

9:39:14

want to track it if I don't want to

9:39:15

track this particular file so I can U

9:39:17

mention this name this EnV name in in

9:39:20

the file the file name is what the file

9:39:21

name is dog ignore so here let me create

9:39:24

one more file in this uh particular

9:39:26

directory and my file name is what my

9:39:29

file name is uh dogit ignore so here I'm

9:39:32

writing this uh dot get ignore uh and

9:39:34

the touch command is the touch command

9:39:36

for creating a file so touch dog ignore

9:39:40

now here you can see I'm able to create

9:39:42

this particular file this dog ignore now

9:39:45

inside this file you can mention the

9:39:48

name the name of whatever file which you

9:39:51

don't want to drag so here if I don't

9:39:54

want to track this EnV folder right if

9:39:57

you don't want to track these many file

9:40:00

if I don't want to upload it in my cloud

9:40:02

repository right or if I don't want to

9:40:05

track it uh by using this git so so you

9:40:07

can mention it you can mention this

9:40:09

folder name inside this dot inside this

9:40:13

dog ignore file so here I'm writing EnV

9:40:16

uh EnV is nothing it's a folder name now

9:40:19

once I return it once I return this uh

9:40:21

EnV inside this do G ignore now you can

9:40:24

see it is not going to track it at all

9:40:27

so here uh it is not going to track uh

9:40:29

this particular folder now and it is

9:40:32

giving you only it is giving me only one

9:40:34

file now yes I can uh add it so here uh

9:40:37

first I'm going to add this file get add

9:40:39

and this file name now here I'm writing

9:40:42

my message so I have added I added my

9:40:46

get ignore so this is my message and

9:40:49

after that what I will do after after

9:40:52

this after this one I'm going to commit

9:40:54

it so edit my get ignore and then do the

9:40:56

commit now uh you need to click on this

9:40:59

sync changes your and your changes will

9:41:01

be sync so the same file you will find

9:41:04

out the same file you will find out in

9:41:06

my G iub also so uh let me show you

9:41:10

where you will find out that let me open

9:41:12

my GitHub and uh here guys here is my

9:41:15

GitHub let me show you the

9:41:19

repository here is my all the

9:41:22

repository and this is the uh like

9:41:25

folder this is my like project actually

9:41:27

now see uh I just added this dot get

9:41:29

ignore now see see that uh commit just

9:41:32

now just now I committed uh this

9:41:35

particular file and here you can see my

9:41:37

dotg ignore now once you will open it so

9:41:40

here you will find out the folder name

9:41:41

so the folder name is what EnV so I

9:41:44

don't want to track this file throughout

9:41:46

my process right so I uh if I don't want

9:41:49

to track this file at all so yes uh for

9:41:52

that I will mention it inside my dog

9:41:54

ignore file got it now uh till here I

9:41:58

think everything is fine everything is

9:42:00

clear and I hope you are of you are able

9:42:03

to follow me till here so please do let

9:42:07

me know in the chat guys if uh uh

9:42:10

everything is clear everything is fine

9:42:11

till here what about 3.9 yes you can use

9:42:14

3.9 3.10 as well but don't use 3.11 3.12

9:42:18

or 3.13 till 3.9 and 10 it's fine but

9:42:22

please make sure that uh uh please make

9:42:26

sure that you are going to use the same

9:42:27

version which I am using uh so you won't

9:42:30

face any sort of a issue any you won't

9:42:33

get any sort of error uh during the

9:42:35

implementation got it

9:42:38

yeah so if it is done then uh please do

9:42:41

let me know guys please write it on the

9:42:43

chat and uh please hit the like button

9:42:45

if you are liking the session

9:42:51

then done can I get a quick confirmation

9:42:54

in the

9:43:06

chat

9:43:14

great so I think uh now everyone is done

9:43:17

so here I have created my environment

9:43:20

now guys what you need to do so after

9:43:22

that you need to create your

9:43:23

requirement. txt so inside the

9:43:25

requirement. txt I'm going to mention

9:43:27

the entire requirement right so for

9:43:30

creating a requir txt so from here also

9:43:34

you can create by using this particular

9:43:36

icon other you can use the same command

9:43:39

same a touch command by using that

9:43:41

command also you can create the require.

9:43:43

txt in a current folder in a current

9:43:46

repository now uh for creating a requir

9:43:48

txt so I'm using this particular icon

9:43:51

and here I'm writing requirement R Qi r

9:43:55

m m n ts. txt now in this a particular

9:44:00

file I'm going to mention all the

9:44:02

requirement whatever requirement I'm

9:44:05

having regarding this project right so

9:44:08

I'm mentioning all the requirement

9:44:10

inside this require. txt so guys uh let

9:44:13

me copy and paste all the requirement or

9:44:16

whatever is there all I'm going to write

9:44:18

it down here itself so the first thing

9:44:20

which I'm going to use uh in my project

9:44:22

that's going to be a open a so I'm using

9:44:25

the open a API and for that this open a

9:44:28

package is required already I shown you

9:44:30

how to use openi API how to install this

9:44:33

particular package because earlier we

9:44:35

also we have created the environment

9:44:37

and there also we have installed this

9:44:39

open AI if you have attended my previous

9:44:41

session then definitely you must be

9:44:43

aware about this particular thing now

9:44:46

here uh there's a open a now the second

9:44:48

thing which I need to uh install in my

9:44:51

local environment in my current virtual

9:44:53

environment that's going to be a len CH

9:44:55

so here guys let me write down the Lang

9:44:57

gen so you need to install the langen CH

9:44:59

in your current environment first thing

9:45:01

is open Ai and the second thing is what

9:45:03

the second thing is the Len chain the

9:45:05

third one uh which I'm going to write it

9:45:07

down over here that's going to be a

9:45:08

stream L because here I'm going to

9:45:10

create a API by using this stream l so

9:45:13

here I'm going to like install the

9:45:16

stream lit in my local uh like

9:45:19

environment in my current virtual

9:45:21

environment the second thing which I'm

9:45:23

going to be installed over here uh

9:45:25

that's going to be a python hy. ENB so I

9:45:29

will tell you what is the use of this

9:45:31

particular U like uh uh this particular

9:45:34

package python hyon do EnV so I'm going

9:45:38

to install this uh python hy. EnV

9:45:41

package and I will tell you what is a

9:45:44

use of this particular package and apart

9:45:46

from that I'm going to use I'm going to

9:45:48

download one more package that is going

9:45:50

to be a pi PDF so Pi PDF two so these

9:45:54

many thing I'm going to be install in my

9:45:57

current virtual environment okay and

9:46:00

apart from that I'm going to create

9:46:02

couple of more folder right couple of

9:46:04

more folder I'm going to create in my

9:46:07

local repository in my local folder so

9:46:10

uh couple of more uh files and folder

9:46:12

not only folder files also so here uh uh

9:46:15

requ txt is done now I'm going to create

9:46:18

one more file the file is going to be

9:46:20

setup uh setup uh setup.py file now why

9:46:25

we use this setup.py file we use the

9:46:27

setup.py file for installing a local

9:46:30

package local package in my virtual

9:46:33

environment if I want to install the

9:46:36

local package in my virtual environment

9:46:38

for that we use the setup.py file got it

9:46:42

so I created the setup.py file I created

9:46:44

the re. txt now let me create a one more

9:46:48

file so here I'm going to create so not

9:46:50

file actually I'm going to create one

9:46:52

folder here my folder name is going to

9:46:54

be SRC SRC means what SRC means source

9:46:57

code now inside the SRC I'm going to

9:47:00

create a one more folder and the folder

9:47:02

name is going to be so first of all let

9:47:04

me create a file inside this SRC the

9:47:06

file file name is going to be dot uh

9:47:09

sorry underscore

9:47:11

inore dopy so here inside this SRC

9:47:14

folder I'm going to create init file

9:47:17

okay init file I will tell you why we

9:47:19

create this init file inside the a

9:47:21

folder what is the requirement of that

9:47:23

and uh each and everything I will

9:47:25

explain you don't worry so here uh you

9:47:27

can see I've created this init file and

9:47:29

inside this inside this SRC folder

9:47:31

itself I'm going to create one more

9:47:33

folder the folder name is going to be

9:47:35

McQ itself so m McQ generator and this

9:47:38

is what this is my project so McQ

9:47:41

generator so this is what guys this McQ

9:47:44

generator is nothing it's my folder and

9:47:46

inside this also I'm going to create one

9:47:48

init file so here let me create the init

9:47:51

file inside uh this folder also so init

9:47:57

init.py so what I did guys tell me so

9:48:00

here if you will look into this uh if

9:48:02

you will uh let me reveal it inside the

9:48:04

file explorer and let me show you that

9:48:07

what I did so here uh just look into the

9:48:10

SRC folder so inside this SRC folder I

9:48:13

created two things first I created this

9:48:15

init file and the second one I created

9:48:18

the McQ

9:48:19

generator folder and whatever source

9:48:22

code whatever source code I'm going to

9:48:24

write it down throughout my project so

9:48:26

I'm I will be writing down here

9:48:28

itself apart from The jupyter Notebook

9:48:32

so each and every line of code modular

9:48:34

coding I will be doing over here itself

9:48:36

inside my McQ generator folder got it

9:48:41

now here uh what I did I created this

9:48:43

init file underscore uncore inore ncore

9:48:46

now what is the requirement of this init

9:48:48

file why I did it because see if I let's

9:48:51

say uh like here I want to consider this

9:48:55

folder this folder as a package as a

9:48:57

local package right this folder actually

9:49:00

I want to consider as a package now what

9:49:02

is the meaning of the package so the

9:49:04

package is nothing it's a it's a folder

9:49:06

itself folder which is containing a

9:49:09

multiple python file and inside the

9:49:11

python file you have a code you have a

9:49:13

code like a classes functions and all

9:49:16

right so you have a folder inside the

9:49:18

folder you have a file and inside the

9:49:20

file you have written a code right so

9:49:23

now guys see uh let's say if you're

9:49:24

installing pandas if you're installing

9:49:27

numai if you're installing maybe open a

9:49:29

or let's say if you're installing langen

9:49:31

so what is this tell me it's nothing

9:49:33

it's a full it's a package itself it's a

9:49:35

package now and package means what

9:49:36

package package nothing it's a folder

9:49:38

right folder is what F the package is

9:49:40

equal to folder right folder itself is

9:49:43

called a package now inside the package

9:49:45

or inside the folder what you will find

9:49:47

out inside that you'll be having a

9:49:48

multiple python files right and inside

9:49:51

those python file you uh someone has

9:49:53

written a code uh in terms of function

9:49:55

and classes and that is what uh that

9:49:57

only you are going to use right so this

9:50:01

uh lenen this open this pandas napai

9:50:05

someone already created it and they have

9:50:06

uploaded over the pii repository and

9:50:08

from there itself you are going to

9:50:10

install it inside your project but here

9:50:12

this McQ generator actually it is your

9:50:15

local package where you are going to

9:50:17

create a multiple folder mul multiple

9:50:19

python file and uh if you want to

9:50:22

treated if you want to treat this folder

9:50:25

as a package so for that there's a

9:50:26

convention from the python side you will

9:50:28

have to mention this init file inside

9:50:30

the folder right so here my folder is

9:50:33

what my folder name is SRC SRC means

9:50:35

what it's a short form of the source

9:50:37

code SRC now this SRC actually I want to

9:50:40

treat as my local package so there is a

9:50:43

convention from the python side you need

9:50:45

to mention this init file or you need to

9:50:46

create this init file inside this folder

9:50:50

then only it will be treated as a local

9:50:53

package I think the idea is clear now so

9:50:56

by using the setup.py file by using this

9:50:59

setup.py file I'm installing this local

9:51:02

package in my current virtual

9:51:04

environment got it I think now each and

9:51:07

everything is clear to all of you now

9:51:09

let me back to my code so here is what

9:51:12

here is my code so I created couple of a

9:51:15

folder couple of file now guys uh let me

9:51:18

create one more file uh like one more

9:51:21

folder over here and the folder name is

9:51:23

going to be experiment so here I'm going

9:51:25

to be create one more folder and the

9:51:28

folder name is going to be experiment

9:51:30

and inside this particular folder I'm

9:51:33

going to create my Jupiter notebook I'm

9:51:36

going to create my ipb file okay so for

9:51:39

creating ipb file inside this particular

9:51:42

folder so you can click on this folder

9:51:43

and click on this file icon and then you

9:51:46

can write down your name so here I can

9:51:49

uh write down the name any any name I

9:51:51

can write it down here let's say McQ dot

9:51:55

ipnb uh do

9:51:58

ipnb so what is the meaning of this

9:52:00

ipynb so ipynb means nothing uh I python

9:52:04

uh notebook okay that's the full form of

9:52:06

this IP YB now here you can see this is

9:52:09

what this is my jupyter notebook now

9:52:10

whatever experiments uh whatever experim

9:52:13

experiments will be there throughout

9:52:15

this project so I'm going to do my

9:52:17

entire experiment over here in my

9:52:19

Jupiter notebook and then I will convert

9:52:22

into an end code into my end to end

9:52:24

pipeline got it now here uh the first

9:52:27

thing what you need to do so you need to

9:52:29

select the kernel so just click on this

9:52:31

select kernel and then click on this

9:52:33

python environment then you will get all

9:52:35

the python environment so this is your

9:52:37

current virtual environment so this this

9:52:40

the this interpreter which you can see

9:52:41

over here the first place which is a

9:52:43

recommended one so this is from your

9:52:45

current virtual environment from the EnV

9:52:47

itself here you can see EnV python.exe

9:52:50

so here I'm going to select the same

9:52:52

kernel so here I have selected this

9:52:54

particular kernel now you can see uh I'm

9:52:57

done with everything now I just need to

9:53:00

uh I just need to like uh install the

9:53:03

recom txt I will start by writing the

9:53:06

code so let me give you this each and

9:53:08

every file and folder so for that I just

9:53:11

need to add it from here itself so I'm

9:53:13

going to add all the files and all over

9:53:17

here I think it is done now I will write

9:53:20

it on my uh like message so my message

9:53:23

is structure updated so here is what

9:53:26

here's my message guys now let me commit

9:53:29

it so structure s u c Tru structure

9:53:33

updated now I have written my message

9:53:35

after adding all the file

9:53:37

now once I will do the commit and it

9:53:39

will ask to my sync it will it will ask

9:53:41

to me would you like to sync changes so

9:53:44

yes I want to do it now I will click on

9:53:46

okay so as soon as I will click on okay

9:53:49

you will find out every file and folder

9:53:51

in my repository itself so now let me

9:53:54

show you uh every file and folder uh so

9:53:58

here guys you can see I have a

9:54:00

experiment folder now inside that there

9:54:02

is my file ipv file that's what this

9:54:05

this this file this particular file I'm

9:54:07

going to use for my entire experiments

9:54:10

and all and here you will find out my

9:54:12

SRC folder inside the SRC folder you

9:54:14

will find out the init file and one more

9:54:16

folder that is what that the McQ

9:54:18

generator and then you will find out

9:54:20

this setup.py also so here I have the

9:54:23

setup.py as of now you won't be able to

9:54:26

find out any sort of a code over here

9:54:28

but don't worry I will keep it uh inside

9:54:30

my setup.py file and here you can see my

9:54:33

require. txt so here I have mentioned

9:54:35

all the requirements got it now let me

9:54:39

uh give you this link to all of you so

9:54:42

I'm pasting this link inside the chat

9:54:44

and if you're not able to click on that

9:54:46

so you can search over the Google let me

9:54:48

search in front of you only so just go

9:54:51

through the Google and search Sun Savita

9:54:55

GitHub so once you will search it uh

9:54:57

then automatically you will get a GitHub

9:54:59

link just go through with the GitHub

9:55:00

link and here click on the repository so

9:55:03

here is a repository click on the

9:55:05

repository and the Very first project

9:55:07

this one McQ generator uh so just click

9:55:10

on this uh this particular project and I

9:55:12

have kept each and everything over here

9:55:14

itself inside one folder so if you are

9:55:17

done till here then please do let me

9:55:19

know in the

9:55:24

chat yes in my previous class I shown

9:55:26

you how to use hugging pH API Hub don't

9:55:30

worry uh after this project I will use

9:55:33

the open source model only I w't going

9:55:35

to use any

9:55:36

uh like any model from the openi itself

9:55:39

but yeah in today's project in the very

9:55:41

first project I'm going to use the openi

9:55:43

API along with the Len chain got

9:55:51

it tell me guys uh is it fine to all of

9:55:56

you are you able to create an

9:56:01

environment and uh did you publish

9:56:05

it

9:56:14

have you created a environment did you

9:56:16

created a GitHub um and sorry did you

9:56:19

initialize the a git basically and did

9:56:21

you publish your repository if

9:56:23

everything is done then uh please do let

9:56:25

me know guys I will uh move with a

9:56:27

further step so please uh write on the

9:56:30

chat if uh you are done till here then I

9:56:33

will proceed uh with the further

9:56:37

commands don't worry I will give you all

9:56:39

the thing all the commands and all in

9:56:41

our documented format so you won't face

9:56:44

any such issues at all or in a single uh

9:56:49

like go you can run like each and

9:56:51

everything don't worry I will give you

9:56:52

that first of all tell me uh if you are

9:56:54

able to do along with uh if you are able

9:56:57

to do till here if you are able to do

9:56:59

these many thing then uh please give me

9:57:01

a quick confirmation or if you are

9:57:02

comfortable till here please do let me

9:57:05

know

9:57:26

fine so I think uh we can proceed now so

9:57:30

uh here I have created uh you can see uh

9:57:33

I created uh many files and folder now

9:57:36

let me open this setup. py5 okay so here

9:57:39

I have opened my setup.py file and here

9:57:42

I'm going to write it down uh some sort

9:57:44

of a code so what I can do let me copy

9:57:47

the code uh there is only just one

9:57:49

function and here I pasted the code got

9:57:52

it now uh just look into the code so

9:57:55

what I have written over here so here I

9:57:57

have imported one uh statement uh the

9:58:01

statement is what the statement is a

9:58:03

find package so from setup tool I'm

9:58:05

going to import the find package and

9:58:08

here is what here is my setup here's my

9:58:10

method setup method now here I have

9:58:12

mentioned couple of thing uh so I'm

9:58:15

calling this particular method setup a

9:58:16

method and uh I have mentioned uh some

9:58:19

parameters so the first parameter is a

9:58:21

name so here I'm going to write down my

9:58:24

here I'm going to write down the name of

9:58:26

the package now here is a version

9:58:28

version of the package now here is the

9:58:30

author author is a sunny sun Savita

9:58:33

author email sunny. Savita a and here is

9:58:37

install requirement so these are the

9:58:38

package which is like required okay now

9:58:41

here is a package so find package so

9:58:43

once uh see uh this find package

9:58:46

actually this this particular method

9:58:47

only it is responsible for finding out

9:58:49

the local package for from your local

9:58:53

directory so wherever uh it is able to

9:58:56

find out this dot init file wherever it

9:58:59

is able to find out this dot init file

9:59:01

it will consider that folder as a

9:59:05

package got it now uh here you can see

9:59:09

so I have imported this thing find

9:59:11

package setup uh find package find

9:59:14

package and setup method and I have

9:59:15

written all like these many thing over

9:59:17

here right so this is the like name of

9:59:20

my package uh which I have written over

9:59:23

here right each and everything is clear

9:59:24

each and everything F now see guys if

9:59:27

you want to install this package so for

9:59:31

that there's a command the command is

9:59:33

PIP install package name right I think

9:59:36

you all agree so if you want to install

9:59:38

this particular package open a load Lang

9:59:41

Chen stream late python python. EnV P

9:59:45

PDF so for that there is a command the

9:59:48

command is PIP install and package name

9:59:50

if you want to install this re. txt so

9:59:53

for that there is a command the command

9:59:55

name is what the command name is PIP

9:59:57

install hyr re. txt right but if you

10:00:01

want to install this a local package

10:00:04

into your current virtual environment so

10:00:06

uh how we can do that so for that also

10:00:09

we have a command the command is what

10:00:11

the command is directly you can install

10:00:13

the setup.py file you can write it down

10:00:16

python setup.py install so in that case

10:00:20

it will install or it will download all

10:00:22

the current package from your folder

10:00:24

into the virtual environment got it

10:00:28

that's the first way the second way is

10:00:30

what so here you can write it down in

10:00:31

the requir of txc itself you can write

10:00:33

it down hyph e do

10:00:36

right so uh if you are writing this hyph

10:00:39

e dot so in that case it will search all

10:00:43

the local package all the local package

10:00:46

into your current directory into your uh

10:00:48

current folder and it will download or

10:00:51

it will install it inside your virtual

10:00:53

environment again I'm repeating see if

10:00:55

you want to install this particular

10:00:57

package so for that there is a command

10:00:59

pip install re. TX Pap install package

10:01:02

name if you want to install all the

10:01:04

package by using the re. TX XT so there

10:01:06

is a command pip install hyphen r. txt

10:01:09

got it now but see let's say if you want

10:01:11

to install this local package into your

10:01:14

virtual environment so how you can do

10:01:16

that so for that you have two ways the

10:01:19

first one python setup.py install if you

10:01:22

running this command so definitely you

10:01:24

will be able to install it the second

10:01:26

one is what the second one is you can

10:01:28

mention this hyphen e dot inside your

10:01:30

record. txt so automatically it will

10:01:33

search this it will search out the

10:01:35

packages into your current folder into

10:01:38

your current repository and it will

10:01:40

execute the setup.py in backend got it

10:01:44

great now what I'm going to do here I'm

10:01:46

going to be install this require. txt

10:01:49

and so for first of all let me show you

10:01:51

that what all packages we have inside

10:01:53

the current virtual environment so if I

10:01:55

will write it on the PIP list uh so here

10:01:58

you will find out that we just have this

10:02:00

three packages three to four packages

10:02:02

into my current virtual environment how

10:02:05

many packages this guys three to four

10:02:06

packages only right which comes uh by uh

10:02:09

which is a by default only which comes

10:02:11

uh along with the environment itself

10:02:13

whenever we are going to create an

10:02:14

environment now if I want to install all

10:02:17

these packages into my current virtual

10:02:19

environment so how we can do that so uh

10:02:22

if I want to like run this re. txt so

10:02:24

how we can do that so for that there is

10:02:26

a command let me write down the command

10:02:28

pip install hyr requirement. txt so pip

10:02:34

install hyphen R re txt so once I will

10:02:37

hit enter so here you can see my all the

10:02:39

packages is getting installed into my

10:02:42

current environment so just wait for

10:02:44

some time uh it is getting installed and

10:02:47

uh it will take some time uh tell me

10:02:50

guys are you doing a with

10:02:53

me yes you can use it uh if you want to

10:02:56

make a mini project so definitely you

10:02:58

can use it and even you can create it uh

10:03:01

here itself and you can showcase as a

10:03:03

mini

10:03:04

project tomorrow we are going to deploy

10:03:07

it also after creating a web API and

10:03:09

then uh by using the advanced concept we

10:03:12

are going to create one more application

10:03:15

so how's the session so far uh did you

10:03:17

like the

10:03:26

session tell me guys uh did you like the

10:03:29

session did you like the U like

10:03:34

content

10:03:46

if you're liking the session then please

10:03:48

hit the like

10:04:04

button

10:04:09

yeah still it is installing so it will

10:04:11

take some time I'll let it

10:04:34

install

10:04:45

yes you can go through with my GitHub

10:04:46

link so here is my GitHub link just wait

10:04:48

I'm giving you

10:05:04

that

10:05:22

still it is downloading

10:05:25

uh I think we should wait

10:05:34

more

10:05:48

yeah I think now it is done so uh first

10:05:51

of all let me clear the screen and uh

10:05:54

here uh you will find out that it has

10:05:57

created one folder uh the folder name is

10:06:00

what McQ

10:06:02

generator. eggy info so so it has

10:06:06

created one folder and this folder

10:06:08

actually uh it is having the entire

10:06:11

information regarding your local package

10:06:13

so you can visit and you can check with

10:06:15

the different different files over here

10:06:17

so this is the package information

10:06:19

metadata version this one this is the P

10:06:22

package version right this is the

10:06:24

package name author is sunny and author

10:06:26

email ID reir txt so these are are these

10:06:30

all are the requirements actually right

10:06:32

along with the packages now you will

10:06:33

find out all the like details inside

10:06:36

this particular folder the folder name

10:06:38

is what McQ generator. ayen info it has

10:06:43

created a various file inside that which

10:06:45

is keeping all the or which is uh like

10:06:48

uh keeping all the like meta information

10:06:51

regarding your project got it I hope uh

10:06:55

this thing is clear to all of you now uh

10:06:58

what I can do uh first of all let me

10:07:00

close all the files from here now let me

10:07:03

open my app IP VV file and here what I'm

10:07:07

going to do here I'm going to here I'm

10:07:09

going to like uh run

10:07:13

my uh like import statement so what I

10:07:16

can do I can run import OS so here I'm

10:07:19

going to write import OS import Json

10:07:23

import Os Os means what opening system

10:07:26

and here I'm writing import Json import

10:07:30

Json now here I writing import pandas as

10:07:34

PD pandas as PD and here let's say I'm

10:07:38

writing import Trace bag so these are a

10:07:41

few uh uh like a few packages basically

10:07:46

which I imported over here now if I want

10:07:48

to run it now if I want to run this

10:07:50

particular cell so for that I just need

10:07:52

to press shift plus enter right just

10:07:55

press shift plus enter and you will be

10:07:57

able to run it now as soon as you will

10:08:00

run it it will ask you would you like to

10:08:01

install the IPI kernel yes I want to

10:08:04

install it because without that I won't

10:08:06

be able to execute this particular

10:08:09

notebook so here you need to click on

10:08:11

the install and my IPython kernel ipy

10:08:14

kernel is getting installed guys so it

10:08:17

will take uh some time so let it install

10:08:19

and then I will explain you the further

10:08:21

thing further

10:08:24

concept I given you the GitHub Link in

10:08:27

the chat uh you can search over the

10:08:30

GitHub uh sorry you can search over the

10:08:32

Google s with the GitHub and then you

10:08:34

will get the GitHub link my GitHub link

10:08:36

and check with the very first repository

10:08:38

very first project that is the McQ

10:08:39

generator itself the project name the

10:08:42

folder name is same McQ generator here

10:08:44

you can see this one McQ generator just

10:08:46

search over the Google Sun Savita

10:08:50

GitHub so here you can see my ipy kernel

10:08:54

is getting installed so let it install

10:08:56

and after that I will write it on my

10:08:58

further code and uh let I will show you

10:09:01

uh further concept as well uh regarding

10:09:04

this um and entire project

10:09:34

okay

10:10:07

yeah so now it is done and here you can

10:10:09

see uh we are able to import this a

10:10:13

particular statement import Os Os means

10:10:15

operating system Json pandas and

10:10:18

traceback also now guys here what you

10:10:21

need to do the next uh import statement

10:10:24

which I'm going to write it down over

10:10:25

here which is going to be a opena itself

10:10:28

so here I'm going to use the Len chain

10:10:31

and by using the Len chain I'm going to

10:10:33

import this chat over open API right

10:10:36

because I want to access the open API

10:10:39

and by using this particular method only

10:10:42

I'll be able to access the open a API

10:10:44

now let me run it so it's the same

10:10:46

method it's the same method which I have

10:10:48

shown you in my previous classes so

10:10:51

there I was using the lenin. llm opena

10:10:54

now in the recent version in the updated

10:10:56

version they have given you one more

10:10:58

method it's a similar one only it's

10:11:00

updated one and which is doing the same

10:11:02

thing uh like like the previous one like

10:11:05

the open a method and the method name is

10:11:07

what the method name is chat open AI so

10:11:10

yes uh we are able to import this method

10:11:13

and now what I need to do so uh actually

10:11:16

we this is a this is not a method this

10:11:17

is a class so here what I'm going to do

10:11:19

I'm going to create a object of this

10:11:21

particular class now so for that let me

10:11:23

copy it and let me paste it over here so

10:11:26

this is going to my llm so by using this

10:11:29

particular uh method itself I will be

10:11:31

able to call my open API and I will be

10:11:34

able to collect the llm model inside my

10:11:37

llm variable right so for that I need to

10:11:40

mention couple of uh couple of parameter

10:11:43

so here I'm going to mention few

10:11:45

parameter let me do it over here so

10:11:47

these are the parameter guys which I

10:11:49

have mentioned over here so the first

10:11:51

parameter is going to be open a API key

10:11:54

and here basically I need to mention the

10:11:56

key key of the open a open API now after

10:12:00

that uh there is a model name so here

10:12:03

I'm going to use gpt3 .5 turbo model and

10:12:06

then uh I I I have created one more

10:12:09

parameter I I'm going to write down one

10:12:11

more parameter that is going to be a

10:12:12

temperature you know what is the meaning

10:12:14

of temperature so here I'm going to set

10:12:15

the value 0.5 so between 0 to two you

10:12:18

can mention any value of the temperature

10:12:21

so what is the meaning of that the

10:12:23

meaning is nothing meaning is very very

10:12:24

simple you are going to like you want to

10:12:27

create a model if you are mentioning uh

10:12:29

like if you're mentioning the value near

10:12:31

to two right so the range is from 0 to

10:12:35

two if you are mentioning the value near

10:12:36

to two this will be more creative if the

10:12:38

value is will be near to zero so the

10:12:40

model will be less creative it will give

10:12:42

you the state forward answer that's it

10:12:44

now here guys this key will be required

10:12:48

this open AI key will be required how we

10:12:51

can get the open key I shown you how to

10:12:54

generate open key in my previous classes

10:12:57

right again I'm not going to show you

10:12:58

that now here actually I'm going to

10:13:01

collect my openi key but this time I'm

10:13:04

not going to paste it directly over here

10:13:06

instead of that what I'm going to do I'm

10:13:09

going to use my OS module so here what

10:13:12

I'm going to write it down I'm going to

10:13:13

write it down this a particular uh

10:13:16

method I'm going to call this os. get

10:13:19

environment method that uh os. get

10:13:22

environment key method so here I'm going

10:13:24

to call this os. getv and here uh this

10:13:29

is what this is my environment variable

10:13:32

so what I can do guys I can create uh

10:13:34

environment variable I can create one

10:13:36

environment variable into my uh Windows

10:13:39

environment variable and I can read it I

10:13:42

can read my key from there okay I can

10:13:45

read my key from there the second way I

10:13:47

can export it temporarily right so here

10:13:50

I can U on my uh terminal itself I can

10:13:54

write it down

10:13:56

export and here I can mention this a

10:13:58

variable name open API key and I can

10:14:01

pass the value in that case also I will

10:14:03

be able to read it the third Third Way

10:14:05

is there the Third Way is like you can

10:14:07

create your EnV file right you can

10:14:10

create your local environment file and

10:14:12

there inside that particular file

10:14:14

whatever a variable is required whatever

10:14:16

important variable is there you can keep

10:14:18

it over there itself right the first one

10:14:20

is a global approach uh Global means

10:14:22

what so here if you are going to search

10:14:24

environment variable in your windows

10:14:26

search box so you will get the uh you

10:14:29

will get the uh environment variable all

10:14:32

the list of the environment variable

10:14:34

here you can see right so you will get

10:14:36

the list of the environment variable

10:14:38

this one right this one now here you can

10:14:40

see I I created one key and I keept it

10:14:43

over here so from there also I can read

10:14:45

it from there also I can read it by

10:14:47

writing a same thing I I just need to

10:14:49

mention the key the key name over here

10:14:52

the second way the second way is a

10:14:53

temporary way temporary way means you

10:14:55

can export the key over here Itself by

10:14:58

using the export command you just need

10:15:00

to write down the export and here you

10:15:02

can mention the variable name and you

10:15:03

can pass the value of that particular

10:15:06

variable that's the second way now the

10:15:08

Third Way is what here you can create

10:15:11

EnV file so EnV file in your local

10:15:14

repository itself so no need to create

10:15:17

any sort of a variable in your

10:15:18

environment variable here itself inside

10:15:21

this EnV file itself you can keep your

10:15:24

all the variable all your secret

10:15:26

variable and by using the same command

10:15:29

you can read it so that is the third way

10:15:31

so I'm going to select the third way the

10:15:33

third option so here I'm going to create

10:15:35

the EnV file okay so EnV file uh so this

10:15:40

is what this my EnV file and inside this

10:15:42

EnV file I'm going to keep my key so I'm

10:15:46

going to write down the key value and

10:15:48

the variable name is going to be a same

10:15:50

so let me copy the variable from here

10:15:52

the variable is going to be open AI API

10:15:55

key and let me keep the variable over

10:15:57

here and here I I'm going to write down

10:15:59

the value of this particular key so in

10:16:02

the double code actually I'm going to

10:16:03

write down the value

10:16:05

so let me paste my key over here I

10:16:07

already generated it uh I believe you

10:16:10

know how to generate the key so let me

10:16:12

copy and paste it over here so this is

10:16:14

what guys this is my key which I already

10:16:16

generated now let me open my file and

10:16:19

here what I'm going to do I'm going to

10:16:21

read my value the value of this key so

10:16:25

you can treat this EnV file as your

10:16:28

local environment right so which you

10:16:31

have created inside the folder itself

10:16:33

and there you can keep your all the

10:16:35

secret variable right so now if I'm

10:16:37

going to run this OS os. G EnV now if I

10:16:40

will run this particular command now if

10:16:42

I'm going to print the key so here you

10:16:44

will find out my key value so here guys

10:16:47

uh here is what here is my key open a

10:16:50

key now let me show you and here it is

10:16:53

giving me none uh let me run it again

10:16:55

why it is not going to why it is not

10:16:58

getting it now let me show you it is

10:17:01

none wait guys let me restart the

10:17:03

terminal it happens in this vs code

10:17:06

actually sometimes I have seen but okay

10:17:09

so fine I forgot to do one thing uh why

10:17:12

I'm getting this none why I'm getting

10:17:15

this none because I need to load this

10:17:18

environment first all right so I need to

10:17:20

load this environment first and for that

10:17:23

uh I will have to import something see I

10:17:25

already written one module

10:17:28

python.

10:17:30

EnV right so here I have written the

10:17:32

module python hyen do T EnV let me show

10:17:35

you this module so here uh let me open

10:17:39

the Pi Pi first of all and here I can

10:17:41

show you the module uh just a

10:17:45

second Pi Pi now let me show you this

10:17:48

particular module python hy. EnV uh see

10:17:53

python. uh EnV reads key value pair from

10:17:57

a EnV file and can set them as a

10:18:00

environment variable right so it helps

10:18:03

in a development M or application uh

10:18:06

following the 12 Factor principle so

10:18:08

here you can read everything about it if

10:18:10

your application takes configuration

10:18:12

from the environment variable it's a 12

10:18:14

Factor application launching it in a

10:18:16

development it's not very practical

10:18:18

because you have to set those

10:18:19

environment variable yourself means you

10:18:21

will have to set the environment

10:18:22

variable in your local system um okay if

10:18:25

you don't want to do it you can create

10:18:27

the EnV folder in your local so that

10:18:29

will be your local environment file

10:18:31

local environment file itself which will

10:18:33

be available inside your local uh like

10:18:36

reposit itself in your local folder

10:18:38

itself got it now here the first thing

10:18:41

uh see first you need to import this

10:18:43

thing this from. EnV import load. EnV

10:18:47

and then you can you have to call this

10:18:50

uh particular method so what I'm going

10:18:52

to do here so I'm doing a same thing uh

10:18:55

where is my vs code here is my vs code

10:18:57

I'm going to do a same thing just a

10:18:59

second I'm going to load it uh I'm going

10:19:01

to load this uh EnV

10:19:04

so here from EnV this is my EnV file

10:19:08

from EnV I'm going to import a load. EnV

10:19:12

and here is what here is my method so as

10:19:14

soon as I will run it so here I will be

10:19:16

able to load my all the values from this

10:19:19

EnV file now let me run it h let's see

10:19:22

whe whether I'm getting the value or not

10:19:24

so it is saying this OS is not defined

10:19:26

so first of all let me import the OS

10:19:28

this is also fine this is also fine and

10:19:32

now each and everything is fine

10:19:34

now what I can do now I can call it and

10:19:37

let's see whether I'm getting my key or

10:19:39

not now see guys I'm able to get my key

10:19:41

from from my EnV file so here is my EnV

10:19:45

file and from here what I'm getting I'm

10:19:47

getting my key right now let me keep

10:19:50

this EnV in my do getting so I can push

10:19:54

my changes in my ga in that case you

10:19:57

won't get this uh key actually you you

10:19:59

will just get like uh the other file so

10:20:03

here I'm writing do EnV and once I

10:20:06

return it now it you can see it is not

10:20:09

going to track it uh at all so now uh

10:20:13

you want you will find out that there is

10:20:15

no such color anything and now what I

10:20:18

can do I can give you all the files and

10:20:20

all other files basically so let me

10:20:23

click on the

10:20:25

plus

10:20:26

yeah now let me commit it so here I'm

10:20:30

going to write it down of file updated

10:20:35

file

10:20:37

update and let me commit it and sync

10:20:42

changes now click on okay and here guys

10:20:46

you will find out my entire code Let me

10:20:49

refresh it now

10:20:52

and yes that is the entire code so I

10:20:57

think

10:20:59

uh you got the code over here set the

10:21:03

print

10:21:12

yeah so here is a key let me remove it

10:21:14

from here just a

10:21:32

second

10:21:58

yeah now it

10:21:59

gone so tell me guys uh are you able to

10:22:03

follow till here here uh did you get the

10:22:05

entire code the code which I shared with

10:22:07

all of

10:22:10

you please uh do let me know in the chat

10:22:13

if you got the code

10:22:16

then here I kept the entire code uh in

10:22:20

my GitHub

10:22:21

itself yes uh yes or no please uh write

10:22:27

it down the chat guys please uh do let

10:22:29

me know just search over the Google s

10:22:32

Savita GitHub and there you will find

10:22:34

out this McQ generator repository in my

10:22:36

repository section and here is the

10:22:38

entire

10:22:59

code if you are done till here then

10:23:02

please uh give me a confirmation so I

10:23:04

will proceed with a further uh further

10:23:32

concept

10:23:39

done done done

10:23:44

great fine so now let's start with the

10:23:48

implementation so till here actually I

10:23:50

just shown you the uh I just shown you

10:23:53

the environment setup and all now we are

10:23:56

ready for implementing the

10:23:58

project okay so within uh this uh within

10:24:02

this one hour actually I just shown you

10:24:03

the entire setup now this is the onetime

10:24:05

job I set up my entire environment now

10:24:09

let's start with the Practical uh now

10:24:11

let's start with the experiments and all

10:24:13

and in tomorrow's session I will create

10:24:15

uh the I will create the Modular One

10:24:17

modular project and there I will create

10:24:19

the steam allet application also and

10:24:21

finally we'll try to deploy it now here

10:24:25

uh you can see uh now each and

10:24:27

everything is done let's try to call

10:24:28

this a chat open a method and let's see

10:24:31

we are able to access the llm on l so

10:24:34

here you can see it is running and now

10:24:36

it is done so if you will look into this

10:24:38

llm llm now here you can see we are able

10:24:41

to do it we are able to call it now here

10:24:45

let's try to run the further code now we

10:24:48

are going to use all the concept the

10:24:51

entire concept whatever we have learned

10:24:53

throughout the community session right

10:24:56

throughout the throughout this community

10:24:57

session in our open in the lch so we we

10:25:01

are going to use those entire concept

10:25:03

over here now uh for that basically what

10:25:06

I'm going to do step by step I'm going

10:25:08

to write it down each and everything so

10:25:10

first of all I am going to import each

10:25:12

and everything in a single shot right so

10:25:15

here uh you can see I have imported all

10:25:17

the statement so this Trace back and all

10:25:20

I'm going to remove it from here which I

10:25:21

already did it this is also I already

10:25:23

imported now let me remove this also and

10:25:26

here uh just chat open a also I already

10:25:29

imported now uh here this open a prompt

10:25:32

template l CH sequential and this get

10:25:36

open a call back this is very important

10:25:39

uh this is very important class which I

10:25:41

imported over here uh I will show you

10:25:43

the name I will show you the use of this

10:25:45

particular class this C openi call back

10:25:48

in a very detailed way because it's

10:25:49

going to be very very important right so

10:25:52

far I haven't discussed about it I

10:25:53

discussed about the sequential chain I

10:25:55

discussed about the llm chain I discuss

10:25:57

about the promt template but I I haven't

10:25:59

discussed about this get openi call back

10:26:02

so now let me import import all the

10:26:04

statements over here so you can see we

10:26:07

are able to import it and yeah it is

10:26:10

done now we already created a object of

10:26:13

this chat open Ai and we are able to get

10:26:16

my llm by using this open AI API till

10:26:20

here I think everything is fine

10:26:22

everything is clear now let's move to

10:26:24

the next one now just tell me guys if we

10:26:26

are talking about so here what I can do

10:26:29

let me open my pen and let me ask a few

10:26:33

questions to all of you so here uh what

10:26:35

I'm doing uh just a

10:26:44

second yeah so here uh just uh let me

10:26:48

ask a few question so let's say we have

10:26:50

imported the llm means uh we are able to

10:26:53

access my llm this uh GPD model by using

10:26:56

this uh open AI or API by using this L

10:26:59

chain framework now to this llm what I

10:27:02

will do what I will pass to this llm

10:27:03

tell me so to llm to this particular llm

10:27:06

I will pass my uh prompt right I will I

10:27:09

will pass my input prom so here actually

10:27:12

what I will have to do I will have to

10:27:14

design my input promt right what I will

10:27:17

have to do guys tell me I will have to

10:27:18

design my input prompt and here as a

10:27:22

output what I will get tell me as a

10:27:24

output also I will get a prompt right so

10:27:26

here what I will have to do I will have

10:27:29

to design my input and output prom right

10:27:33

so so whatever my whatever will my input

10:27:35

so that particular prompt and here

10:27:37

whatever will be my output that a

10:27:39

particular prompt got it now let's try

10:27:41

to design my input prompt and let's try

10:27:43

to design the response as well then in

10:27:45

which format I will get the response so

10:27:48

here initially I clarified this thing

10:27:51

the project is going to be a McQ

10:27:53

generator right I am going to generate

10:27:56

McQ McQ right whatever topic whatever uh

10:28:00

subject I will give to my uh GPT model

10:28:03

so So based on that particular subject

10:28:05

based on that particular uh like based

10:28:07

on that particular text is going to

10:28:10

generate a McQ so let's say I'm giving

10:28:12

my paragraph I'm I'm giving one

10:28:14

paragraph to my GPT model So based on

10:28:17

that particular paragraph let's say I

10:28:19

given a paragraph related to our data

10:28:21

science uh okay I I I given one a PDF

10:28:24

file or text file or whatever file to my

10:28:26

GPT model so in that inside that like

10:28:28

you have a paragraphs you have a data So

10:28:30

based on that data is going to generate

10:28:33

a mcqs right so let me do one thing so

10:28:36

here uh first of all let me design my

10:28:38

prompt so here what I'm going to do guys

10:28:40

I'm going to design my prompt by using

10:28:42

this a prompt template I think you

10:28:44

already know about the prompt template

10:28:46

in my previous class I already clarify

10:28:49

the uh the concept of the prompt

10:28:51

template if you don't know then please

10:28:52

go and check with the previous session

10:28:54

so here what I'm going to do guys here

10:28:56

I'm going to Define my prompt template

10:28:58

so just wait uh let me copy and paste

10:29:00

the code because already I written this

10:29:03

uh like a single single line so let me

10:29:05

copy and paste and I'm going to explain

10:29:06

you so here my prompt is what so here my

10:29:10

prompt inside the prompt actually you

10:29:11

will find out in the prompt template you

10:29:13

will find out two things first is a

10:29:15

input variable and the second is

10:29:17

template right so here you can see as a

10:29:20

template I given this particular

10:29:21

variable now to this particular variable

10:29:23

I have to pass some sort of a text right

10:29:26

some sort of a like a template and all I

10:29:28

will pass it just wait right so here is

10:29:30

my template variable and I will pass my

10:29:32

template over here here I'm not going to

10:29:34

write it down directly here I'm going to

10:29:35

pass it to my variable and that variable

10:29:38

I I'm passing inside my prompt template

10:29:40

right now in an input variable you can

10:29:42

see we have a couple of we have a couple

10:29:45

of variable we have couple of parameter

10:29:47

the first one is text the second one is

10:29:49

a number the third one is a subject the

10:29:52

fourth one is a tone and the fifth one

10:29:55

is a response J so we have a five

10:29:59

variable inside my input variable in my

10:30:02

previous classes uh I shown you this

10:30:04

prompt template along with the uh simple

10:30:06

input variable along with the one input

10:30:08

variable right now here inside this one

10:30:10

I have written five input variable and

10:30:13

here I'm going to Define my template now

10:30:15

let's see what will be my template so

10:30:17

from here basically I'm going to copy

10:30:19

the template and let me paste it over

10:30:21

here so I'm saying to my chat GPT so I'm

10:30:24

saying to my chat GPT that uh you are

10:30:27

expert McQ maker right so I'm giving my

10:30:30

a text so on whatever text I want to

10:30:33

generate an McQ I'm passing a text over

10:30:36

here right and I'm saying to my chat GPT

10:30:38

that you are an expert McQ maker given

10:30:41

the abob text so whatever text we have

10:30:43

given to you it's your job by using this

10:30:46

particular text it's your job to create

10:30:48

a quiz of number so how many quiz you

10:30:51

want to create so five quiz six quiz

10:30:53

seven quiz eight quiz you can pass a

10:30:55

number over here so 5 six seven quiz

10:30:57

eight quiz so you can pass the number

10:30:59

and here uh you need to create a five

10:31:01

multiple let's say I'm writing number is

10:31:03

equal to five so five multiple choice

10:31:05

question for the subject now whatever

10:31:07

subject we are going to pass over here

10:31:09

in tone so tone means what tone actually

10:31:12

it is defining a difficulty level so

10:31:14

here if tone is simple so it is going to

10:31:16

generate a five simple McQ question if

10:31:19

tone is uh intermediate so it is going

10:31:22

to generate five intermediate question

10:31:24

if tone is difficult it's going to

10:31:26

generate five difficult in five

10:31:29

difficult McQ question got it now here

10:31:32

I'm saying make sure the question are

10:31:34

not repeated and check all the question

10:31:37

to be confirming the text as well so

10:31:39

each and everything I'm telling to my

10:31:41

GPD right so make sure to format your

10:31:44

response like so here actually I have to

10:31:46

for I have to pass the format also here

10:31:49

I'm going to pass here I have to pass

10:31:51

the format also like in which format you

10:31:53

have to generate a quiz now let me give

10:31:56

you the format now let me show you the

10:31:57

format so uh which format actually I

10:32:00

have designed over here so here what I'm

10:32:02

going to do I'm giving you the format

10:32:04

the format basically which uh I have

10:32:06

designed so let me show you the response

10:32:09

format now guys this is the response

10:32:11

format just just see over here see so

10:32:14

response or it's my response format so

10:32:16

here I'm saying uh like there is my McQ

10:32:19

multiple here I have written first okay

10:32:21

this my first mean like it's a number

10:32:23

itself that's it now here I'm seeing McQ

10:32:25

multiple choice question now here is a

10:32:27

option that uh you have a four Option 1

10:32:30

2 3 4 and here basically I will be

10:32:33

getting my correct answer so it is this

10:32:35

one this one actually this is my first

10:32:37

McQ along with the number along with a

10:32:40

question along with the number this is

10:32:42

my first McQ first McQ now here will be

10:32:45

my McQ now here will be my all the

10:32:47

options and here will be my correct

10:32:49

answer right so this is my response

10:32:52

format and here is my template basically

10:32:55

which I'm passing to my GPT model and

10:32:58

here uh I'm going to create my prompt

10:33:01

template that's it by using this

10:33:02

particular template and these are the

10:33:05

these are the variable which user is

10:33:09

going to pass right which user is going

10:33:11

to pass these are the variable now let

10:33:14

me do one thing let me run it and here

10:33:17

you can see we are able to create a like

10:33:19

temp we have like written a template and

10:33:22

this is what this is my prompt template

10:33:24

which I created that's it I think this

10:33:26

is fine now here uh yes once it is done

10:33:30

uh like uh my template and all basically

10:33:32

it will be created that is fine now

10:33:34

after that what I'm going to do I'm

10:33:35

going to create the chain right I think

10:33:38

you already know about the chain llm

10:33:40

chain I I explain you the concept of the

10:33:42

llm chain that why we use llm chain we

10:33:45

use llm chain for connecting a several

10:33:48

component so here as of now I just have

10:33:51

two component first is llm and the

10:33:53

second is prompt so I'm going to connect

10:33:55

both component all together and for that

10:33:58

I'm going to use llm chain so let's try

10:34:01

to use the llm chain and and here I have

10:34:03

already written the code let me copy and

10:34:05

paste it over here and so this is what

10:34:08

guys this is my uh like this is my uh

10:34:11

like llm chain so here I'm passing my

10:34:13

llm model with whatever model I took by

10:34:15

using the open API and here is what here

10:34:18

is my prompt so prompt is what so quiz

10:34:21

generation prompt so the prompt which I

10:34:23

have created by using this particular

10:34:25

template and by using this particular

10:34:28

response right in this format basically

10:34:30

I want a response now this is what guys

10:34:33

this is the llm chain all the concept

10:34:36

see whatever I have we have learned so

10:34:38

far I'm going to use all those concept

10:34:41

for creating this a particular project

10:34:43

right so so at least you can understand

10:34:46

that where we are using uh like those

10:34:49

Concept in a real time right so here is

10:34:52

what here is my question now let me run

10:34:53

it and here I have created my question

10:34:56

that is fine now guys just tell me uh

10:34:59

here uh I'm creating my quiz right so

10:35:04

here I'm creating my quiz now here

10:35:06

actually see I created a quiz but this

10:35:09

quiz is correct or not the basically in

10:35:12

the at the end you can see in the format

10:35:14

I have written this correct answer I

10:35:16

want a correct answer from it so after

10:35:18

analyzing a quiz actually I want a

10:35:21

correct answer so for that also I have

10:35:23

defined one more template now let me

10:35:26

show you that template so what I did

10:35:28

actually let me show you the template

10:35:31

two which I have created uh so here I

10:35:34

have created the second template now in

10:35:36

the second template you will find out uh

10:35:38

just a second let me copy all the like

10:35:42

thing over here and see this is what

10:35:45

guys this is my second template now here

10:35:47

I'm seeing here I'm saying actually uh

10:35:50

you are an expert English grammarian and

10:35:53

writer I'm telling to my chat jpd I'm

10:35:55

telling mypd actually so given a

10:35:57

multiple choice quiz for this particular

10:35:59

subject right this particular subject

10:36:02

now you need to evaluate the complexity

10:36:05

of the question and give a complexity

10:36:07

analysis of the quiz right give that

10:36:10

complexity analysis of the quiz only use

10:36:13

at Max 50 words for complexity if the

10:36:16

quiz is not at for the quantitive and

10:36:19

the analytic ability of the student

10:36:22

update the quiz update the quiz question

10:36:24

which needs to be changed and change the

10:36:26

tone such as uh such that it perfectly

10:36:29

fits to the student ability so here I

10:36:32

have written so here actually see here

10:36:34

I'm passing my quiz whatever quiz

10:36:36

basically I'm generating so in this

10:36:38

second template I have written that uh I

10:36:41

have written the like prompt regarding

10:36:43

to the evaluation regarding to the quiz

10:36:46

evaluation whatever quiz I am going to

10:36:48

generate right first I will generate and

10:36:51

then I will evaluate it here in the

10:36:53

second prompt now let me run it and here

10:36:56

I'm going to create my one more chain so

10:36:59

here I'm going to create uh so here

10:37:01

basically uh before create cre a chain

10:37:03

basically uh let me create just a second

10:37:06

so here uh what I'm going to do I'm

10:37:07

going to create my template so here in

10:37:10

the template you will find out only two

10:37:11

variable first is subject and the second

10:37:13

is quiz this two variable it is coming

10:37:16

from the user side I will show you how

10:37:18

like it is coming from the user side and

10:37:20

how user will be passing once we'll be

10:37:22

creating a end to end application got it

10:37:25

now here we have a quiz evaluation

10:37:27

prompt and this is what this is my

10:37:29

second prompt and now what I will do

10:37:30

regarding this prompt also I will create

10:37:33

my chain right so here uh here is my

10:37:36

quiz chain now I'm going to create one

10:37:37

more chain that's going to be a quiz

10:37:40

evaluation chain so let me uh like uh

10:37:43

copy this particular code step by step I

10:37:46

have written each and everything and

10:37:47

that is what I'm going to show you so

10:37:49

here is what guys here is my review

10:37:51

chain right so in this one I'm passing

10:37:53

my llm I'm passing my quiz Evolution

10:37:55

prompt and here output key is What so

10:37:58

whatever output I'm getting as a review

10:38:00

so here I'm going to collect it inside

10:38:02

this particular variable and verbos is

10:38:04

equal to True means what means whatever

10:38:07

ex means during the execution whatever

10:38:09

is happening now each and everything I

10:38:11

will be able to find out on my screen

10:38:14

itself that's the meaning of verbos is

10:38:16

equal to two that's it now here if I'm

10:38:17

running this review a chain so I have

10:38:20

created two chain now now after creating

10:38:23

this th I have created First Chain quiz

10:38:25

chain I created second chain review

10:38:27

chain now I'm going to connect both

10:38:30

chain right by using sequential chain so

10:38:34

the same concept I taught you in my

10:38:36

previous session so first I created one

10:38:38

chain where I'm going to add two

10:38:40

component llm and my uh prompt I have

10:38:43

created second chain and now I'm going

10:38:45

to collect both chain right both Chain

10:38:47

by using the sequential uh by using the

10:38:50

simple sequential chain now here what

10:38:52

I'm going to do so here already I have

10:38:54

imported this thing if you look into my

10:38:56

import statement so I have already

10:38:58

imported this sequential chain now let

10:39:01

me create a object object of this

10:39:03

sequential chain and then uh I'm going

10:39:06

to write it down the both name over here

10:39:08

so here what I'm going to do so let me

10:39:11

uh create object of this sequential

10:39:14

chain now so here guys you can see we

10:39:16

have a sequential chain and to this

10:39:19

sequential chain I'm passing the quiz

10:39:20

chain I'm generating a quiz and I'm

10:39:23

passing to my review chain right so from

10:39:26

here I'm generating a quiz and I'm

10:39:27

passing to my review chain and these all

10:39:30

are my input variable and these all are

10:39:32

my output variable and verbos is equal

10:39:34

to True right clear so here I'm going to

10:39:38

create a object of this same sequential

10:39:41

chain I hope till here everything is

10:39:43

fine everything is clear to all of you

10:39:46

please do let me know I use the uh

10:39:49

previous Concepts only I haven't I

10:39:52

haven't taught you anything new uh I use

10:39:55

the previous concept whatever I taught

10:39:57

you in my previous classes so please do

10:40:00

let me know if this uh part is clear to

10:40:02

all of you yes or

10:40:04

no it's very easy very simple don't

10:40:07

worry at the end I will revise all the

10:40:09

concepts uh whatever I'm using here

10:40:12

whatever I'm writing over here but first

10:40:13

tell me is it clear or not this

10:40:23

one if you can write it down the chat I

10:40:25

think that would be great you can hit

10:40:27

the like button you can let me know in

10:40:29

the chat so please do it guys uh I'm

10:40:33

waiting for a

10:40:39

reply because after uh this one the

10:40:41

climax will come and in that like we are

10:40:44

going to create a quizz and all whatever

10:40:47

is

10:41:01

there clear clear clear yes or

10:41:19

no yes saan your understanding is

10:41:21

correct first combining two template

10:41:23

using llm chain and then two H chains we

10:41:26

are going to combine by using the

10:41:28

sequential chain

10:41:31

okay

10:41:56

okay now uh I think till here everything

10:41:58

is fine everything is clear now let's

10:42:00

see how we are going to gener a quiz

10:42:02

from here after giving this many of

10:42:05

things after doing this many of things

10:42:08

so we are able to uh we are able to like

10:42:13

uh here you can see we are able to

10:42:15

create a sequential chain now the next

10:42:17

thing is what here actually what I want

10:42:20

guys tell me I want a text I want a data

10:42:23

so if you have a data in PDF you can

10:42:25

load the PDF if you have a data in txt

10:42:28

file you can load the txt file right if

10:42:31

you have data in some other file you can

10:42:33

load the data from there from anywhere

10:42:35

right so first you will have to provide

10:42:37

a text you will have to provide a data

10:42:39

on top of that data you are going to

10:42:43

create or you are going to generate a

10:42:45

quiz right so let me do one thing here

10:42:48

I'm going to create uh I'm going to

10:42:51

create one file the file name is going

10:42:53

to be uh wait I'm going to create one

10:42:56

file the file name is going to be

10:42:58

data.txt so data.txt

10:43:02

now what I'm going to do here uh I'm

10:43:04

going to open my Google and from there

10:43:07

uh I'm going to copy and paste some sort

10:43:09

of a text so let's say I'm searching

10:43:11

about the machine learning machine

10:43:15

learning machine learning so here I'm

10:43:18

going to search about the machine

10:43:19

learning now here uh is what here is my

10:43:23

machine learning now from here what I'm

10:43:25

going to do so here I'm going to take

10:43:28

all the data for this one right so I

10:43:30

took this particular data I'm copy I'm

10:43:33

going to copy it and let me paste it

10:43:35

over here where I'm going to paste I'm

10:43:37

going to paste in my data.txt so this is

10:43:40

the complete data which I have pasted

10:43:41

over here you can check it you can

10:43:43

reveal this file in your folder so click

10:43:45

on reveal in file explorer you will find

10:43:48

out this particular file uh this

10:43:50

data.txt right just open it and here is

10:43:54

your data which I copy and paste it from

10:43:56

the uh like Google itself from the

10:43:58

Wikipedia right great now let me close

10:44:01

it and here here is what here is your

10:44:03

data now do one thing let's uh do one

10:44:05

thing so let's try to read this

10:44:07

particular data so here what I'm going

10:44:09

to do so here uh let me open my file

10:44:13

ipynb file and here I'm going to read

10:44:16

this particular data so for reading a

10:44:18

data actually we have a we have a like a

10:44:22

code so let me write it down the code

10:44:24

over here so I'm writing over here you

10:44:26

need to open this file in a read mode

10:44:29

and just read the data in this

10:44:30

particular variable now here I need to

10:44:32

provide the file path so for providing a

10:44:34

file path let me write it down here file

10:44:37

underscore path and here uh R means what

10:44:40

R means read it and there I'm giving my

10:44:43

absolute path so here I'm passing the

10:44:46

complete path of the file so this is the

10:44:48

file path guys which I have given or

10:44:51

which I have written over here now let

10:44:52

me run it and let me check with the file

10:44:54

path that I got it or not so here what I

10:44:57

can do I can uh check with the file

10:45:00

underscore path now let me run it and

10:45:04

see guys this is what this is my file

10:45:05

path now I'm uh running this particular

10:45:08

code and here you will find out inside

10:45:10

the text what I got I got my data so

10:45:14

here is what here inside my text you

10:45:15

will find out you uh we have the entire

10:45:18

data now let me print it let me keep

10:45:20

this text variable inside the print

10:45:23

method so see guys I got the entire data

10:45:26

so whatever data I kept it inside my

10:45:27

file inside my txt file so you can see

10:45:30

all the data over here itself got it now

10:45:33

after that what I will do see now there

10:45:35

is a crucial part and there you will

10:45:37

find out the new thing right and one

10:45:39

more thing let me do one more thing over

10:45:40

here so see I created a response I

10:45:43

created a response here is what guys

10:45:45

tell me here is my response now this

10:45:48

response actually it's a

10:45:50

dictionary this is what this is a

10:45:52

dictionary right this one now over here

10:45:55

if I want to convert into a Json

10:45:57

serializer so for that there is a method

10:46:00

json. terms and here actually I'm

10:46:03

passing this dictionary now why I'm

10:46:05

doing it so here if I want to serialize

10:46:07

the python dictionary into a Json format

10:46:10

so here U into a Json format is string

10:46:12

so that's for that's why for that only

10:46:14

I'm going to call this particular method

10:46:16

json. dumps right so here uh I'm going

10:46:19

to call this json. Dums and here you

10:46:21

will be able to find out I'm going to

10:46:22

convert this a particular dictionary

10:46:24

this python dictionary into Json format

10:46:27

his string right this is fine this is

10:46:29

clear to all of you we got a text we got

10:46:31

this dictionary and we got a chain now

10:46:35

my final step will come into the picture

10:46:38

now let me show you my final step so

10:46:41

over here uh my final step is this one

10:46:44

now just just be careful guys and after

10:46:47

that my response will be coming and I

10:46:50

will be able to generate my output so

10:46:53

here guys see uh in the final response

10:46:56

you will find out that we are going to

10:46:58

call this get open Ai call back right

10:47:01

right this is a new thing for all of you

10:47:03

and here I have already imported this

10:47:06

get open Ai call back if you will look

10:47:08

into the import statement here a from

10:47:10

blanchin do callback get open call back

10:47:14

so here you will find out I'm U like

10:47:16

calling a same thing I'm calling this

10:47:18

get open Ai call back right now inside

10:47:21

this get open a call back you will find

10:47:23

out that we are going to call our

10:47:25

generative evaluated generate generate

10:47:27

evaluate change so this is the same

10:47:28

thing basically uh the same variable

10:47:30

over here you can see this one uh like

10:47:33

after creating after creating this is

10:47:35

the object actually generate uh generate

10:47:38

evaluate chain this is what tell me this

10:47:39

is the object object basically which I'm

10:47:41

keeping over here sequential chain is a

10:47:43

class right where I'm passing this

10:47:44

particular argument and this is what

10:47:46

this is my object this one generate

10:47:48

evaluate chain now I'm calling this

10:47:49

particular object over here this one

10:47:51

right this this particular object I'm

10:47:53

calling over here this is fine this is

10:47:55

fine this you are able to understand and

10:47:58

here we are getting a response after

10:47:59

calling but what is the meaning of this

10:48:01

C open Ai call back why we are using it

10:48:04

so just see over here I have written

10:48:06

something over here how to set up token

10:48:09

uses tracking in L chain so if you want

10:48:12

to understand the token uses if you want

10:48:15

to track your tokens and all input token

10:48:18

output token your pricing each and

10:48:20

everything each and everything you will

10:48:22

get by using this get openi call bag you

10:48:25

can check it by using this link which I

10:48:27

kept it over here here is a

10:48:29

documentation link so let me copy and

10:48:31

paste it over here over the browser and

10:48:34

here actually you will find out a

10:48:35

complete detail about this G openi call

10:48:39

back so let me show you so here is

10:48:41

tracking token uses so whatever number

10:48:43

of uh token you are going to use what

10:48:45

will be the pricing input token number

10:48:48

output token number everything you will

10:48:50

get it over here by using this get openi

10:48:53

call back right so just see over here we

10:48:55

are going to import it we are going to

10:48:56

create our llm we are going to got get

10:48:59

we are going to get our llm over here

10:49:01

and here we are going to call this

10:49:02

invoke method and there is my result now

10:49:05

if I'm going to print the CV so here you

10:49:07

will get the entire detail regarding the

10:49:09

token let me show you in terms of my

10:49:12

code right so whatever code and all

10:49:14

whatever like project I'm going to

10:49:16

create regarding that now before that

10:49:19

just see over here uh generate evaluate

10:49:23

chain this is what this is my object now

10:49:26

here if you will look into this

10:49:27

particular object so we are we have a

10:49:29

couple of input variable the first input

10:49:32

variable is text that is the same thing

10:49:34

the text itself right text you know

10:49:36

right which one uh what is the text like

10:49:38

whatever uh which one this text actually

10:49:41

so whatever uh like uh data right we are

10:49:45

passing for generating a McQ right on

10:49:47

whatever data we want to generate McQ

10:49:49

this this this takes actually now here

10:49:51

is a number how many McQ you want to

10:49:54

generate subject tone simple Simplicity

10:49:57

hard intermediate and here is what here

10:50:00

is a uh like request response so I will

10:50:03

have to mention everything over here

10:50:05

inside this variable so json. dumps

10:50:08

already we did it text we already did it

10:50:10

now let me Define this number subject

10:50:13

and tone so here let me take it as a a

10:50:16

variable so here guys you will see that

10:50:19

we have a number we have a subject and

10:50:21

we have a tone so number how many uh

10:50:23

quiz you want to generate I want to

10:50:25

generate five quiz here subject let's

10:50:28

say subject is machine learning let me

10:50:29

change the subject I'm going to keep as

10:50:31

a machine learning so here the subject

10:50:33

name is machine learning now uh here

10:50:37

Stone actually tone let's say it's a

10:50:39

simple one simple McQ I want just like a

10:50:42

simple McQ now if I will uh like run it

10:50:45

so here I have initialized my variable

10:50:47

now guys if I will run this one now you

10:50:50

will find out that everything I'm going

10:50:53

to get in my response itself so let me

10:50:55

run it and see so it is running and guys

10:50:58

over here you can see this is still it

10:51:02

is running and it will take some time

10:51:04

because it is evaluating each and

10:51:06

everything in back end whatever template

10:51:08

whatever prompts I have given and based

10:51:10

on that it will generate a response it

10:51:13

will generate a McQ so just wait for

10:51:15

some time and it is working working

10:51:28

working yeah now it is done guys see we

10:51:31

we got a response and inside this

10:51:32

response I have everything but before

10:51:35

showing you the response let me show you

10:51:37

something over here so here what I'm

10:51:39

going to do here I'm going to show you

10:51:40

the number of tokens number of tokens uh

10:51:43

input tokens output tokens and the

10:51:46

complete cost right so here what I'm

10:51:48

going to do let me copy the code uh

10:51:51

which I already written and it's a

10:51:52

simple like lines and all I'm just

10:51:54

copying pasting because I don't want to

10:51:57

waste the time okay because if I'm

10:51:59

writing it from scratch it it takes

10:52:01

takes a time right so here uh I'm saying

10:52:03

total number of tokens input token plus

10:52:06

output token now here prompt token and

10:52:08

prompt completion mean this is the input

10:52:10

token and this is the output token and

10:52:12

this is complete number of token and

10:52:14

here there is a total cost now if I will

10:52:16

run it guys so here you will find out

10:52:18

that I this is my total number of token

10:52:20

this is my input token this is my output

10:52:23

token and this is the cost and it is in

10:52:25

dollar so I'm able to track each and

10:52:27

everything by using this uh open a call

10:52:30

back getting my point now let's try to

10:52:33

get a response so let's try to uh get a

10:52:36

response from here uh so let's try to uh

10:52:39

get a quizzes and all so first of all

10:52:41

let me show you the response so if I'm

10:52:42

going to print the response now so you

10:52:45

will find out uh it's nothing it's the

10:52:47

uh dictionary itself right so inside the

10:52:50

dictionary uh you have uh different

10:52:52

different key and value now in this

10:52:54

dictionary you will find out one key

10:52:56

quiz right so if I'm going to write it

10:52:58

down here so here if I'm going to write

10:53:00

it down response. response. getet quiz

10:53:04

so if I'm going to write down here

10:53:05

response. getet quiz now see guys here

10:53:08

I'm able to get my quiz here I'm able to

10:53:11

get my quiz right so what I'm going to

10:53:13

do now I'm going to keep it inside my

10:53:15

variable my variable is what quiz this

10:53:18

is what this is my quiz right now what

10:53:20

I'm going to do here I'm going to write

10:53:21

it down Json json. load right Json do

10:53:26

loads and here I'm passing my quiz q i

10:53:29

now once I will write down like this so

10:53:32

you will find out my all the quiz so

10:53:34

here this is my first quiz and it is in

10:53:36

the same format it is in the same format

10:53:39

the response format which I have defined

10:53:41

so this is my first quiz and here is McQ

10:53:44

who coined the term machine learning so

10:53:47

Donald have Arthur Samuel Samuel Walter

10:53:51

pittz and Warren mlo right so here there

10:53:54

is a correct answer now here the second

10:53:56

quiz what was the earliest machine

10:53:58

learning model introduced by the Arthur

10:54:00

Samuel so speech recognization image

10:54:03

classification so you can see guys your

10:54:05

entire quiz over here whatever number I

10:54:08

have given I have given five number I'm

10:54:10

able to generate a five quiz from the uh

10:54:13

from the GPT model by giving a correct

10:54:15

prompt and by giving a correct uh like

10:54:18

response format so there is uh you just

10:54:21

uh required a python over here that's it

10:54:24

nothing apart from that and you will be

10:54:26

able to create the project a project

10:54:28

according to your requirement and this

10:54:30

type of project you can integrate

10:54:32

everywhere let's say uh uh like in a

10:54:35

dashboard itself in your dashboard you

10:54:36

will find out the quizzes and the

10:54:38

assignment so you can automate that

10:54:40

project uh that process you can generate

10:54:42

a quizzes and all from here uh right and

10:54:45

then you can append it inside uh the

10:54:47

dashboard and all so uh like something

10:54:49

like that you can make a real-time

10:54:50

connectivity I think you are getting my

10:54:52

point now let's uh look into the uh let

10:54:55

let's try to create a data frame by

10:54:57

using this uh dictionary so for that

10:55:00

what I'm going to do so here uh I'm

10:55:02

going to create a data frame uh just a

10:55:05

second uh first of all let me keep

10:55:07

everything inside the list so for that I

10:55:10

already written one code so here is the

10:55:12

code guys uh here I'm going to create uh

10:55:15

let me do one thing Let Me Keep It Quiz

10:55:17

only so here is what here is my list and

10:55:20

inside this list we have our items means

10:55:22

uh my quiz and my uh basically value

10:55:25

okay means my options now here actually

10:55:27

I'm going to keep it in a particular

10:55:29

format whatever string I'm going to to

10:55:31

be collect from here I'm going to join

10:55:32

in by using this pipe and here I'm going

10:55:35

to append it everything now let me run

10:55:37

it and you will get a better

10:55:39

understanding so if I'm going to run it

10:55:40

now see uh so it is giving me St Str

10:55:43

object has no uh attribute

10:55:46

items what is the issue over here okay

10:55:49

so just wait uh let me keep it over here

10:55:52

inside the quiz itself and

10:55:55

now I think it is fine so just a second

10:56:00

mm

10:56:01

mhm yeah now is fine so if I'm going to

10:56:04

show you this quiz table data now now

10:56:06

you will get all the thing over here so

10:56:09

yeah now I got each and everything in a

10:56:11

list and see every value every option we

10:56:15

are going to segregate by using this

10:56:17

pipe and for that only I have written

10:56:18

this code once you will go through it

10:56:20

you will be getting it now I can convert

10:56:22

it into a data frame so here uh let me

10:56:25

convert this uh thing this particular

10:56:28

thing in into a data frame so here if

10:56:29

I'm going to write it down

10:56:31

PD do data Frame data frame and here I'm

10:56:36

going to say that okay I'm going to uh

10:56:40

open the parenthesis and

10:56:44

[Music]

10:56:45

then yeah so here guys see this is my

10:56:48

McQ means there is my question here is

10:56:51

my choices there is four choices and

10:56:54

here is a correct answer now let me keep

10:56:56

this thing in my uh variable that is

10:56:59

going to be a quiz and and now let me

10:57:01

convert this uh data frame as a CSV file

10:57:05

so here I'm going to convert this data

10:57:08

this uh quiz actually into a CSV file so

10:57:10

quiz do 2or CSV and here I can write it

10:57:15

down the name and the name is going to

10:57:17

be a machine learning quiz so machine uh

10:57:22

machine

10:57:23

learning. CSV right machine learning.

10:57:26

CSV index is equal to false index is

10:57:29

equal to false now if I will run it guys

10:57:32

see in my current uh directory in my uh

10:57:36

like current local directory you will

10:57:38

find out this CSV file now let me open

10:57:40

the CSV file and here you can see my

10:57:43

quiz I just given the number of quiz how

10:57:45

many number of quiz I want uh see uh if

10:57:48

you will look into the code now now you

10:57:50

will be getting that uh this this number

10:57:53

actually this this thing basically which

10:57:54

I will I was providing to my um like

10:57:57

object this one number of quiz sub

10:58:00

object and toone so this is the only

10:58:03

thing which I want from my user and for

10:58:06

this one only I'm going to create my web

10:58:09

application as of now I shown you the

10:58:11

simple implementation in the python

10:58:13

notebook in ipb itself now in tomorrow's

10:58:16

class what I'm going to do so here I

10:58:18

have created the folder the folder name

10:58:19

is what SRC folder and inside that I

10:58:22

have a McQ generator now each and every

10:58:24

line of code I'm going to write it down

10:58:27

my py file I'm going to create a modular

10:58:29

coding I I'm going to write down the

10:58:31

modular coding here and then finally we

10:58:33

are going to create a web API right web

10:58:36

API and uh here U like yes by using the

10:58:40

B API you just need to pass this

10:58:43

particular value number of quiz you just

10:58:45

need to pass this 3 to four value you

10:58:48

need to pass the text this particular

10:58:49

text you need to pass the number of

10:58:51

quizzes subject and the tone that's it

10:58:55

and you uh and after that once you will

10:58:58

hit the button so the qu will be in your

10:59:01

hand this

10:59:03

one got it yes or no tell me guys so how

10:59:06

is a project uh did you like this tell

10:59:10

me do you like this Jupiter

10:59:11

implementation yes or no tell me guys

10:59:18

fast do you have any any like uh any um

10:59:23

that doubts and all so please do let me

10:59:25

know I will be clarify that and uh don't

10:59:29

worry you won't face any sort of issue

10:59:31

so whatever step I followed just

10:59:33

followed those step and try to do this

10:59:35

uh um this notebook implementation at

10:59:38

least and tomorrow we'll convert this

10:59:40

notebook implementation into an end to

10:59:42

end project so let me give you this code

10:59:45

now so here I can uh add it this file

10:59:48

this file and this file also so I added

10:59:51

this three file now let me write down

10:59:54

the message all files updated updated

10:59:58

okay so just a second all file

11:00:04

updated and here let me commit it and

11:00:07

sync the changes so now guys just check

11:00:11

with the GitHub you will get the uh

11:00:14

files and all right let me show you the

11:00:16

GitHub now and here is my

11:00:27

GitHub so guys uh just check with the G

11:00:31

here you will find out the CSV file

11:00:33

quizzes and all uh and here see quizzes

11:00:37

Which I generated by using the GPT and

11:00:40

here actually there is a ipv file where

11:00:43

you'll find out the entire

11:00:45

code

11:00:51

okay yes it is generating a quiz from

11:00:53

the text itself so let's say if you are

11:00:55

giving this part let's say any different

11:00:57

text so let me do one thing let me give

11:01:00

the different text over

11:01:02

here uh so just a second I'm going to

11:01:05

generate a different text

11:01:07

now uh so any topic uh uh any topic

11:01:11

basically anything you can uh like

11:01:13

search over here let's say you are going

11:01:15

to search about the biology so

11:01:18

biology uh Wikipedia so just search

11:01:22

about the biology and here open

11:01:25

the like Wikipedia page copy it from

11:01:29

here copy it as of now and just keep it

11:01:32

over here inside the text inside your

11:01:35

txt file now see we'll automate this

11:01:37

particular process so you don't need to

11:01:39

paste it like this you just need to uh

11:01:41

give your documentation to your

11:01:43

streamlet application or to your flask

11:01:45

application or Jango application we'll

11:01:47

automate that particular process don't

11:01:48

worry and even we can automate like many

11:01:51

uh instead of providing this particular

11:01:53

text and all right no need to provide

11:01:55

this text by writing directly by writing

11:01:57

the name also we can generate a quiz

11:01:59

okay that is all also possible that is

11:02:01

also possible as of now I'm giving my

11:02:03

text and based on that see this is the

11:02:05

biology text right now what I can do I

11:02:08

can just need to open my uh IP VB here

11:02:11

and after that I just need to load this

11:02:13

text so here I'm going to load my text

11:02:16

this one and I'm going to change my

11:02:18

subject so instead of this machine

11:02:20

learning I'm writing here

11:02:23

biology right I have written biology

11:02:25

over here let me run it so here I got uh

11:02:27

the biology text this is the biology

11:02:29

text and uh yes uh I think now

11:02:32

everything is same this is fine this is

11:02:34

fine now let me run it so here if I'm

11:02:37

going to run it so now it is generating

11:02:39

mcqs from those particular text whatever

11:02:42

text I have given regarding the biology

11:02:43

and all so it is taking that text and it

11:02:46

is generating a uh mcqs and all so it

11:02:48

will take some time let it

11:02:50

run and then you can save uh this file

11:02:53

over

11:02:54

here so now it is done uh it is getting

11:02:58

we are getting some issues

11:03:01

incorrect API key

11:03:06

provided okay it is saying incorrect API

11:03:09

key provided I think some issues there

11:03:10

with the API key but yeah the process

11:03:12

will be same right I will check with the

11:03:13

API key issues what is this uh now see

11:03:16

guys uh I think you got my point you got

11:03:19

the like concept and you got about the

11:03:22

project also and today we are going to

11:03:25

create in2 and one and we'll try to

11:03:27

deploy it also so don't miss tomorrow's

11:03:29

session tomorrow's class uh great so I

11:03:32

think we can start with today's session

11:03:35

uh now in today's session uh again uh

11:03:37

we'll uh try to complete our project

11:03:39

itself so in previous class uh we have

11:03:42

started our uh end to end project uh in

11:03:45

that I have explain you the uh Jupiter

11:03:48

implementation so we did the entire

11:03:50

project setup and after that uh we did

11:03:52

the we implemented our jupyter notebook

11:03:55

now in today's session we are going to

11:03:57

create we are going to write it on the

11:03:58

modular coding modular code and there we

11:04:01

are going to create a several file and

11:04:04

uh I will show you how you can create a

11:04:06

different different file in a different

11:04:07

different folder and then how you can

11:04:09

create your streamlit application and if

11:04:12

uh time will permit so definitely we'll

11:04:14

try to deploy it also and for the

11:04:16

deployment we're going to use

11:04:18

AWS okay so uh don't worry I will write

11:04:22

it down like uh each and every line in

11:04:24

front of you only and uh and I will

11:04:26

clarify the agenda but before that uh

11:04:29

let me show you the resources and all so

11:04:31

where you will find where you can find

11:04:33

it out all the resources so for that uh

11:04:36

let me go through with the Inon website

11:04:39

and here you can search generative AI so

11:04:43

just search about this generative Ai and

11:04:45

there you will get the dashboard so here

11:04:47

we have two dashboard one for the Hindi

11:04:50

and the second for the English so just

11:04:52

click on this English uh this uh this

11:04:54

particular dashboard and here click on

11:04:56

this go to the course so uh let's say if

11:04:59

you are enrolling for first time if you

11:05:00

are opening first time then it will ask

11:05:02

you for the enroll uh for the enrollment

11:05:04

and uh you no need to pay anything it's

11:05:07

completely free so you can enroll to

11:05:09

this particular dashboard and you can

11:05:11

open it so let me open the dashboard so

11:05:14

here is my dashboard guys uh you can see

11:05:16

all the recording we have updated all

11:05:18

the recording whatever thing I have

11:05:20

covered so let me uh show you the

11:05:23

resources as well I think day six

11:05:25

recording is not available over here so

11:05:28

don't worry it will be up uploaded along

11:05:30

with the recording you will uh find out

11:05:32

the assignment and the quizzes also and

11:05:35

where you will find out the resources so

11:05:37

let's check with the day five so uh here

11:05:40

in this uh video right so once uh you

11:05:42

will click on the video uh so here you

11:05:45

will get a different different option

11:05:46

related to the video so just click on

11:05:49

this resource section and here you will

11:05:51

find out all the resources so whatever

11:05:53

thing I'm discussing in the class itself

11:05:56

uh whatever uh like code and all

11:05:58

whatever I'm writing here so uh I'm

11:06:00

going to uh I'm going to upload each and

11:06:02

everything here inside this resource

11:06:04

section so from here itself from the

11:06:06

resource section you can download it got

11:06:09

it yes or

11:06:16

no great so from here you will get the

11:06:20

resources and all and yes U videos is

11:06:23

available over here recorded videos is

11:06:25

available over here and apart from that

11:06:27

you will find out over the ion YouTube

11:06:29

channel so just go through with the Inon

11:06:31

YouTube channel U and there uh go inside

11:06:34

the live section there you will find out

11:06:36

all the recorded video so let me show

11:06:38

you that so visit the Inon uh YouTube

11:06:41

channel and here click on the live

11:06:44

section this one so you will find out

11:06:46

all the videos all the like lecture or

11:06:49

the live lecture which I uh took so far

11:06:52

and here is a day six lecture where I

11:06:54

have started with a project so in this

11:06:57

lecture till day five actually I have

11:06:59

complet completed the Lin first I

11:07:01

started from the introduction then I

11:07:03

went to the open a and then I uh started

11:07:06

with the different different concept of

11:07:08

the Lang and then I move to this uh

11:07:10

particular project the project uh which

11:07:12

I have started that was the McQ

11:07:15

generator by using open a and the Len

11:07:18

chain so here uh you can see I have uh I

11:07:21

shown you that how to do a complete

11:07:24

project setup and even I shown you how

11:07:27

you can push it over the GitHub and all

11:07:29

how you can insize the gate each and

11:07:31

everything I shown you over here and

11:07:33

then uh I shown you the uh Jupiter

11:07:35

notebook implementation so just go

11:07:37

through with this particular video there

11:07:39

you will find out uh like each and

11:07:42

everything uh now uh what we can do we

11:07:44

can start with the remaining part of the

11:07:46

project so here in this uh particular

11:07:49

project so we have created a several

11:07:52

folder now in front of you only I'm

11:07:54

going to create few more file and there

11:07:57

I will be writing my code and finally

11:08:00

we'll try to create a web application

11:08:02

and if time will permit so definitely we

11:08:04

are going to deploy it also so the

11:08:07

agenda is clear to all of you yes or no

11:08:09

please uh do let me know in the chat

11:08:11

please do confirm in the

11:08:21

chat

11:08:28

yes

11:08:32

how long this course is going to be so

11:08:34

the course uh I I have planned two more

11:08:37

end to project so I have to take few

11:08:40

Advanced concept like uh Vector database

11:08:42

R and few open source model and after

11:08:46

that I have planned two more end to end

11:08:48

project so you can assume that uh like

11:08:52

more 8 to 10

11:08:54

days got it so um I I will take two more

11:08:58

end to end project and this is just a

11:08:59

basic project actually after completing

11:09:01

all the concepts and all I taught you

11:09:04

this one but yeah after that I will

11:09:06

complete one project along with the

11:09:08

flask API and I thought one more project

11:09:10

along with the vector database R concept

11:09:13

and the fast

11:09:15

API

11:09:23

okay great so let's uh begin with the

11:09:26

project and here uh what I can do

11:09:30

so just a second just allow me a

11:09:53

minute okay so I already given you this

11:09:55

particular project and if you want this

11:09:57

project uh this project actually so from

11:10:00

where you can get it uh let me show you

11:10:02

so this uh project already I have

11:10:05

uploaded on my GitHub so just uh try to

11:10:07

go through with my GitHub and there you

11:10:09

will find out this particular project

11:10:11

and for that what you need to do just

11:10:13

open your Google and search Sunny Savita

11:10:16

GitHub okay so open your Google and

11:10:19

search Sunny Savita GitHub and after

11:10:22

that you will find out my GitHub so just

11:10:24

click on that uh click on my GitHub and

11:10:26

here go inside the repository here

11:10:28

inside the reposit

11:10:30

and click on this very first link this

11:10:32

McQ generator so just open this one and

11:10:35

here you will find out this particular

11:10:38

project so whatever I'm uh doing

11:10:39

whatever I'm uh whatever code and all

11:10:42

I'm writing I'm pushing in my this

11:10:44

repository so I'm giving you this

11:10:45

repository in the chat section if you

11:10:47

are able to click click on it so that is

11:10:50

fine otherwise you can search over the

11:10:52

Google and directly you will find out

11:10:54

this repository in my uh repository

11:10:57

section got it so from from here itself

11:11:00

you can download the project so you can

11:11:02

download it or you can clone it anything

11:11:04

is fine now uh let's start with the

11:11:07

remaining part of the project now here

11:11:09

guys see I created a couple of uh folder

11:11:12

I have created couple of like files but

11:11:14

let's try to uh uh do something more

11:11:16

over here so as I told you this uh

11:11:19

project is going to be end to end so

11:11:21

here actually see I created the ipv file

11:11:24

so each and every experiment I performed

11:11:26

over here so I I return like some sort

11:11:29

of a line of code here and then uh I

11:11:32

called my openi API and then I generated

11:11:34

the mcqs and all here I have stored

11:11:36

inside my CSV each and everything I did

11:11:39

in my previous class now if I want to

11:11:41

convert this project if I want to uh

11:11:44

like uh convert this project into an end

11:11:46

to end project so for that uh I will

11:11:49

have to create few more file over here

11:11:51

so here guys if you will look into this

11:11:53

SRC folder so here I have created one

11:11:56

folder that is what that is an McQ

11:11:57

generator now inside this McQ generator

11:12:00

I'm going to create few more file so you

11:12:02

can do along with me if you have

11:12:04

completed till here so uh here actually

11:12:07

you can see uh like uh whatever thing I

11:12:10

have done in my previous session so you

11:12:12

can find out each and everything over

11:12:13

here if you have completed till here

11:12:15

then you can proceed along with me now

11:12:18

what I can do so here uh let me create a

11:12:21

few file inside this McQ folder inside

11:12:24

this McQ generator the first file which

11:12:27

I'm going to create over here that's

11:12:28

going to be a logger file so here let me

11:12:32

create the logger file logger py because

11:12:35

each and everything uh let's say

11:12:37

whatever code I'm running and uh

11:12:39

whatever thing I'm going to execute

11:12:41

inside my project so I'm going to log

11:12:43

each and everything so for that this

11:12:45

logger file is very much important so

11:12:47

here I'm going to Define my logging

11:12:49

object and directly I will import this

11:12:51

logging object in any other file and

11:12:54

then directly I'm going to uh like save

11:12:57

the logs and all so I will show you how

11:12:59

to do that first of all let's try to

11:13:01

create the folders so here uh let's try

11:13:03

to create the files and all so here I

11:13:05

have created my logger file logger dopy

11:13:07

inside this McQ generator folder now

11:13:10

after that you need to create one more

11:13:12

file over here the file is going to be a

11:13:14

utils file so here uh let me write it

11:13:18

down the utils.py now what is this util

11:13:21

file why we should use this utils file

11:13:24

actually this utils file is a helper

11:13:26

file so whatever helper function is

11:13:28

there whatever helper function and

11:13:30

method is there so each and everything

11:13:32

I'm going to write it down over here

11:13:34

itself got it so what what is the use of

11:13:36

this utils file so it's a utility file

11:13:39

it's a helper file so what is a what

11:13:41

whatever helping function and all

11:13:43

whatever I have inside my code so each

11:13:45

and everything I'm going to write it

11:13:47

down over here itself now uh one more

11:13:50

file I'm going to create inside this

11:13:52

folder inside this McQ generator and the

11:13:54

file is going to be McQ generator itself

11:13:57

so inside this particular file I'm going

11:13:59

to write it down my entire code got it

11:14:02

now here I'm going to create one file

11:14:04

the file name is going to be a

11:14:07

McQ generator so here is the file name

11:14:11

McQ generator. py so I have created

11:14:14

three file inside my McQ folder inside

11:14:16

my McQ generator folder so the first

11:14:18

file logger file the second file is a

11:14:20

utils file and the third file McQ

11:14:22

generator. py5 fine so I hope till here

11:14:26

everything is fine everything is clear

11:14:28

now let me create few more file now in

11:14:31

the root directory itself I'm going to

11:14:33

create one more file that's going to be

11:14:34

a response response. Json I will tell

11:14:38

you what is the use of this response.

11:14:40

Json because yesterday uh in the

11:14:42

previous class uh if you will uh let me

11:14:44

show you this ipb itself so here I have

11:14:46

written one response here you can see we

11:14:48

have uh I have written this response G

11:14:51

and inside this response G I have Define

11:14:54

uh the response basically in which

11:14:55

format uh like uh the response should be

11:14:58

generated so here I have defined the

11:15:01

response Json now uh the same thing I'm

11:15:03

going to Define inside the Json file and

11:15:06

I will tell you what is the importance

11:15:08

of that so if I want to create a Json

11:15:10

file so for that uh what I need to do I

11:15:13

no need to do anything so here uh click

11:15:15

on this new file and after that uh write

11:15:17

it down here response uh response do

11:15:21

Json response. Json now here you can see

11:15:25

this is what this is my Json file so uh

11:15:29

till now I have created four file the

11:15:31

first file was the logger McQ generator

11:15:33

utils.py and apart from that one more

11:15:36

file that's going to be a response. Json

11:15:38

and this file will be in a uh will be in

11:15:42

a root directory this one response. Json

11:15:45

I think till now everything is fine okay

11:15:47

where I have created it uh let me check

11:15:51

once I think I have created inside this

11:15:54

experiment no need to worry just uh drag

11:15:58

and drop here

11:15:59

yeah so now I got it in my root

11:16:02

directory yeah so here is what here is

11:16:04

my response dojon now let me create one

11:16:08

more file over here and the file is

11:16:09

going to be a streamlit app so actually

11:16:12

I'm going to create my web app by using

11:16:14

the stream l so here I'm going to uh

11:16:16

create one more file and the file is

11:16:18

going to be a stream L and that two you

11:16:21

need to create in a root directed itself

11:16:23

in a root folder itself so here I'm

11:16:25

going to write down stream s e a m

11:16:28

stream lit uh

11:16:31

app.py so this is what this is my file

11:16:33

now let me keep this L as a small one

11:16:37

yeah now it is fine so streamlit do

11:16:40

streamlit app.py so these many file I

11:16:43

have created and now I think it is like

11:16:46

enough now what I can do I can give you

11:16:49

like this complete folder structure so

11:16:51

for that U like I can commit from here

11:16:53

itself uh so let me add all the files

11:16:55

from here I'm going to add all the

11:16:57

changes whatever I have done done inside

11:16:59

my code and I told you how to do that uh

11:17:02

in the previous class I explain you each

11:17:03

and everything regarding the git and all

11:17:05

so if you will go through with my

11:17:06

previous uh session so you will get to

11:17:08

know the uh like you will get uh you

11:17:11

will get the idea that how to like uh

11:17:13

how to uh create a repository and all

11:17:15

how to publish from here itself how to

11:17:17

publish a public repository each and

11:17:19

everything I have discussed in my

11:17:21

previous session now uh here you can see

11:17:24

I have added all the changes now I just

11:17:26

need to commit it in my staging area and

11:17:29

then I will push it in my GitHub so here

11:17:31

I can write down that uh I updated

11:17:34

updated the

11:17:36

folder updated the folder structure so

11:17:41

now what I can do I can commit it and

11:17:43

here I can sync the changes and then

11:17:54

okay yeah so now let me show you did I

11:17:56

get all the files and all here so here

11:17:59

guys you can see I got all the files

11:18:01

like streamlit app streamlit app.py and

11:18:05

here in the SRC you will find out this

11:18:07

uh in the McQ generator you'll find out

11:18:09

this McQ generator. py logger py

11:18:11

utils.py so each and everything uh you

11:18:15

can uh you can see over here inside my

11:18:18

repository itself so I hope guys you got

11:18:21

this entire code yes or no this entire

11:18:24

file now again let me give you inside

11:18:26

the chat uh or else what you can do you

11:18:29

can search over the Google as well so

11:18:31

directly you will get it tell me guys uh

11:18:34

till here everything is fine uh can we

11:18:36

start with the code and

11:18:39

all please uh do let me know in the

11:18:53

chat I given you this uh link inside the

11:18:56

chat I hope uh you are able to click it

11:18:58

otherwise directly check with the Google

11:19:00

you will get this

11:19:04

project Raab please check with my GitHub

11:19:07

repository check with a just search

11:19:09

about my username this s Savita Sun

11:19:13

Savita GitHub and then you will get my

11:19:15

GitHub and then from U from there itself

11:19:18

you can download this particular

11:19:23

code front end and all we are going to

11:19:26

handle by using this stream lead so

11:19:28

stream will handle everything we don't

11:19:30

no need to like create a front end

11:19:32

separately uh in the next project I will

11:19:35

show you that once I will use the

11:19:36

flask maybe with the fast API I will

11:19:39

show you the uh front end part as well

11:19:41

but here uh if I'm using this stream L

11:19:44

then front end is not

11:19:57

required

11:20:00

yeah you can use any ID even you can use

11:20:02

the U Inon lab also so from next project

11:20:05

onwards we are going to use the in

11:20:07

neural lab yesterday actually I did the

11:20:09

entire setup in my uh local vs code only

11:20:12

so that's why I'm continuing from here

11:20:14

itself but uh from next project onwards

11:20:17

I'm going to use the neurol lab so U I

11:20:20

think uh no need to set up in your local

11:20:22

uh directly you can launch the lab and

11:20:24

whatever experiments and all or whatever

11:20:27

project uh like you have uh you can

11:20:29

create over there itself

11:20:49

okay if you're getting any error

11:20:51

relative to the API key then try to

11:20:53

generate a new API key and don't use my

11:20:56

API key okay

11:21:02

because after the class anyhow I will

11:21:03

delete it so yeah don't use my API key

11:21:07

uh use your API key try to generate your

11:21:09

own API key from the open a i shown you

11:21:12

how to do that so go through the uh

11:21:15

openi website and from there itself you

11:21:18

can generate an openi key so if you're

11:21:21

liking the session guys then please uh

11:21:23

hit the like

11:21:27

button and and yes I think now we can

11:21:31

start with the coding so if you will

11:21:33

look into the project so here I have

11:21:35

created a various folder so I have

11:21:38

started from this uh logger if you will

11:21:41

look into this McQ generator so I've

11:21:44

created a couple of file the first file

11:21:46

was the logger the second file was the

11:21:47

utils file and the third file was the

11:21:49

McQ generator now here uh no need to

11:21:52

write it down the separate code for the

11:21:55

separate code for the front end and all

11:21:57

this stream lit will take care of it

11:21:59

this stream late will take care of it we

11:22:01

can create a basic BB application just

11:22:04

to test our API and all so no need to

11:22:06

write it down the code for the front end

11:22:08

and all now guys uh what we can do here

11:22:10

so let's try to uh write it down the

11:22:13

code for the logging so here I'm going

11:22:16

to write down the code for the loging

11:22:17

now why the uh logging is required so

11:22:20

see whenever we are going to execute a

11:22:22

code so in the code actually we have a

11:22:24

various step we have a various files we

11:22:27

have a various method function classes

11:22:29

and all right and each and every

11:22:31

function has been defined for the

11:22:32

particular purpose so let's say uh if

11:22:34

I'm going to write it down any sort of a

11:22:36

function inside the utils file or maybe

11:22:38

McQ generator so the function which I'm

11:22:40

going to create or which I'm going to

11:22:42

Define I'm going to create it for the uh

11:22:44

for the like Define purpose for a

11:22:46

particular purpose right so uh if I if

11:22:48

you want to log that uh information like

11:22:51

so let's say this a function is going to

11:22:53

execute and after the execution like

11:22:55

what you are getting or maybe after the

11:22:57

let's say you have completed the

11:22:59

execution now you want to save that

11:23:01

particular information software okay I

11:23:03

have completed this particular step I

11:23:05

have executed this particular function

11:23:06

or method so that information you can

11:23:09

log somewhere and there this logging

11:23:11

comes into a picture so always make sure

11:23:13

whenever you are going to create any

11:23:15

sort of a project uh whether you are

11:23:18

doing a development code development

11:23:20

machine learning related development or

11:23:21

whe whether you are going to write it

11:23:23

down a code in a gener project or

11:23:26

anywhere this loger exception you and

11:23:28

all this uh this particular files and

11:23:31

folder will remain same it's a part of

11:23:33

the infrastructure got it now here uh

11:23:36

let me write it down the code inside

11:23:38

this logger do py file so here uh let me

11:23:42

import the logging first of all so here

11:23:44

I'm going to write it down import import

11:23:47

login now uh here I have imported the

11:23:50

login then after uh I'm going to import

11:23:53

the OS and the third module which I'm

11:23:56

going to be import over here that's

11:23:57

going to be a date time so from date

11:23:59

time and here I'm going to write it down

11:24:02

import date time so these three import

11:24:05

statement this three statement I have

11:24:07

imported the first one is a loging the

11:24:10

second one is a OS and the third one is

11:24:12

a date Tye now let's try to create our

11:24:15

logger file so for that uh what I'm

11:24:17

going to do so here I have written one

11:24:19

expression now let me show you how my

11:24:22

logger file will be looking like so guys

11:24:24

here is my logger file here is my log

11:24:27

file actually and inside this file I'm

11:24:30

going to log each and every information

11:24:32

right so just try to uh look into this

11:24:35

particular file so here what I'm going

11:24:36

to do see here I'm going to collect my

11:24:39

uh the real uh date time so by using

11:24:42

this date time do now I'm going to uh I

11:24:45

I I will be getting the real date time

11:24:48

now I'm uh calling this particular

11:24:49

method St strf time so I'm formating

11:24:52

this particular time whatever date and

11:24:54

time which uh which we are getting U and

11:24:56

this is the real date time okay okay if

11:24:58

I'm going to call it um as of now right

11:25:00

so let me show you you can perform each

11:25:02

and every thing each and every

11:25:04

experiment inside this experiment uh

11:25:06

inside this uh particular notebook So

11:25:09

Yesterday only I have created so you can

11:25:11

create it and you can perform like

11:25:13

whatever experiments you want to do

11:25:15

before putting into the pipeline now

11:25:17

what I can do here I can copy this uh

11:25:19

code from here now let me copy it and

11:25:22

let me show you that what I will be

11:25:23

getting from here so this small small

11:25:25

experiment you can do inside your

11:25:27

Jupiter notebook now from uh so here

11:25:30

actually I need to import the date time

11:25:32

so from date time what I'm going to do

11:25:34

I'm going to import the date time itself

11:25:37

so from date time import date time now

11:25:41

uh let me do one thing let me run it and

11:25:44

here you will find out the uh the

11:25:46

current date and time now if you want to

11:25:49

formate it uh so here uh for that

11:25:51

actually we have a method so you can

11:25:54

call this method St strf time now let me

11:25:57

call this particular method

11:25:58

and then let's see what you will be

11:26:00

getting over there so I'm going to copy

11:26:02

it and let me paste it over here now you

11:26:06

will find out that I'm getting a date

11:26:09

time in a particular format so here is

11:26:11

month day year Edge means are minute and

11:26:15

second now what I'm going to do so this

11:26:18

will be the file name this will be my

11:26:20

file name and here I'm going to put do

11:26:22

log so do log is what do log is a

11:26:25

extension so this is going to my file

11:26:27

name and with that easily I can identify

11:26:29

that at which particular time I have

11:26:32

executed my code getting my point so

11:26:35

that's why I'm writing this name I'm

11:26:37

giving this name to my log file and this

11:26:40

this will be what this will be my uh

11:26:41

this current uh date and time will be my

11:26:43

name of the log file and what is the

11:26:46

meaning of the do log do log is nothing

11:26:48

it's a extension so here uh you will see

11:26:51

inside this uh logger file so this is

11:26:53

what this is the name of the file uh by

11:26:56

using this particular Name by seeing

11:26:57

this name I can easily understand that

11:27:00

at at which time I have executed my

11:27:03

pipeline right so according to that I

11:27:05

can collect the logs now here you will

11:27:07

find out this is what this is my file

11:27:09

name so I created a loog file and after

11:27:12

that guys what I will do so after that

11:27:14

let me create the path as well so where

11:27:17

I'm going to store my log so for that

11:27:20

also I have written couple of line and

11:27:22

this two line actually I'm using for

11:27:25

saving my log so in which directory I'm

11:27:28

going to save my log okay now here I'm

11:27:31

going to call this method os. path.

11:27:34

jooin os. getcwd means what so os. get

11:27:38

CWD means get current working directory

11:27:42

so as of now um in I am in this a

11:27:44

particular directory let me show you so

11:27:46

let me open my terminal and here you

11:27:48

will find out that I'm in this a

11:27:51

particular directory so I'm in C user

11:27:54

Sunny McQ generator so this is what this

11:27:57

is my folder name so this is my

11:27:58

directory path as of now I'm worki