jhj0517
commited on
Commit
•
22b4354
1
Parent(s):
3f867d6
Add path util
Browse files- modules/utils/paths.py +17 -0
modules/utils/paths.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import functools
|
2 |
+
import os
|
3 |
+
|
4 |
+
|
5 |
+
PROJECT_ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..")
|
6 |
+
MODELS_DIR = os.path.join(PROJECT_ROOT_DIR, "models")
|
7 |
+
|
8 |
+
|
9 |
+
@functools.lru_cache
|
10 |
+
def init_dirs():
|
11 |
+
for dir_path in [
|
12 |
+
MODELS_DIR
|
13 |
+
]:
|
14 |
+
os.makedirs(dir_path, exist_ok=True)
|
15 |
+
|
16 |
+
|
17 |
+
init_dirs()
|