aap-utils 0.1.11__py3-none-any.whl → 0.1.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aap_utils/__init__.py +1 -2
- aap_utils/config_loader.py +1 -1
- aap_utils/register.py +16 -9
- {aap_utils-0.1.11.dist-info → aap_utils-0.1.12.dist-info}/METADATA +1 -1
- aap_utils-0.1.12.dist-info/RECORD +7 -0
- aap_utils-0.1.11.dist-info/RECORD +0 -7
- {aap_utils-0.1.11.dist-info → aap_utils-0.1.12.dist-info}/WHEEL +0 -0
- {aap_utils-0.1.11.dist-info → aap_utils-0.1.12.dist-info}/top_level.txt +0 -0
aap_utils/__init__.py
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
from .register import register_demo
|
2
|
-
from .config_loader import ConfigLoader
|
1
|
+
from .register import register_demo, get_args
|
aap_utils/config_loader.py
CHANGED
@@ -21,6 +21,6 @@ class ConfigLoader:
|
|
21
21
|
def get_args(self) -> DictConfig:
|
22
22
|
"""Load and return the Hydra configuration."""
|
23
23
|
self._load_env_variables()
|
24
|
-
with
|
24
|
+
with initialize_config_dir(version_base=None, config_dir=self.config_path):
|
25
25
|
args = compose(config_name=self.kcn_params, overrides=self.overrides)
|
26
26
|
return args
|
aap_utils/register.py
CHANGED
@@ -60,21 +60,28 @@ def create_url(domain_name = "aiplatform.vcntt.tech"):
|
|
60
60
|
url = f"https://{transformed_namespace}.{domain_name}"
|
61
61
|
return url, transformed_namespace
|
62
62
|
|
63
|
-
|
64
63
|
def get_args():
|
65
64
|
kcn_params = "config.yaml"
|
66
|
-
|
65
|
+
|
66
|
+
# Get the absolute path of the folder where run.py is located
|
67
|
+
run_py_dir = Path(__file__).parent.resolve()
|
68
|
+
config_path = os.path.join(run_py_dir, "configs") # Absolute path to "configs/"
|
69
|
+
|
67
70
|
overrides = []
|
68
71
|
|
69
|
-
if os.environ.get(
|
70
|
-
full_path = os.getenv(
|
71
|
-
config_path = os.path.join(config_path, kcn_params)
|
72
|
+
if os.environ.get("KCN_PARAMS") and os.environ.get("KCN_PARAMS") != "":
|
73
|
+
full_path = os.getenv("KCN_PARAMS")
|
72
74
|
kcn_params = os.path.basename(full_path) # Extract the filename
|
73
75
|
|
74
|
-
if os.environ.get(
|
76
|
+
if os.environ.get("KCN_OVERRIDES") and os.environ.get("KCN_OVERRIDES") != "":
|
75
77
|
overrides_env = os.getenv("KCN_OVERRIDES")
|
76
|
-
overrides = overrides_env.split(
|
78
|
+
overrides = overrides_env.split("|") if overrides_env else []
|
77
79
|
|
78
|
-
|
80
|
+
# Ensure the configs directory exists
|
81
|
+
if not os.path.exists(os.path.join(config_path, kcn_params)):
|
82
|
+
raise FileNotFoundError(f"Config file not found: {os.path.join(config_path, kcn_params)}")
|
83
|
+
|
84
|
+
with initialize_config_dir(version_base=None, config_dir=config_path):
|
79
85
|
args = compose(config_name=kcn_params)
|
80
|
-
|
86
|
+
|
87
|
+
return args
|
@@ -0,0 +1,7 @@
|
|
1
|
+
aap_utils/__init__.py,sha256=iN7GQizkWVefysHlKpDG6L35Dkfaur2x2uS2uXtUiN4,46
|
2
|
+
aap_utils/config_loader.py,sha256=dhwQYuJ7y1exe6zI8zRK8WL6XhXnlb9eDLNKG3GgNNs,1011
|
3
|
+
aap_utils/register.py,sha256=GHzj4HSZ0ylF4UEADMRwDOq6sWdsKLr7QRBF7p6QYbs,3396
|
4
|
+
aap_utils-0.1.12.dist-info/METADATA,sha256=DreyF-hB1jwyn7Qv4c8AiB79kOJeb17kQFs6YbcEMao,347
|
5
|
+
aap_utils-0.1.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
+
aap_utils-0.1.12.dist-info/top_level.txt,sha256=Qt5xmL8_0_jhMl9uA3lg-xnvs4nCEyVj1tBE4vnp36M,10
|
7
|
+
aap_utils-0.1.12.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
aap_utils/__init__.py,sha256=MiN8qoJdlw-cI6OLAfz1JuTOaIb0uEwngJrzCes6Zcg,75
|
2
|
-
aap_utils/config_loader.py,sha256=RfYrBVnli7Jd1zPonpOhMd8kJC6zhaMPIq8QYKxYSfw,1001
|
3
|
-
aap_utils/register.py,sha256=JxMfbfzc8qs3Z0QlbX7PiLgJexY2P0Zdq6fqdly6zsI,3058
|
4
|
-
aap_utils-0.1.11.dist-info/METADATA,sha256=8gZpkUMOfsR5-10ONYs0_v19fk3qenYmMFBVQEuC9TU,347
|
5
|
-
aap_utils-0.1.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
-
aap_utils-0.1.11.dist-info/top_level.txt,sha256=Qt5xmL8_0_jhMl9uA3lg-xnvs4nCEyVj1tBE4vnp36M,10
|
7
|
-
aap_utils-0.1.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|