-
Set up running environment
- Install Anaconda
- Open Anaconda and import the conda env file from this project
- (Optional) If conda env cannot be imported in Anaconda, please create a new python environment and install all dependencies manually
pip install python-dotenv langchain openai langchain-chroma langchain-openai flask waitress langchain-community langchain.chains pypdf -
Create a .flaskenv file in the root folder of this project.
FLASK_APP=run.py FLASK_ENV=development OPENAI_API_KEY=xxxxx PINECONE_API_KEY=xxxx PINECONE_INDEX_NAME=xxxx REDIS_HOST=XXXX REDIS_PORT=1xxx REDIS_USERNAME=xxx REFIS_PASSWORD=xxxx -
We are currently using a Pinecone database. Please open the terminal and cd to the manual folder. Run the following command to create the vector db (Note that dependencies are needed in this step)
python database.py
- Open Anaconda and open the corresponding python environment terminal
- CD to the project repository
- Run project
- Input this command (Note that the server will keep running, press Ctrl+C to terminate)
waitress-serve --port=8080 application:app
- To build image, run
docker build . -t [image name]:[tag] - To run container, run
docker run --env-file .flaskenv -p 8080:8080 --name [container name] [image name]