diff --git a/README.md b/README.md index 43054f5..5a3d8f9 100644 --- a/README.md +++ b/README.md @@ -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 +``` \ No newline at end of file diff --git a/src/util/config.py b/src/util/config.py index e1c8beb..654d679 100644 --- a/src/util/config.py +++ b/src/util/config.py @@ -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):