How To Create Medical Chatbot Using BioMistral, Ollama, LangChain & Chainlit

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome back in this video let's talk about biom mistol a collection of Open Source pre-trained large language models for medical domains right one of the viewer mentioned that how we can use the biom mistol with olama because if you go to the 's website and if you go to the models and if you now search here bio mistol it is not there right so my plan here is to take the biom mistol model from hugging fish you can just go ahead and SCE for biom mistal I will take one of the model from there and create a biom mistal model locally using AMA so as you can see here I have already created the biom mistal latest I will show you how to do this and after we create the biom Mistral what we can do is then run a simple chain lead application like this where we can ask the question related to Medical Medical Science and then it will provide the answer for us similarly I will also show you how to use the same model in the open wave UI I have already created the video about this and yeah that's all and I will also show you the code which I'm going to use the one that I have already used before for this Lang chain Gemma AMA chain lead by just changing one line of code here you can achieve the simple chain lad application let's get started okay now let's go with the first step first step is to go to the hogging face website and then find the bio mistol model right there is the description here of biom mistol you can just read this and also I will provide the link of this archive link here you can just go ahead and see the the main idea of this is that there are many large language models out there open source ones but they are not let's say tailored for the health context adapting the general purpos anms only so they created this biom by the way there are other uh models also for example if you go and just type medical there are already made Lama 2 and meditron also we can we can even go and download this and try which one performs the best right but now I will go to the hugging face website and here you can just go and search bio mistol so I will do biom mistol right so now you can see there are different models one from the biom mistol themselves and there is also the data sets spaces also available where you can go and check these different models you can go with any of this let's let's go with the ggf from bio Mist right you can click this one and it will take you to this particular place and you can see what is bio M here in depth again there are 58 downloads you can just download this or download other models if you want for example if we go again to bio mol and there is one we one from majar panahi where there is already 253 downloads right you can just go with any of those these are the ggf versions of this particular model as it shows here model Creator is biomol original model these are the descriptions what you can do now is go to files and then download the one that you want to download I have already downloaded this if I now go to the terminal and now if I go here and if I do LS so you can see here I downloaded Z Q5 km right if I go to the website this is Q5 km where it is this one you just go here and click the download icon once this is downloaded what you can do is create a model file in this location or you can create in any location but it should point to this model right so let's see what is inside this model file in the model file as you can see here I'm saying okay model file and from I pointing to this model so gml model Q5 km ggf dot slash meaning that it is from this particular directory I'm giving the parameter stop parameter stop I start I end and this is the template which is which is the most important part here because you need to tell this model how to behave or what is the template and this this can be different for different models this is the one for mistol so it can be different for Lama 2 or other different models once this is done what you can do here is just create the model so how to create the model so you can just do AMA and create biom mistal so B IO mistal so if I do this biomist let me give one because I already have created the biom mistal so I said AMA create biom mistal one and one thing to notice is you need to already have the olama installed in your machine without install ining of course you can run this right when I run inter now as you can see here it is going to create a new model called biom mistol one it is already created now if I go here and do all list you can see that there was this bio mistol created 1 hour ago and now 9 seconds ago it is created bi mistal 1 and it is 5.1 GB of size how to run this now you can just do o Lama run by mol one right if I do this and now you can ask the questions to ask the questions what we can do is we can go to this 's website and take some examples from this other medical domained models right so here there are some of the examples so we can just copy this contrl C you can go to the terminal here and we can do control V and yeah the common call is caused by this this this so This Is The Answer that it provides now I have already also downloaded this made Lama too which is in this ama's website here as you can see medl and meditron right for this what you can do is just run this AMA run and you can ask the question and here is also the question example for example if you want to ask different different things I can copy this and now if I go to the terminal and I can ask the same question for this another model and run inter so yeah the patient may have Co 19 and something like this you get the idea and yeah this is biomist one if I want to go out I will do buy now let me ask the same thing with as you can see I have already this made Lama to so I can just go here and say o Lama Ron made Lama 2 right and I can ask the same questions because I have already downloaded this here and it says send the message I will copy again this one I will go here here and I will just do control V and now you have another model that is giving some different answer as you can see it says that okay what symptoms suggest COPD which is characterized by chronic inflammation so you get the answer here this suggest it might be covid-19 this suggests it might be something else right it now depends upon your domain knowledge what is this right because this medical language models I'm not expert in the medical language field but you get the idea different models different answer you need to be smart enough to know okay what is this so you can just take this as a helper helper model right I will just do here by and I'm out from this so this is how you can run this locally from the terminal right but many of you also maybe want to run this in a goodlook chat you for that what I did here in the same thing I go to this chain lit I have already run this but I will do contrl c cancel I'm just using this Lang chain Gemma chain lit repository which I created before I already install the necessary packages I have the virtual environment already here and the code that is it is powering is here as you can see the same code is here and I just gave the model here with AMA model and bio Mistral you can change these models as you want now I will go to the terminal and here I will run chain lead run the same file here it is going to run locally so I can go here and ask the questions I have already asked some of the questions okay what causes the seasonal flu just go here and run it will provide the answer okay seasonal flu this this this kind of things now you can go here and ask as many questions as you want right I have this same question of 35 year old you can go here and ask and you can see the same answer is provided in the UI also so this is how you quickly can run in in the chain lad applications but then again if you want to test different models very quickly what you can do is this open wave UI I have already created a video about open wave UI so you can just go through that how to run this but from here as you can see you can just choose the models what you want if I go to this new chart here I can choose different models so this is the thing really good UI where you can switch between different models so now I have this biom mistol thing here and I can go here and ask the same question and I'll create a new chat again and I will go here choose the model biom Mistral and here I will do control V enter so it will provide the uh answer for me and now let's say that you want to change uh the model quickly create a new model go here and choose Med Lama 2 and now ask the same question here it will provide the answer so you get the idea between these different models how you get the answer so yeah that's all for this video I hope now you get the idea how to let's say create a model from hugging face this is really good because once you know these concepts of creating models from hugging fish you can just use any models from the hugging Fish website create a new model locally use that with AMA and now now I just showed you how to do this in a simple looking chat UI right but what you can even do is create a rag applications I have already shown you before how to create the rag applications using the uh AMA models just give a try upload some PDFs or some other documents that you have and ask the questions related to that document thank you for watching and see you in the next video
Info
Channel: Data Science Basics
Views: 3,444
Rating: undefined out of 5
Keywords: openai api, code, chat ai, large language models, llm, chat, langchain, langchain explained, openai langchain, what is langchain, langchain tutorial python, chat models, prompt, chain, agents, langchain use case, chatgpt like ui, chainlit, web framework, open source model, ollama, chat ui using ollama langchain, run llm locally, langchain ollama, biomistral, ollama biomistral, run biomistral locally with ollama, biomistral chat ui, huggingface, huggingface biomistral, medical model
Id: bANziaFj_sA
Channel Id: undefined
Length: 10min 51sec (651 seconds)
Published: Sat Mar 02 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.