prabalGaur commited on
Commit
efcfce5
·
verified ·
1 Parent(s): d3c9c0b

Upload env_utils.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. env_utils.py +14 -0
env_utils.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Load .env from repo root or week8 folder."""
2
+
3
+ from pathlib import Path
4
+
5
+ from dotenv import load_dotenv
6
+
7
+ WEEK8_DIR = Path(__file__).resolve().parent
8
+ REPO_ROOT = WEEK8_DIR.parent
9
+
10
+
11
+ def load_project_env() -> None:
12
+ for path in (REPO_ROOT / ".env", WEEK8_DIR / ".env"):
13
+ if path.exists():
14
+ load_dotenv(path, override=True)