This project is a Streamlit application that leverages large language models and libraries such as Langchain, OpenAI, and Hugging Face to interact with multiple PDFs.
The following libraries are required for this project:
- streamlit
- pypdf2
- langchain
- python-dotenv
- faiss-cpu
- openai
- huggingface_hub
-
Clone the repository
git clone <repository-url> cd chat-with-multiple-pdf
-
Create a virtual environment
-
Windows
python -m venv .venv .\.venv\Scripts\activate
-
macOS/Linux
python3 -m venv .venv source .venv/bin/activate
-
-
Install the dependencies
pip install -r requirements.txt
-
Create an
.env
fileIn the root directory of the project, create a file named
.env
and add the following lines with your actual API keys and tokens:OPENAI_API_KEY=your_openai_api_key HUGGINGFACE_API_KEY=your_huggingface_api_key HUGGINGFACE_API_TOKEN=your_huggingface_api_token PINECONE_API_KEY=your_pinecone_api_key PINECONE_INDEX_NAME=your_pinecone_index_name PINECONE_ENVIRONMENT=your_pinecone_environment
-
Run the application
streamlit run app.py
This will start the Streamlit application and you can view it in your browser.
Ensure you have a .gitignore
file to exclude unnecessary files from the repository. Below is an example:
```plaintext
# Virtual environment
.venv/
venv/
ENV/
env/
# Python bytecode files
__pycache__/
*.py[cod]
*$py.class
# Environment variables
.env
# Jupyter Notebook checkpoints
.ipynb_checkpoints
# VS Code settings
.vscode/
# macOS system files
.DS_Store
# Windows system files
Thumbs.db
Desktop.ini
# PyCharm
.idea/
# Log files
*.log
```