edit readme and config

This commit is contained in:
charlene tau express 2025-04-22 17:23:44 +08:00
parent a0efd90c14
commit 08d0eef8e5
2 changed files with 27 additions and 5 deletions

View File

@ -47,4 +47,26 @@ QDRANT_CLUSTER=''
QDRANT_COLLECTION_NAME='titan'
TOKENIZER_FOLDER=''
MODEL_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
```

View File

@ -1,12 +1,12 @@
from dotenv import dotenv_values
import os
from pathlib import Path
# load_dotenv("/home/user/recommender-service-flask/src/.env")
# load_dotenv("/home/charlenewsl/recommender-service-flask/src/.env")
# config = dotenv_values("/home/charlenewsl/recommender-service-flask/src/.env")
config = dotenv_values(".env")
# config = dotenv_values("/home/user/recommender-service-flask/src/.env")
env_path = Path(__file__).resolve().parents[1]/ ".env"
config = dotenv_values(env_path)
def env(name, default=None, cast=None):