BayMax is a medical care assistant, powered by an LLM, that can answer questions related to medicines (in this case, but can be used over any of the documents that you want to run it over) and it gives the answers by fetching the facts given in the data in realtime, thus making it a very fast and efficient chatbot.
- The model successfully runs on a laptop with 16GB of RAM and 6GB of VRAM
- Run on baremetal (both on laptops and mobile phones)
- Doesn't need any sort of internet connection
- Doesn't hallucinate over random knowledge as it uses the facts provided in the data to generate the answer
- Data Agnostic : Can be used over any of the documents that you want to run it over as it uses RAG technique and doesn't need any sort of finetuning
- We first create the vector database using
MiniLMembeddings andFaissindexing - Then we use
RAGto fetch the answers from the database by converting the Queries given by the user into embeddings and then usingFaissto fetch the top 5 most similar embeddings and then usingRAGto fetch the answers from the database - We then send these answers to the model (here we have used quantized Mistral 7B) along with the original query to generate the final answer.
- In the webapp, if the user chooses the option to use the context from the data that has been provided, then we also show the context which the model has used to generate the answer to cross verify the legitimacy of the answer
- Adding more models
- Using the links in the mashqa dataset and provide them in the context as well to give one more step for the users to cross verify the answer and check the legitimacy of the answer given by the model
- Adding more data to the dataset to make the model more robust
- Install the dependencies using
pip install -r requirements.txt - Unzip the dataset from mashqa.zip and place it in the
datafolder. - Run data_preprocess.ipynb notebook to clean the data and store it in the
cleaned_datafolder - Run RAG.ipynb notebook to create the vector database and store it in the
vector_dbfolder - The quantized
.ptlfile forPyTorch Mobilebased android application can be downloaded from here. To create your own.ptlfiles, use Create_PTL.ipynb'.
as part of Megathon '23