This experimental project aims to create a localized chatbot. The bot is designed to answer questions from a stored collection of files in PDF, TXT, DOC, and DOCX formats.
The project utilizes FAISS for similarity search and Falcon7b LLM for language modeling from Hugging Face. Code is written in Python, using the Langchain framework. Poetry for dependancy management and Streamlit for it's UI.
In order to run the chatbot, you need a valid API key for Hugging Face. To generate one, sign-in to Hugging Face, or create an account if you don't already have one. Navigate to your profile 'Access Tokens' and generate a new token with 'read' access.
Create a new file ./podgpt/.env
and paste in your API token here. There is an .env.example
file there already for you to use as a template.
# copy code locally
git clone https://github.com/podrob/podgpt
cd podgpt
# build image
docker build -t podgpt .
# run container via docker-compose
docker-compose up
Before getting started, ensure that you have the following installed on your system:
Python 3.x: You can install it on macOS using Homebrew. Open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python
Poetry: To install Poetry, run the following command in your terminal:
curl -sSL https://install.python-poetry.org | python3 -
Clone the repository:
git clone https://github.com/podrob/podgpt
cd podgpt
Install dependencies using Poetry:
poetry install
This will create a virtual environment and install all the required packages.
To run the project locally, follow these steps:
Activate the virtual environment created by Poetry:
poetry shell
Run the Streamline server:
streamlit run podgpt/Home.py
Access the chatbot at http://localhost:8501 in your web browser.
The project uses FAISS (Facebook AI Similarity Search))for efficient similarity search via embeddings.
Falcon7b LLM is used for language modeling. The project has the capacity to inject in alternative LLMs via the use of an abc Abstract Base Class in podgpt/components/llm.py
Rob McBryde (@podrob)
This project is licensed under the MIT License - see the LICENSE.md file for details.