Load a PDF file and ask questions via llama_index and GPT
- Install the requirements
pip install -r requirements.txtGet a GPT API key from OpenAI if you don't have one already.
Paste your API key in a file called
.envin the root directory of the project.
OPENAI_API_KEY=<your key here>Select a file from the menu or replace the default file
file.pdfwith the PDF you want to use.Run the script.
python3 main.pyAsk any questions about the content of the PDF.
You can find other loaders at Llama Hub.
Enjoy!