Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedrickring/cora-deploy
https://github.com/cedrickring/cora-deploy
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cedrickring/cora-deploy
- Owner: cedrickring
- Created: 2024-04-25T10:13:46.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T16:17:59.000Z (5 months ago)
- Last Synced: 2024-10-26T17:53:59.584Z (2 months ago)
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cora Deployment
This repository contains the necessary files to run the Cora application using Docker and Docker Compose.
## Pre-requisites
Make sure to have the following tools installed:
- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)## Configuring the application
After cloning the repository, the application can be configured by altering the .env file in this repo. To create a new .env file, copy the .env.sample file and adjust the values accordingly.
### OpenAI
For OpenAI you must set the following environment variables accordingly:```shell
OPENAI_API_BASE="https://api.openai.com/v1"
OPENAI_API_KEY=""
OPENAI_EMBEDDINGS_MODEL=""
OPENAI_GPT_MODEL=""
BACKEND_URL=""
```### Azure OpenAI
For Azure OpenAI you must set the following environment variables accordingly:```shell
OPENAI_API_BASE=""
OPENAI_API_KEY=""
OPENAI_EMBEDDINGS_MODEL=""
OPENAI_GPT_MODEL=""
BACKEND_URL=""# Azure specific variables
OPENAI_API_TYPE="azure"
AZURE_EMBEDDINGS_DEPLOYMENT=""
AZURE_GPT_MODEL_DEPLOYMENT=""```
## Preprocessing the data
Before running the application, you need to preprocess the documents you want to ask questions against. The documents need to be put in `input_files/`. For now, we only support `.pdf` files.
To preprocess the documents, run the following command:
```bash
docker compose run preprocessing
```This will preprocess the documents and store the results in the `vector_databases/` directory. As soon as the process is complete, you can continue with the next step: [Running the application](#running-the-application).
**NOTE**: This process can take a few minutes depending on the amount and the size of the documents to process.
## Running the application
This repository contains an automatically updated `compose.yaml` file that will pull the latest version of the Cora application and run it.
In addition to the autoconfiguration, you need to manually specify the environment variables specified in the `.env.sample` file. You can do this by copying the `.env.sample` file to `.env` and adjust the values accordingly.
```bash
cp .env.sample .env
```After setting the environment variables, you can run the application using the following command:
```bash
docker compose up -d
```## Stopping the application
To stop the application, run the following command:
```bash
docker compose down
```