1
00:00:00,000 --> 00:00:06,000
In this video we are going to create our code assistant, you know, an end to end project code assistant

2
00:00:06,000 --> 00:00:08,000
with the help of Code Llama.

3
00:00:08,000 --> 00:00:10,000
Okay, now what exactly is Code Llama?

4
00:00:10,000 --> 00:00:15,000
It is again brought up by meta, completely open source, and with the help of Code Llama, you can

5
00:00:15,000 --> 00:00:22,000
also build your own personal code assistant, which will actually help you to write any code with the

6
00:00:22,000 --> 00:00:24,000
help of any custom prompt that you want.

7
00:00:24,000 --> 00:00:27,000
Okay, so step by step will be seeing how we can actually implement it.

8
00:00:27,000 --> 00:00:29,000
And here I'll also be using Lama.

9
00:00:30,000 --> 00:00:35,000
So let's just go ahead and first of all understand about Code Lama.

10
00:00:35,000 --> 00:00:36,000
Now what exactly is Code Lama.

11
00:00:37,000 --> 00:00:40,000
Uh, it is a state of art large language model for coding.

12
00:00:40,000 --> 00:00:42,000
So here are some of the examples.

13
00:00:42,000 --> 00:00:49,000
If you give any prompt let's say that you want uh, Python programming language uh for Fibonacci series.

14
00:00:49,000 --> 00:00:54,000
So it will probably give you the entire code over here right now if I probably talk about Code Llama.

15
00:00:54,000 --> 00:00:58,000
So the latest update is from January 29th, 2024.

16
00:00:58,000 --> 00:01:01,000
So code Llama, what exactly it is?

17
00:01:01,000 --> 00:01:03,000
It is an amazing performing model in Code Llama.

18
00:01:03,000 --> 00:01:06,000
Uh, like, uh, they have launched three main thing.

19
00:01:06,000 --> 00:01:09,000
One is 70 billion parameter with the foundation code model.

20
00:01:09,000 --> 00:01:15,000
Python 70 specialized for Python code llama 70 b instruct 70 b, which is fine tuned for understanding

21
00:01:15,000 --> 00:01:17,000
natural language instruction.

22
00:01:17,000 --> 00:01:22,000
But if you want to understand what a code llama code llama is the state of art LLM capable of generating

23
00:01:22,000 --> 00:01:27,000
code and natural language about code from both code and natural language prompts.

24
00:01:27,000 --> 00:01:30,000
Okay, Code Llama is free for research and commercial use.

25
00:01:30,000 --> 00:01:35,000
As I said, it is a complete open source, so it will be very much good if you're also using for solving

26
00:01:35,000 --> 00:01:37,000
your own custom use cases.

27
00:01:37,000 --> 00:01:41,000
Okay, uh, and some more things if you want to know code llama also comes.

28
00:01:41,000 --> 00:01:44,000
It is a code specialized version of llama two.

29
00:01:44,000 --> 00:01:44,000
Okay.

30
00:01:44,000 --> 00:01:45,000
Llama two.

31
00:01:45,000 --> 00:01:49,000
So again the main base model, the the base model.

32
00:01:49,000 --> 00:01:50,000
The pre-trained model is llama two.

33
00:01:50,000 --> 00:01:54,000
On top of that, fine tuning is done specifically for related to code.

34
00:01:54,000 --> 00:01:57,000
And here you have the specific model.

35
00:01:57,000 --> 00:02:02,000
Now you can use this and you can probably use for different different languages like Python, C plus

36
00:02:02,000 --> 00:02:05,000
plus, Java, PHP, TypeScript, C-sharp and bash Bash bash.

37
00:02:05,000 --> 00:02:08,000
Okay, so let's go ahead and see how this code might work.

38
00:02:08,000 --> 00:02:11,000
And we'll try to develop an end to end solution.

39
00:02:11,000 --> 00:02:16,000
Now quickly to probably just show you what I'm actually going to do is that I'm going to open my command

40
00:02:16,000 --> 00:02:17,000
prompt.

41
00:02:17,000 --> 00:02:21,000
And as usual, as I said, I'm going to show you this with the help of Allama.

42
00:02:21,000 --> 00:02:24,000
So if you don't know about Allama, I've already uploaded a video.

43
00:02:24,000 --> 00:02:25,000
Right.

44
00:02:25,000 --> 00:02:31,000
Allama basically helps you to access all this kind of open source, uh, models, uh, LM models in

45
00:02:31,000 --> 00:02:31,000
your local.

46
00:02:31,000 --> 00:02:32,000
Quickly.

47
00:02:32,000 --> 00:02:34,000
You'll be able to execute it while you're doing the deployment.

48
00:02:34,000 --> 00:02:36,000
Also in the cloud.

49
00:02:36,000 --> 00:02:36,000
Anything.

50
00:02:36,000 --> 00:02:38,000
You can actually do it with the help of ulama.

51
00:02:38,000 --> 00:02:39,000
Okay.

52
00:02:39,000 --> 00:02:42,000
So first of all, uh, we'll go ahead and download this.

53
00:02:42,000 --> 00:02:44,000
So first to download Ulama again in windows.

54
00:02:44,000 --> 00:02:46,000
Also you have this now.

55
00:02:46,000 --> 00:02:48,000
So as soon as you download it just click on this.

56
00:02:48,000 --> 00:02:49,000
There'll be an exe file.

57
00:02:49,000 --> 00:02:55,000
And then you just double click on the exe file and start installing it Right when you install the Ulama

58
00:02:55,000 --> 00:02:57,000
it will be running in your background process.

59
00:02:57,000 --> 00:03:00,000
Okay now IP address I'll talk about the IP address.

60
00:03:00,000 --> 00:03:05,000
Also like localhost IP address it will be running up okay since it is an EXE file.

61
00:03:05,000 --> 00:03:09,000
Now once you have downloaded the ulama, if you probably go ahead and see in models.

62
00:03:09,000 --> 00:03:13,000
In ulama models there will be also a model which is called as code llama.

63
00:03:13,000 --> 00:03:13,000
Right.

64
00:03:13,000 --> 00:03:19,000
So a large language model that can be used text prompts to generate and discuss code quickly to check

65
00:03:19,000 --> 00:03:20,000
it out.

66
00:03:20,000 --> 00:03:28,000
What I will do I will open a command prompt and here I will write Llama run and let me see, uh, whether

67
00:03:28,000 --> 00:03:28,000
it is there or not.

68
00:03:28,000 --> 00:03:29,000
Code llama.

69
00:03:29,000 --> 00:03:32,000
So I will go ahead and click on Code Llama.

70
00:03:32,000 --> 00:03:37,000
So as soon as I hit this I have already downloaded the code within my local itself.

71
00:03:37,000 --> 00:03:41,000
So I will just be able to write any message and probably get the response.

72
00:03:41,000 --> 00:03:51,000
So let's say, uh, provide me a Python code to perform binary search.

73
00:03:51,000 --> 00:03:53,000
So this is my question.

74
00:03:53,000 --> 00:03:58,000
If I probably search it over here, you'll be able to quickly see that I'm able to quickly get the response

75
00:03:58,000 --> 00:04:03,000
along with the code right now, this entire thing, I'll try to create it as an end to end application,

76
00:04:03,000 --> 00:04:05,000
and we'll try to do it right now.

77
00:04:05,000 --> 00:04:08,000
This code llama is also a like a model itself.

78
00:04:08,000 --> 00:04:13,000
What I will do is that I'll create my own custom ChatGPT application, which will specifically be using

79
00:04:13,000 --> 00:04:14,000
the code llama.

80
00:04:14,000 --> 00:04:15,000
Okay, model.

81
00:04:15,000 --> 00:04:19,000
So quickly let's go ahead and open my VS code.

82
00:04:19,000 --> 00:04:22,000
So in the VS code you'll be able to see that I have a requirement dot.

83
00:04:22,000 --> 00:04:28,000
TXT file I've installed Lang gin and Gradio, so I'm going to use Gradio and lang in Gradio for the

84
00:04:28,000 --> 00:04:31,000
front end and engine which will be interacting with the ulama itself.

85
00:04:31,000 --> 00:04:32,000
Right.

86
00:04:32,000 --> 00:04:33,000
So all these things will be there.

87
00:04:33,000 --> 00:04:36,000
And first of all, I've also created an environment.

88
00:04:36,000 --> 00:04:38,000
I hope you know how to create an environment itself right.

89
00:04:38,000 --> 00:04:39,000
So quickly.

90
00:04:39,000 --> 00:04:43,000
Let me go ahead and open my app.py file.

91
00:04:43,000 --> 00:04:43,000
Okay.

92
00:04:44,000 --> 00:04:50,000
Now the first thing uh, along with the app.py file, since I am going to create my own custom models

93
00:04:50,000 --> 00:04:55,000
which will be using this entire code, I will create my model file right.

94
00:04:55,000 --> 00:05:00,000
So this model file I will go ahead and write from code llama.

95
00:05:00,000 --> 00:05:02,000
Okay, I hope the spelling is right.

96
00:05:02,000 --> 00:05:03,000
Let's see.

97
00:05:03,000 --> 00:05:03,000
Yeah.

98
00:05:03,000 --> 00:05:05,000
From code Llama okay.

99
00:05:05,000 --> 00:05:10,000
And this is what I specifically write with respect to custom application.

100
00:05:10,000 --> 00:05:10,000
Right.

101
00:05:10,000 --> 00:05:13,000
Because I want to create my own custom prompt okay.

102
00:05:13,000 --> 00:05:14,000
From Code Llama.

103
00:05:14,000 --> 00:05:18,000
The second thing what I am going to do is that I'm going to set the temperature.

104
00:05:18,000 --> 00:05:20,000
I want my model to be very much creative.

105
00:05:20,000 --> 00:05:22,000
So I will create a parameter over here.

106
00:05:23,000 --> 00:05:27,000
And this parameter will be nothing, but it will be a temperature uh, with one.

107
00:05:27,000 --> 00:05:28,000
Okay.

108
00:05:28,000 --> 00:05:33,000
So I'm going to set the value to one because I really want this application to be very much creative.

109
00:05:33,000 --> 00:05:33,000
Okay.

110
00:05:34,000 --> 00:05:39,000
Um, the next thing that I'm actually going to do over here is that I'm going to set the default system

111
00:05:39,000 --> 00:05:42,000
prompt, like how I want this code to behave.

112
00:05:42,000 --> 00:05:42,000
Okay.

113
00:05:42,000 --> 00:05:46,000
So here I will go ahead and write my system parameter.

114
00:05:46,000 --> 00:05:49,000
And this I'll be using three quotes.

115
00:05:50,000 --> 00:05:52,000
Now I will give my prompt over here.

116
00:05:52,000 --> 00:05:58,000
Okay so I'll say you are a code teaching assistant.

117
00:06:00,000 --> 00:06:05,000
Teaching assistant named as coder.

118
00:06:06,000 --> 00:06:08,000
Created by.

119
00:06:08,000 --> 00:06:12,000
Obviously myself, Krish C Nayak or Krish.

120
00:06:12,000 --> 00:06:13,000
Created by Krish.

121
00:06:13,000 --> 00:06:14,000
Okay.

122
00:06:14,000 --> 00:06:15,000
Or named as coder?

123
00:06:15,000 --> 00:06:16,000
I've already given over here.

124
00:06:16,000 --> 00:06:18,000
So I will say that.

125
00:06:19,000 --> 00:06:20,000
Or I'll say code guru.

126
00:06:20,000 --> 00:06:21,000
Okay.

127
00:06:21,000 --> 00:06:22,000
Created by.

128
00:06:23,000 --> 00:06:25,000
Created by Krish.

129
00:06:25,000 --> 00:06:25,000
Okay.

130
00:06:25,000 --> 00:06:27,000
And then I will say.

131
00:06:27,000 --> 00:06:28,000
Answer.

132
00:06:28,000 --> 00:06:33,000
answer all the code related question.

133
00:06:35,000 --> 00:06:37,000
Being asked okay.

134
00:06:37,000 --> 00:06:42,000
So this is uh, asked over here, right.

135
00:06:42,000 --> 00:06:44,000
So this is my simple system prompt that I have done.

136
00:06:44,000 --> 00:06:45,000
Okay.

137
00:06:45,000 --> 00:06:47,000
Now I have created my model file.

138
00:06:47,000 --> 00:06:54,000
The next thing what I will do quickly go ahead and find the I will open reveal this in this one folder

139
00:06:54,000 --> 00:06:56,000
and I will just take the folder name.

140
00:06:56,000 --> 00:06:58,000
I will open my command prompt.

141
00:06:58,000 --> 00:07:05,000
Okay, now I will run this and I will initiate this code guru right so quickly I will go and write CD,

142
00:07:05,000 --> 00:07:06,000
this one.

143
00:07:06,000 --> 00:07:07,000
Okay.

144
00:07:07,000 --> 00:07:09,000
Uh, let me go to my e drive.

145
00:07:09,000 --> 00:07:09,000
Okay.

146
00:07:09,000 --> 00:07:15,000
Now, in order to run this as your own custom model, what I will do, I will go to that path.

147
00:07:15,000 --> 00:07:21,000
And then if you go ahead and see in the GitHub, right, there are ways how you can specifically run

148
00:07:21,000 --> 00:07:22,000
by using ulama, right.

149
00:07:22,000 --> 00:07:28,000
So quickly I will go ahead and write this one C code create minus F model file.

150
00:07:28,000 --> 00:07:28,000
Right.

151
00:07:28,000 --> 00:07:35,000
So here I'm going to execute it like Allama create I will say code guru okay.

152
00:07:35,000 --> 00:07:38,000
Code guru minus f model file okay.

153
00:07:38,000 --> 00:07:39,000
So this is done.

154
00:07:39,000 --> 00:07:45,000
And model file Instead of writing model file I should write my correct name of the model file over here.

155
00:07:45,000 --> 00:07:47,000
What is model file itself.

156
00:07:47,000 --> 00:07:48,000
Small model file okay.

157
00:07:48,000 --> 00:07:49,000
Model file.

158
00:07:49,000 --> 00:07:51,000
Now this is what it is going to happen.

159
00:07:51,000 --> 00:07:55,000
The code llama is being used anyhow in those.

160
00:07:55,000 --> 00:07:55,000
Right.

161
00:07:55,000 --> 00:07:59,000
Because see at the end of the day what I am actually doing I'm using code Llama over here.

162
00:08:00,000 --> 00:08:00,000
Right.

163
00:08:00,000 --> 00:08:06,000
So I'm creating my own custom GPT type of application or Code assistant application over here, which

164
00:08:06,000 --> 00:08:08,000
is basically using the functionalities of Code Llama itself.

165
00:08:08,000 --> 00:08:09,000
Right.

166
00:08:09,000 --> 00:08:12,000
Or it will be using the LLM model in the back end as code llama.

167
00:08:12,000 --> 00:08:17,000
So if I probably execute it now, you can probably see over here that it is running fine.

168
00:08:17,000 --> 00:08:21,000
Now the next thing I will do over here is that llama or run.

169
00:08:22,000 --> 00:08:26,000
And I will just say code guru to just check whether it is working fine or not.

170
00:08:26,000 --> 00:08:27,000
So here is my code guru.

171
00:08:27,000 --> 00:08:30,000
I'll say hey, who are you?

172
00:08:31,000 --> 00:08:37,000
Okay, so here say hey, I'm Code Guru, an AI system designed to help code related queries and tasks

173
00:08:37,000 --> 00:08:40,000
and all and all who have created you.

174
00:08:41,000 --> 00:08:42,000
Who has created you?

175
00:08:43,000 --> 00:08:45,000
I do not say meta instead myself.

176
00:08:45,000 --> 00:08:45,000
Okay?

177
00:08:45,000 --> 00:08:48,000
I was created by Krish, a software engineer who is my also my developer.

178
00:08:48,000 --> 00:08:50,000
He is also trained on a wide range of programming languages.

179
00:08:50,000 --> 00:08:51,000
So and so and so.

180
00:08:51,000 --> 00:08:52,000
Okay, nice.

181
00:08:52,000 --> 00:08:55,000
So my code guru is running absolutely fine.

182
00:08:55,000 --> 00:08:58,000
Now let's go ahead and integrate with my app Dot Pi.

183
00:08:58,000 --> 00:08:59,000
Okay.

184
00:08:59,000 --> 00:09:02,000
Now uh, in order to start with the app dot Pi.

185
00:09:02,000 --> 00:09:08,000
Now see if somebody asked me anything that is related to this kind of code and I can want to quickly

186
00:09:08,000 --> 00:09:09,000
create a POC, right?

187
00:09:09,000 --> 00:09:10,000
I can actually do this.

188
00:09:10,000 --> 00:09:11,000
Right.

189
00:09:11,000 --> 00:09:17,000
So what I'm actually going to do over here is that quickly I will go ahead and import requests.

190
00:09:17,000 --> 00:09:17,000
Okay.

191
00:09:17,000 --> 00:09:21,000
Now I'm going to use the API like the llama is running in the back end.

192
00:09:21,000 --> 00:09:23,000
My code guru is also running in the back end.

193
00:09:23,000 --> 00:09:26,000
I just need to access it with the help of API.

194
00:09:26,000 --> 00:09:26,000
Right?

195
00:09:26,000 --> 00:09:28,000
So I'm going to import JSON.

196
00:09:29,000 --> 00:09:34,000
Uh, along with that I'm also going to import Gradio as cr.

197
00:09:34,000 --> 00:09:35,000
Okay.

198
00:09:35,000 --> 00:09:37,000
Gradio is also done.

199
00:09:37,000 --> 00:09:40,000
Now what I am going to use is my URL as usual.

200
00:09:40,000 --> 00:09:46,000
As I said, the URL that you are actually going to do right or get as in the form of API, and I have

201
00:09:46,000 --> 00:09:53,000
already referred the GitHub is this specific URL that is localhost colon 11434 slash API slash generate

202
00:09:53,000 --> 00:09:54,000
okay.

203
00:09:54,000 --> 00:09:56,000
And then I'm going to create my headers.

204
00:09:58,000 --> 00:10:03,000
Now inside this headers I will go ahead and write content type.

205
00:10:03,000 --> 00:10:08,000
And this will specifically be of application JSON.

206
00:10:08,000 --> 00:10:10,000
Write application JSON.

207
00:10:10,000 --> 00:10:13,000
Now where do you think I will be getting this information.

208
00:10:13,000 --> 00:10:19,000
Because if you go ahead down and see right, if you see like how you can actually call in the form of

209
00:10:19,000 --> 00:10:19,000
API.

210
00:10:19,000 --> 00:10:21,000
See this is the URL, right?

211
00:10:21,000 --> 00:10:23,000
And this is the prompt.

212
00:10:23,000 --> 00:10:25,000
This is the model name that you really need to give right.

213
00:10:25,000 --> 00:10:28,000
And in the messages you can also put roles and content.

214
00:10:28,000 --> 00:10:31,000
So I'm using that same API documentation over here okay.

215
00:10:31,000 --> 00:10:33,000
So quickly we'll go ahead and right.

216
00:10:33,000 --> 00:10:35,000
So content type it will be application JSON.

217
00:10:35,000 --> 00:10:45,000
And now I will create a function I will say generate underscore response okay generate response.

218
00:10:46,000 --> 00:10:49,000
And here I'm going to give my prompt okay.

219
00:10:51,000 --> 00:10:55,000
So whatever prompt I will give over here it will be able to give me the answer.

220
00:10:55,000 --> 00:10:55,000
Okay.

221
00:10:55,000 --> 00:10:58,000
So here I will write data is equal to.

222
00:10:58,000 --> 00:11:01,000
Now let me go ahead and create my body okay.

223
00:11:01,000 --> 00:11:02,000
Now for creating the body.

224
00:11:02,000 --> 00:11:05,000
The first parameter that you require is model name.

225
00:11:05,000 --> 00:11:07,000
As I said model name.

226
00:11:07,000 --> 00:11:10,000
Uh obviously what is my application that I've actually created?

227
00:11:10,000 --> 00:11:11,000
It is called guru I guess.

228
00:11:11,000 --> 00:11:11,000
Right.

229
00:11:11,000 --> 00:11:14,000
So I will write Code Guru because it is running in the back end.

230
00:11:14,000 --> 00:11:18,000
And then, uh, any prompt that I really want to give over here.

231
00:11:18,000 --> 00:11:21,000
So this will basically be my prompt over here.

232
00:11:21,000 --> 00:11:27,000
And with respect to this particular prompt, uh, let me just quickly go ahead and write final prompt.

233
00:11:27,000 --> 00:11:29,000
I'll just name it as final prompt over here.

234
00:11:30,000 --> 00:11:30,000
Okay.

235
00:11:30,000 --> 00:11:35,000
And as you all know, uh, this final prompt, I need to initialize it somewhere here.

236
00:11:35,000 --> 00:11:35,000
Okay.

237
00:11:35,000 --> 00:11:37,000
Uh, and before that, let me do one thing.

238
00:11:37,000 --> 00:11:43,000
I will also create a history so that it also makes sure that the previous information it it saves it.

239
00:11:43,000 --> 00:11:49,000
Okay, so here I will write history dot append and whatever prompt I'm specifically getting.

240
00:11:49,000 --> 00:11:51,000
That prompt will be coming over here.

241
00:11:51,000 --> 00:11:54,000
And the final prompt will be nothing.

242
00:11:54,000 --> 00:12:00,000
But since I need to make sure that that history gets appended or joined in a new line.

243
00:12:00,000 --> 00:12:03,000
So I will write slash n dot join.

244
00:12:04,000 --> 00:12:07,000
And here I'm going to basically write it as history.

245
00:12:07,000 --> 00:12:08,000
So here it is.

246
00:12:08,000 --> 00:12:09,000
Final prompt this.

247
00:12:09,000 --> 00:12:12,000
This is the final prompt has been appended in the prompt section.

248
00:12:12,000 --> 00:12:15,000
And then I will keep this parameter as stream is equal to false.

249
00:12:15,000 --> 00:12:21,000
Because if I keep the stream value, what it is going to happen is that it is going to give me in a

250
00:12:21,000 --> 00:12:23,000
lot of different, different values.

251
00:12:23,000 --> 00:12:28,000
Unnecessary values will also come, but I am super interested only in the, uh, output, right?

252
00:12:28,000 --> 00:12:30,000
What output I get in the form of response.

253
00:12:30,000 --> 00:12:33,000
So this is, uh, what is my generate response?

254
00:12:33,000 --> 00:12:36,000
Now, quickly, I can go ahead and write my response.

255
00:12:36,000 --> 00:12:38,000
Response is equal to.

256
00:12:40,000 --> 00:12:43,000
Request dot post.

257
00:12:43,000 --> 00:12:46,000
And inside this post I will give my URL.

258
00:12:46,000 --> 00:12:49,000
The headers is already set up okay.

259
00:12:49,000 --> 00:12:53,000
URL comma headers is equal to headers.

260
00:12:53,000 --> 00:12:54,000
Whatever headers.

261
00:12:54,000 --> 00:12:56,000
I'm actually set it up okay.

262
00:12:56,000 --> 00:13:03,000
Then my data will be JSON in the form of JSON dot dump dumps.

263
00:13:03,000 --> 00:13:05,000
I will give this specific data okay.

264
00:13:05,000 --> 00:13:08,000
Because I need to convert this entire data in the form of JSON.

265
00:13:08,000 --> 00:13:17,000
Once I get the response, uh, then what I will do, I will write if response dot.

266
00:13:18,000 --> 00:13:21,000
status code is equal double equal to 200, right?

267
00:13:21,000 --> 00:13:23,000
If it is successful in short.

268
00:13:23,000 --> 00:13:26,000
Okay then I'm going to take this response.

269
00:13:26,000 --> 00:13:30,000
And from this response I'm going to take the text whatever text output I'm actually getting.

270
00:13:30,000 --> 00:13:30,000
Okay.

271
00:13:31,000 --> 00:13:36,000
Uh quickly this will get replaced over here okay.

272
00:13:36,000 --> 00:13:37,000
Once I get this particular test.

273
00:13:37,000 --> 00:13:44,000
Then again I'll be using JSON dot loads and I will convert this back into this one.

274
00:13:44,000 --> 00:13:47,000
Okay, I will be loading this in the form of JSON itself.

275
00:13:47,000 --> 00:13:49,000
Okay, I have that response.

276
00:13:49,000 --> 00:13:53,000
And then from the actual response what I am going to do.

277
00:13:53,000 --> 00:13:58,000
So inside my data there will be another response parameter which I'm going to read it okay.

278
00:13:59,000 --> 00:14:03,000
And then I'm going to return this actual response.

279
00:14:03,000 --> 00:14:14,000
If the status is something else, then I will just give a return message saying that print error and

280
00:14:14,000 --> 00:14:19,000
this error will basically be having my response dot text.

281
00:14:20,000 --> 00:14:20,000
That's it.

282
00:14:21,000 --> 00:14:21,000
Perfect.

283
00:14:22,000 --> 00:14:25,000
So this is what is my function which is taking a prompt.

284
00:14:25,000 --> 00:14:26,000
It is using this code guru.

285
00:14:26,000 --> 00:14:31,000
And it is giving me based on the based on the input that I'm giving, it is giving some kind of response.

286
00:14:31,000 --> 00:14:34,000
Now this is my back end okay, complete back end.

287
00:14:34,000 --> 00:14:36,000
Now I need to create my front end okay.

288
00:14:36,000 --> 00:14:38,000
Now let's go ahead and create my front end.

289
00:14:38,000 --> 00:14:43,000
So this will be interface is equal to g r dot interface

290
00:14:45,000 --> 00:14:49,000
and g r dot interface.

291
00:14:49,000 --> 00:14:54,000
So here I'm going to create my function and go ahead and my write my generate response.

292
00:14:56,000 --> 00:14:58,000
Let me go ahead and quickly create my inputs.

293
00:14:58,000 --> 00:15:02,000
This will be a text box that I really want to use over here.

294
00:15:02,000 --> 00:15:06,000
Because at the end of the day, I need a text box where I give the input and another text box where

295
00:15:06,000 --> 00:15:07,000
I get my output.

296
00:15:07,000 --> 00:15:11,000
Okay, so in this text box I'll say number of lines.

297
00:15:11,000 --> 00:15:14,000
You can use it as two because 2 or 4 whatever you want okay.

298
00:15:14,000 --> 00:15:16,000
Four I'll give it max to Max.

299
00:15:16,000 --> 00:15:19,000
And then I'll also keep a placeholder.

300
00:15:19,000 --> 00:15:24,000
So placeholder is equal to enter your prompt.

301
00:15:25,000 --> 00:15:25,000
Okay.

302
00:15:25,000 --> 00:15:26,000
Perfect.

303
00:15:26,000 --> 00:15:27,000
Uh, this is done.

304
00:15:27,000 --> 00:15:30,000
And then finally what will be my output.

305
00:15:31,000 --> 00:15:33,000
The output pattern also will keep.

306
00:15:33,000 --> 00:15:35,000
It will also be a text form.

307
00:15:35,000 --> 00:15:35,000
Right.

308
00:15:35,000 --> 00:15:37,000
So whatever output we are going to get.

309
00:15:37,000 --> 00:15:42,000
And then I'm going to launch this interface launch.

310
00:15:44,000 --> 00:15:46,000
So that is how we launch in Gradio.

311
00:15:46,000 --> 00:15:47,000
So you need to have some basic idea.

312
00:15:47,000 --> 00:15:50,000
Anyhow I'll give you the entire code also.

313
00:15:50,000 --> 00:15:50,000
Okay.

314
00:15:50,000 --> 00:16:00,000
Now quickly let's run this and let me go ahead and write Python app dot p y I hope so, it should work.

315
00:16:01,000 --> 00:16:01,000
Hmm.

316
00:16:01,000 --> 00:16:04,000
Okay, we are getting an error over here.

317
00:16:04,000 --> 00:16:07,000
The reason is that I did not activate my env environment.

318
00:16:07,000 --> 00:16:08,000
So I will say conda.

319
00:16:10,000 --> 00:16:14,000
Activate v and v okay.

320
00:16:15,000 --> 00:16:22,000
Now what I will do I will quickly go ahead and install all my requirements okay.

321
00:16:22,000 --> 00:16:26,000
Now once the requirement has been installed you will be able to see that all the installment, all the

322
00:16:26,000 --> 00:16:27,000
requirements will get installed.

323
00:16:27,000 --> 00:16:32,000
The requirements is basically having this two library that is launching and gradio.

324
00:16:32,000 --> 00:16:38,000
And once I probably write this, then we are good to go and run this entire application in a very simple

325
00:16:38,000 --> 00:16:38,000
way.

326
00:16:39,000 --> 00:16:44,000
But at the end of the day, understand one thing how beautifully easily it becomes with the help of

327
00:16:44,000 --> 00:16:45,000
Allama.

328
00:16:45,000 --> 00:16:47,000
And again, we are also using code llama.

329
00:16:47,000 --> 00:16:52,000
See, at the end of the day guys, you really need to know multiple models quickly to practice to create

330
00:16:52,000 --> 00:16:53,000
a pox in companies.

331
00:16:53,000 --> 00:16:55,000
they are looking for all this kind of skill sets.

332
00:16:55,000 --> 00:16:57,000
It is good that you know multiple models.

333
00:16:57,000 --> 00:16:59,000
You have the knowledge of multiple models and all.

334
00:16:59,000 --> 00:17:03,000
Okay, so uh, please make sure that you keep on practicing.

335
00:17:03,000 --> 00:17:07,000
I have been trying really hard to upload new videos for you.

336
00:17:07,000 --> 00:17:13,000
Every day I try to come up with something new, something informative, you know, which will be beneficial

337
00:17:13,000 --> 00:17:13,000
for your site.

338
00:17:13,000 --> 00:17:15,000
So please make sure that you practice.

339
00:17:15,000 --> 00:17:16,000
Keep on practicing.

340
00:17:16,000 --> 00:17:21,000
Uh, unless and until you don't practice more, you won't be able to become a pro in that.

341
00:17:21,000 --> 00:17:25,000
Okay, so we'll wait for some time till this requirement dot txt is getting installed.

342
00:17:25,000 --> 00:17:30,000
I think another uh 10 to 15 seconds and then we will go ahead and run this app dot pi.

343
00:17:30,000 --> 00:17:34,000
So guys now you can see the requirement dot txt is installed.

344
00:17:34,000 --> 00:17:37,000
So let me quickly go ahead and do one thing.

345
00:17:37,000 --> 00:17:41,000
Let me clear my screen okay.

346
00:17:41,000 --> 00:17:45,000
Now quickly let me go ahead and run Python app Dot Pi.

347
00:17:45,000 --> 00:17:51,000
And now I think you should be able to see, uh, the UI part with the help of Gradio and all, and we'll

348
00:17:51,000 --> 00:17:54,000
try to see the application whether it is running fine or not.

349
00:17:54,000 --> 00:17:55,000
Um, okay.

350
00:17:55,000 --> 00:17:56,000
Outputs.

351
00:17:56,000 --> 00:17:56,000
Okay.

352
00:17:56,000 --> 00:17:57,000
Output is missing.

353
00:17:57,000 --> 00:17:58,000
Let's see.

354
00:17:58,000 --> 00:17:58,000
Okay.

355
00:17:58,000 --> 00:17:59,000
This should be outputs.

356
00:17:59,000 --> 00:18:00,000
No worries.

357
00:18:01,000 --> 00:18:05,000
Now to okay Python app dot pi.

358
00:18:05,000 --> 00:18:07,000
Now it should be working absolutely fine.

359
00:18:07,000 --> 00:18:09,000
I should be able to get an API.

360
00:18:09,000 --> 00:18:10,000
So here it is.

361
00:18:10,000 --> 00:18:12,000
Let's open this.

362
00:18:14,000 --> 00:18:19,000
So here you can see this amazing front end Gradio application.

363
00:18:19,000 --> 00:18:22,000
And let me please.

364
00:18:23,000 --> 00:18:24,000
Hello.

365
00:18:24,000 --> 00:18:26,000
Who are you?

366
00:18:26,000 --> 00:18:27,000
Okay.

367
00:18:27,000 --> 00:18:29,000
And I should be able to submit it.

368
00:18:29,000 --> 00:18:33,000
And here on the right hand side, you can see that I'll be able to get the response.

369
00:18:33,000 --> 00:18:33,000
Okay.

370
00:18:33,000 --> 00:18:34,000
I'm a code guru.

371
00:18:34,000 --> 00:18:37,000
You co teaching teaching assistant.

372
00:18:37,000 --> 00:18:38,000
Your code created by Krish.

373
00:18:38,000 --> 00:18:38,000
Okay.

374
00:18:38,000 --> 00:18:39,000
Perfect.

375
00:18:39,000 --> 00:18:51,000
Provide me Python code to perform binary search d d d d.

376
00:18:51,000 --> 00:18:51,000
dee.

377
00:18:53,000 --> 00:18:53,000
Okay.

378
00:18:57,000 --> 00:19:00,000
And here is what I should be able to get the response.

379
00:19:00,000 --> 00:19:03,000
So how fast it is amazing.

380
00:19:03,000 --> 00:19:03,000
Okay.

381
00:19:05,000 --> 00:19:06,000
You can probably see over here.

382
00:19:07,000 --> 00:19:09,000
Definition here is a Python implemented.

383
00:19:09,000 --> 00:19:10,000
Perfect.

384
00:19:10,000 --> 00:19:13,000
Provide me let's say Java code.

385
00:19:13,000 --> 00:19:15,000
If I write, should I be able to get the answer?

386
00:19:23,000 --> 00:19:25,000
Provide me a Java code.

387
00:19:25,000 --> 00:19:25,000
Okay, perfect.

388
00:19:25,000 --> 00:19:28,000
I am able to get the Java code also.

389
00:19:29,000 --> 00:19:30,000
Uh, this is Python.

390
00:19:30,000 --> 00:19:30,000
Okay.

391
00:19:30,000 --> 00:19:31,000
This is Java.

392
00:19:31,000 --> 00:19:33,000
Oh history is also getting added C oh yeah.

393
00:19:33,000 --> 00:19:34,000
So this is Python.

394
00:19:34,000 --> 00:19:35,000
This is Java.

395
00:19:36,000 --> 00:19:40,000
Provide me uh let's see.

396
00:19:40,000 --> 00:19:45,000
Provide me Provide me a Python code.

397
00:19:47,000 --> 00:19:50,000
To create Adam optimizer.

398
00:19:51,000 --> 00:19:51,000
This is difficult.

399
00:19:51,000 --> 00:19:52,000
Okay.

400
00:19:53,000 --> 00:19:58,000
Obviously we use the library, but I think we should be able to get the output.

401
00:19:58,000 --> 00:19:59,000
But this is good.

402
00:19:59,000 --> 00:20:02,000
Write your own custom code assistant.

403
00:20:02,000 --> 00:20:04,000
You know, so I can probably keep it running over here.

404
00:20:04,000 --> 00:20:10,000
And whenever I'm implementing something, I should be able to quickly write anything that I want and

405
00:20:10,000 --> 00:20:11,000
get the answer itself right.

406
00:20:11,000 --> 00:20:12,000
So here it is.

407
00:20:12,000 --> 00:20:14,000
Adam is an optimization algorithm.

408
00:20:14,000 --> 00:20:18,000
This this this perfect here is all your answer, right.

409
00:20:19,000 --> 00:20:27,000
Uh, provide me a Python code to perform Fibonacci series.

410
00:20:30,000 --> 00:20:32,000
Let's see, I'll submit it.

411
00:20:33,000 --> 00:20:35,000
So I hope you like this particular video.

412
00:20:35,000 --> 00:20:37,000
I hope you're able to enjoy it.

413
00:20:37,000 --> 00:20:43,000
Now you can also create your multi-language code assistant, multi programming language Code assistant

414
00:20:43,000 --> 00:20:45,000
with the help of Code Llama which is completely open source.

415
00:20:45,000 --> 00:20:47,000
So yes, this was it.

416
00:20:47,000 --> 00:20:48,000
Uh, you can probably see all the answers are here.

417
00:20:48,000 --> 00:20:50,000
Java code is everything is available.

418
00:20:50,000 --> 00:20:51,000
Great.

419
00:20:51,000 --> 00:20:53,000
And history also is also getting appended.

420
00:20:53,000 --> 00:20:54,000
This is very very nice.

