77 lines
1.7 KiB
Markdown
77 lines
1.7 KiB
Markdown
## How to Run This Project
|
||
|
||
### 1️⃣ Create and Activate a Virtual Environment
|
||
|
||
Run the following command to create a virtual environment:
|
||
|
||
```sh
|
||
python -m venv venv
|
||
```
|
||
### Activate the Virtual Environment
|
||
|
||
**On macOS/Linux:**
|
||
```sh
|
||
source venv/bin/activate
|
||
```
|
||
### 2️⃣ Install Dependencies
|
||
|
||
After activating the virtual environment, install the required packages:
|
||
|
||
```sh
|
||
pip install -r requirements.txt
|
||
```
|
||
|
||
|
||
### 3️⃣ Run the Flask Application
|
||
|
||
Once dependencies are installed, start the Flask app by running:
|
||
|
||
```sh
|
||
cd src
|
||
python app.py
|
||
```
|
||
|
||
## Environment Variables
|
||
|
||
|
||
1. Copy `.env.example` to `.env`
|
||
2. Edit `.env` and fill in the required values.
|
||
|
||
|
||
### **File Placement of .env in Development**
|
||
- Place the `.env` file inside `src` directory.
|
||
|
||
### **Example `.env` File**
|
||
```ini
|
||
QDRANT_HOST=localhost
|
||
QDRANT_PORT=6333
|
||
QDRANT_API_KEY=
|
||
QDRANT_HTTPS='true'
|
||
QDRANT_SSL_VERIFY= 'false'
|
||
QDRANT_CLUSTER=''
|
||
QDRANT_COLLECTION_NAME='mocktestdata'
|
||
MODEL_FOLDER=
|
||
TOKENIZER_FOLDER=
|
||
```
|
||
ℹ️ **Note for production/docker container:**
|
||
`TOKENIZER_FOLDER` and `MODEL_FOLDER` are **only required for local development**.
|
||
|
||
When running the application in a **Docker container**, these variables are already set in the `Dockerfile` and do not need to be defined in your `.env` file.
|
||
|
||
|
||
|
||
## 📥 NLTK Setup for Development
|
||
|
||
If you are running the application in development mode for the first time, you need to manually download the NLTK resource required for sentence tokenization.
|
||
|
||
### Run the following inside your virtual environment:
|
||
```ini
|
||
import nltk
|
||
nltk.download('punkt_tab')
|
||
```
|
||
|
||
This will download the necessary model and store it on your local machine under:
|
||
|
||
```
|
||
~/nltk_data
|
||
``` |