This application uses the Mistral-7B model to generate Questions and Answers from PDF documents. Follow these steps to set up and run the application:
First, clone the repository to your local machine:
git clone https://github.com/Rjaat/Pdf-QnA-Mistral-7b.git
cd Pdf-QnA-Mistral-7b
Create a virtual environment to isolate your project’s dependencies:
python3 -m venv venv
Activate the virtual environment:
source venv/bin/activate
Install the required dependencies from requirements.txt:
pip3 install -r requirements.txt
Additionally, ensure you have any other necessary libraries installed. If not included in requirements.txt, you may need to install them manually
Replace the Hugging Face token in app.py with your own token. Open app.py and find the section where the token is used. Replace it with your token:
# Example placeholder
login(token="PLACE_YOUR_TOKEN_HERE") line No. 27 in app.py
Start the application by running app.py:
python3 app.py
Open your web browser and navigate to:
http://0.0.0.0:8000/
You should see the application’s user interface, where you can upload PDF files and ask questions.
- Dependency Issues: Ensure all dependencies listed in requirements.txt are installed. If you encounter errors, try reinstalling them or checking compatibility.
- Token Errors: Make sure the Hugging Face token is valid and correctly placed in app.py.
- Port Issues: If 8000 is already in use, you might need to specify a different port in app.py.