This README will guide you through the setup and usage of the Langchain with Llama 2 model for pdf information retrieval using Chainlit UI.
- Python 3.9 or higher
- Required Python packages (you can install them using pip):
- langchain
- chainlit
- sentence-transformers
- faiss
- PyPDF2 (for PDF document loading)
-
Clone this repository to your local machine.
git clone https://github.com/d-t-n/llama2-langchain-chainlit-pdf.git cd llama2-langchain-chainlit-pdf
-
Create virtual environment (conda recommended):
conda create -n langllmpdf python=3.10 conda activate langllmpdf
-
Install the required Python packages:
pip install -r requirements.txt
-
Use your HuggingfaceHub API key (from this URL) in the .env file
HUGGINGFACEHUB_API_TOKEN=your_huggingface_api_token
-
Put your pdf files in the data folder and run the following command in your terminal to create the embeddings and store it locally:
python ingest.py
-
Run the following command in your terminal to run the app UI (to choose ip and port use --host IP and --port XXXX):
chainlit run bot.py -w --host 127.0.0.1 --port 9001
-
Ask any question about the pdfs