Welcome to the end-to-end medical chatbot project using Llama2! This project leverages the power of Meta's Llama2, LangChain, and Flask to create a highly knowledgeable and responsive medical assistant. The chatbot is designed to provide detailed answers to medical queries by integrating Mongo Atlas for vector search and Hugging Face models for inference.
Start by cloning the repository to your local machine and go to root folder.
repo https://github.com/Arjunhg/MediDoc.git
cd your-repository
Open the repository and create a Conda environment.
conda create -n medidoc python=3.8 -y
conda activate medidoc
Install all the necessary dependencies from the requirements.txt file.
pip install -r requirements.txt
Create a .env file in the root directory and add your Pinecone or MongoDB credentials.
MONGO_URI="your_mongo_uri"
DB_NAME="your_db_name"
COLLECTION_NAME="your_collection_name"
INDEX_NAME="your_index_name"
MODEL_PATH="your_model_path"
Download the quantized Llama2 model and place it in the model directory.
# Download the Llama 2 Model:
llama-2-7b-chat.ggmlv3.q4_0.bin
# From the following link:
https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/tree/main
Finally, run the application:
python app.py
- Python: The core programming language used for the backend logic.
- LangChain: Utilized for creating the language model chain.
- Flask: A lightweight WSGI web application framework for Python.
- Meta Llama2: The model used for generating responses.
- Mongo Atlas Vector Search: Used for storing and searching vectorized documents.
- Hugging Face: Provides pre-trained models for inference.
This project is licensed under the MIT License - see the LICENSE file for details.