Capstone / env_utils.py
prabalGaur's picture
Upload env_utils.py with huggingface_hub
efcfce5 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)