This Streamlit application allows users to upload a PDF and ask questions about its content. The application uses Cohere's LLM, HuggingFace embeddings, and Chroma vectorstore to retrieve relevant information from the PDF and generate answers.
- Upload a PDF file.
- Enter your Cohere API key.
- Ask questions about the uploaded PDF.
- Get answers based on the PDF content.
- Python 3.8 or higher
- Streamlit
- PyPDF2
- LangChain libraries
- HuggingFace Embeddings
- Cohere API Key
-
Clone the repository:
git clone https://github.com/meakshayraut/cohere-rag.git cd cohere-rag
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit application:
streamlit run app.py
-
Open your browser and go to
http://localhost:8501
. -
Enter your Cohere API key in the sidebar.
-
Upload a PDF file using the file uploader.
-
Ask questions about the PDF in the chat input.
app.py
: Main application file.requirements.txt
: List of required Python packages.
- After running the application, you'll see the interface to enter your Cohere API key and upload a PDF file.
- Once the PDF is uploaded, you can type a question in the chat input and receive an answer based on the PDF content.
- Ensure that you have a valid Cohere API key.
- Ensure that the PDF file is correctly uploaded and contains readable text.
- If the application fails to start, check for any missing dependencies and install them.