From 326af5a648c21a6833e8b3d80aaef7ff3f5bfd8b Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 25 Jan 2024 00:40:19 -0800 Subject: [PATCH] refac --- backend/config.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/backend/config.py b/backend/config.py index 169baa69a..836a99dad 100644 --- a/backend/config.py +++ b/backend/config.py @@ -1,16 +1,9 @@ import os - - import chromadb from chromadb import Settings - - from secrets import token_bytes from base64 import b64encode - from constants import ERROR_MESSAGES - - from pathlib import Path try: @@ -21,24 +14,27 @@ except ImportError: print("dotenv not installed, skipping...") -#################################### -# File Upload -#################################### - -DATA_DIR = str(Path(os.getenv("DATA_DIR", "./data")).resolve()) - -UPLOAD_DIR = f"{DATA_DIR}/uploads" - -Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True) - -FRONTEND_BUILD_DIR = str(Path(os.getenv("FRONTEND_BUILD_DIR", "../build"))) - #################################### # ENV (dev,test,prod) #################################### ENV = os.environ.get("ENV", "dev") + +#################################### +# DATA/FRONTEND BUILD DIR +#################################### + +DATA_DIR = str(Path(os.getenv("DATA_DIR", "./data")).resolve()) +FRONTEND_BUILD_DIR = str(Path(os.getenv("FRONTEND_BUILD_DIR", "../build"))) + +#################################### +# File Upload DIR +#################################### + +UPLOAD_DIR = f"{DATA_DIR}/uploads" +Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True) + #################################### # OLLAMA_API_BASE_URL ####################################