Hello guys!
Now we have developed so many different applications.
Now I will just try to show you how you can go ahead and deploy this kind of applications.
So from all these examples you can take up any example that you want.
But I will go ahead and take this particular search engine which I had actually developed.
So I will go into its file.
Right.
So when I probably go over here you'll be able to see all these files I have actually arranged in this
way.
So this is my V and V folder and this is my requirement dot txt.
Now to start the work over here.
What I am actually going to do is that I will take this requirement dot txt I will copy this inside
this particular folder.
And this is what is my search engine right now.
Let me just go ahead and deploy this entire application in a Streamlit web app or Streamlit cloud.
Okay, so since this is a Streamlit web app, I will try to go ahead and show you first the deployment
with Streamlit Cloud.
So I will just go ahead and type Streamlit Cloud okay.
And I will go ahead and hit enter.
Let me just go ahead and write over here Streamlit cloud.
And now here you'll be able to see that Cloud Streamlit a faster way to build and share data apps.
But before that, let me go to my GitHub account.
Now, inside this particular GitHub account, I hope everybody has this particular account itself.
I will go ahead and create my new repository.
Right.
So let me just go ahead and click on New Repository here I'm going to go ahead and write my search engine
okay.
Search engine LM.
I will just go ahead and write like this.
Then I will add a readme file, and let's say I'm going to add a license of General Public License.
You can select any one that you like.
I will go ahead and click on the repository.
One thing you should understand the reason why I'm using this Streamlit cloud.
Because you will be able to deploy any number of apps over here.
And, uh, you can probably go ahead with the specific deployment.
Now over here inside this particular search engine, I will just go ahead and open my folder.
This is one okay.
I will quickly go ahead and select all these files.
Drag and drop it inside this okay.
So quickly I will go ahead and drag and drop it okay.
And I know I don't even require this ipynb because I just require this app.py and requirement dot txt.
So let me just close this and let me commit the changes.
So once I commit the changes now I have my entire URL.
Now quickly let's go to the Streamlit cloud and I will go ahead.
And first of all sign in here.
You will be able to deploy any kind of Streamlit web app in a much more easier way.
Let it be an generative AI application, let it be a machine learning application.
Anything as such.
So here you can see some of the examples that I have already uploaded.
Okay.
Um, there are a lot of advantages of using this because anyhow, you don't have to pay anything, uh,
with respect to the deployment.
And you'll also be able to get one kind of URL.
But at the end of the day, you'll be having the streamlit.io at the end.
Okay.
So I will go ahead and click on create app.
And uh, it will say that hey, do you already have an app.
So over here it has an option to integrate with the GitHub.
So I will go ahead and click this since I have uploaded in the GitHub.
And as soon as you probably click on GitHub right, it will first of all ask you for the authentication
okay.
So please make sure that you do the authentication with your GitHub account.
You need to have a GitHub account for that.
Now after this I will just go ahead and search for my GitHub URL over here in my repository.
So here you can see Krish Nayak zero six search engine LM and this is my branch main.
I'm in my branch main.
My main file is app dot p y.
So I will just go ahead and click over here and hit on app dot p y.
Please make sure that you need to have a requirement dot.
TXT file over here.
Otherwise it will not understand what all uh environment variables or are.
What?
All libraries it basically requires, right?
So you need to have this specific thing installed.
Now I will go over here and this is the domain that it is showing me.
I will be able to use with this particular domain.
I'll be able to use my web app.
Now along with this, let's say you also need to add some kind of key value pairs, right?
Let's say you want to add some secret keys.
You can just go ahead and give a secret key name is equal to whatever name you have.
You can probably go ahead and display it in this particular manner once you upload it by default.
Here you can see you are having Python three version 3.11.
I'll be using this particular version.
And along with this, uh, any key value pairs like how we have key value pairs over here.
Right.
Like OpenAI API key, my lang chain API key lang chain project access token.
I can also give this particular key by just copying and pasting it over there.
But in order to access this, you know, in my API, if I'm using this key anywhere, I just need to
use s t dot secret.
Okay, I have to use something like this s t dot secret and give my secret key name over here.
Right?
With respect to any keys that I'm actually using, which is put inside my Streamlit cloud.
Let's say if I'm using a chef token, right, I may copy this entire key over here.
I may paste it over here.
Okay.
And then what I will do, I will go ahead and save this.
Now, you know I'm using chef underscore token.
Let's say if I go ahead and save this.
Now here I've just added one secret.
Now in order to access it in my app Dot Pi, I will just go ahead and write SD dot secrets okay.
And this how I will be able to access this.
Okay, so if you really want to know more about it just go ahead and search for Streamlit secrets.
Okay.
And here you will be able to see secret management SD dot secrets.
Right.
If you probably go ahead and use this.
So let's say you are given me a open API.
Open API key.
You just need to write SD dot secrets with respect to, uh, your open API key.
Write open API key over here.
So in your Streamlit app the following values would be true.
Right?
Which is equal to your open API key.
So just by using this particular code you'll be able to use it.
But right now the application that I've actually created, you'll be able to see.
And let me just do one thing before I run this.
Also, I'll remove it because here I don't require any secret key because from the front end I will
be putting my hugging face API token or any token that is required.
Okay.
And here I'm actually using this hugging face endpoint also right to access any kind of things.
Um, so this is my entire, uh, okay.
This, uh, I'm in the wrong tool.
Okay.
This is my API, right?
So in this particular case, you'll be able to see that I'm not using any, any, any kind of secret
key.
I'm just typing it from the front end.
Okay.
My grok API key.
So now what I'll do I'll just go ahead and deploy this okay.
So once I deploy this you'll be seeing that in the back end.
First of all it will go ahead and install all the requirement dot txt first of all right.
So the deployment is very much simple with the help of Streamlit app.
Right.
So now here you'll be able to see that the deployment is basically happening.
And with respect to the deployment over here you will be also seeing that the requirement dot txt will
get installed in the back end.
Okay.
So once it gets installed you will be able to see your entire application okay.
So this is the most easiest way to probably do it.
Uh for before that what I will do quickly I will go to my env file.
Now let me go back to my env file.
I will take this grok API key because this is what I will be required in my application.
Right.
So again based on the requirement dot txt it will take some amount of time.
And let's wait for that time to, you know, do the installation of all my libraries and packages that
I required for that particular project.
And once it does, my project will be ready.
Now you can see the requirement dot txt has run.
And here is my entire Streamlit app right now.
This is how amazing and easy it is.
So I'll just go ahead and copy paste my API key over here.
Once I press enter, I should be able to ask any question.
Okay, tell me about machine learning.
Now here I have created my search engine using agents.
Right.
So here you can see Wikipedia is just thinking okay then Wikipedia invalid tool name some invalid tool
name here it is basically coming.
Search arXiv.
None is a valid tool.
Try one.
So finally you'll be able to see that from search and from RC.
We are not able to get this information, so it will try to give me the information from uh, machine
learning.
Right.
So machine learning is a field of study in artificial intelligence.
Lets me do one more thing.
Let me just go ahead and search for attention is all you need.
Research paper.
So here you can see the number.
It is nothing.
But, uh, I will just search for this.
Ah.
If this particular code.
Okay, so if I go away and search for it, I should be able to get my answer.
So now it is going to my arXiv.
It is probably communicating over here okay.
And here you can see again uh it is probably and finally, you get this particular input, right?
Oh, tell me about generative AI.
I will just go ahead and ask this particular question and see how the cloud is probably providing this
entirely, completely for free.
So you can go ahead and probably do this right.
So here you can see machine learning, generative AI, Wikipedia.
All the communication is specifically happening.
Again, we do not have to probably go to arXiv also because this tool will be more than sufficient with
respect to giving your output right.
And to know more details about it here you can see the user is asking about machine learning and generative
AI.
So both this information, the chat history is also basically being used.
Right.
And here you can probably see everything as such.
Right.
Um, so I hope uh, you were able to understand this deployment technique, uh, one more, uh, deployment
mechanism that I would definitely like to show is from hugging Face, which is nothing but this specific
spaces.
Okay, so I will show you how you can go ahead and create your own space.
Now space, uh, hugging face space is something very amazing.
Hugging face.
It provides some amount of face with respect.
Uh, some amount of space or deployment, uh, server for you all so that you will be able to deploy
your entire Application, and you'll be able to use it completely over here and deploy with the URL
itself.
Right.
So let's say there are so many spaces over here.
If I go ahead and click on any one of them, right.
Let's say I will go ahead and click on this.
Open a leaderboard instead of using a leaderboard.
Let's see right now everything is running on zero.
So if I just go ahead and click this right.
So here you can see ID documentation recognition.
You can drop this particular image over here right like this.
And I can probably go ahead and click on Check Document Details.
And I will be able to get all the information.
So this entire deployment is specifically happening in the hugging face space itself.
Right.
So similarly what I will do is that I will take this entire application and deploy it over there itself,
and let's see what exactly we'll be able to get it or not Okay.
But again, if I talk about hugging face spaces, uh, you can read more about it.
Hugging face spaces.
Okay, so here you will be able to discover and many people usually upload this.
Right.
And you'll also be able to deploy your entire application.
So that is what we are going to see in the next video.
So I hope you like this particular video with respect to the deployment.
I will see you all in the next video.
Thank you.
Take care.
Have a great day.