This repository contains a Flask-based web application that allows users to upload PDF files and interact with the chatbot to get responses to their queries on the content of the uploaded PDF. This project was developed for the summer projects released by Metis Club, IIT Gandhinagar. The LLM used was Llama3 by Meta, and the tech stack in frontend included HTML, CSS, Javascript, and FetchAPI integration; in backend, Python and Flask were used.
- Efficient reading of pdf files using Llamaparse
- Interactive UI that simulates chatting
git clone https://github.com/HarshilShah1804/Chatbot-PDF.git
cd Chatbot-PDF
pip install -r requirements.txt
In Chatbot.py, add your Gradient access token and workspace ID and your llamaindex API key
os.environ['GRADIENT_ACCESS_TOKEN'] = "YOUR_GRADIENT_ACCESS_TOKEN"
os.environ['GRADIENT_WORKSPACE_ID'] = "YOUR_GRADIENT_WORKSPACE_ID"
api_key="your_api_key"
python app.py
By default, the application will be accessible at http://127.0.0.1:5000/.
The app is configured in a way that it will not give answers to questions outside the scope of the PDF.
- Click on the "Upload" button.
- Select the PDF file from your system. It will be automatically uploaded.
- After uploading a PDF, the bot will take some time to parse it, and a prompt will appear once it is ready to answer your queries.
- After getting the prompt, type your query in the text box and click the send button.
Distributed under the Apache License 2.0. See LICENSE for more information.
Contributions make the open-source community such an amazing place to be, learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request