Capstone / _hf_deploy /env_utils.py
prabalGaur's picture
Deploy updated app and community contributions
ed9ecbf verified
Raw
History Blame Contribute Delete
357 Bytes
"""Load .env from repo root or week8 folder."""
from pathlib import Path
from dotenv import load_dotenv
WEEK8_DIR = Path(__file__).resolve().parent
REPO_ROOT = WEEK8_DIR.parent
def load_project_env() -> None:
for path in (REPO_ROOT / ".env", WEEK8_DIR / ".env"):
if path.exists():
load_dotenv(path, override=True)