This is an experiment to query a locally stored PDF document using llama-index and ChatGPT.
To run this experiment, you ideally set up a Python > 3.7
environment using for example Miniconda and install the required packages from requirements.txt
via pip
.
- Download and install Miniconda from the official website: https://docs.conda.io/en/latest/miniconda.html
- Open a terminal or command prompt and create a new Python 3 environment using the following command:
conda create --name pdf-query python=3
- Activate the new environment using the following command:
conda activate pdf-query
-
Clone or download the project repository to your local machine.
-
Open a terminal or command prompt and navigate to the project directory.
-
Install the required packages from requirements.txt using the following command:
pip install -r requirements.txt
This will install the following packages:
- openai
- llama-index
- Create a new
.env
file in the project root folder - Copy the content from
.env.sample
- Insert your OpenAI API key into the new
.env
file - Run the command
source .env
To run the experiment, run the main.py script using the following command:
python main.py
This will prompt you to enter a query string. Enter your query and press Enter to see the results.