A PDF search application that uses embeddings and a language model to answer questions about the content of your PDF documents.
This project provides a Streamlit web interface that allows users to ask questions about PDF documents uploaded to the system. It uses:
- LangChain for document processing and retrieval
- Hugging Face embeddings (all-MiniLM-L6-v2) for vectorization
- LaMini-T5-738M model for generating answers
- ChromaDB for vector storage
- Streamlit for the web interface
- Clone the repository
- Install dependencies:
pip install langchain langchain-community langchain-huggingface streamlit transformers torch chromadb accelerate - Download the LaMini-T5-738M model from Hugging Face
- Create a
docsfolder and add your PDF files
-
First, ingest your PDF documents:
python ingest.py -
Run the web application:
streamlit run app.py -
Enter your questions in the text area and click "Get Answer"
ingest.py: Processes PDF files and creates vector embeddingsapp.py: Streamlit web application for asking questionsdb/: Directory where ChromaDB stores vector embeddingsdocs/: Directory where PDF files should be placed
Make sure you have enough system resources to run the language model. The application uses model offloading to manage memory usage.