aiauto-client 0.1.21__tar.gz → 0.1.23__tar.gz

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.
Files changed (21) hide show
  1. {aiauto_client-0.1.21/src/aiauto_client.egg-info → aiauto_client-0.1.23}/PKG-INFO +1 -1
  2. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/examples/example_torch_multiple_objective.py +2 -2
  3. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/examples/example_torch_single_objective.py +2 -2
  4. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/pyproject.toml +1 -1
  5. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto/core.py +15 -4
  6. {aiauto_client-0.1.21 → aiauto_client-0.1.23/src/aiauto_client.egg-info}/PKG-INFO +1 -1
  7. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/MANIFEST.in +0 -0
  8. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/README.md +0 -0
  9. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/examples/example_simple.py +0 -0
  10. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/setup.cfg +0 -0
  11. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto/__init__.py +0 -0
  12. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto/_config.py +0 -0
  13. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto/constants.py +0 -0
  14. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto/http_client.py +0 -0
  15. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto/serializer.py +0 -0
  16. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto_client.egg-info/SOURCES.txt +0 -0
  17. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto_client.egg-info/dependency_links.txt +0 -0
  18. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto_client.egg-info/requires.txt +0 -0
  19. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/src/aiauto_client.egg-info/top_level.txt +0 -0
  20. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/tests/test_pruners.py +0 -0
  21. {aiauto_client-0.1.21 → aiauto_client-0.1.23}/tests/test_samplers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.21
3
+ Version: 0.1.23
4
4
  Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
5
5
  Author-email: AIAuto Team <ainode@zeroone.ai>
6
6
  Project-URL: Homepage, https://dashboard.common.aiauto.pangyo.ainode.ai
@@ -226,7 +226,7 @@ def objective_multi(trial):
226
226
 
227
227
  # ====================== 학습 완료 후 최종 모델 스냅샷 저장 ========================
228
228
  try:
229
- filename = f'{trial.study.study_name}_{trial.number}'
229
+ filename = f'{trial.study.study_name}_{trial.number}.pt'
230
230
  model_path = join(ac.get_artifact_tmp_dir(), filename)
231
231
  # 모델 임시 폴더에 저장
232
232
  torch.save(
@@ -396,7 +396,7 @@ def objective_detailed(trial):
396
396
 
397
397
  # ====================== 학습 완료 후 최종 모델 스냅샷 저장 ========================
398
398
  try:
399
- filename = f'{trial.study.study_name}_{trial.number}'
399
+ filename = f'{trial.study.study_name}_{trial.number}.pt'
400
400
  model_path = join(ac.get_artifact_tmp_dir(), filename)
401
401
  # 모델 임시 폴더에 저장
402
402
  torch.save(
@@ -230,7 +230,7 @@ def objective_single(trial):
230
230
 
231
231
  # ====================== 학습 완료 후 최종 모델 스냅샷 저장 ========================
232
232
  try:
233
- filename = f'{trial.study.study_name}_{trial.number}'
233
+ filename = f'{trial.study.study_name}_{trial.number}.pt'
234
234
  model_path = join(ac.get_artifact_tmp_dir(), filename)
235
235
  # 모델 임시 폴더에 저장
236
236
  torch.save(
@@ -405,7 +405,7 @@ def objective_detailed(trial):
405
405
 
406
406
  # ====================== 학습 완료 후 최종 모델 스냅샷 저장 ========================
407
407
  try:
408
- filename = f'{trial.study.study_name}_{trial.number}'
408
+ filename = f'{trial.study.study_name}_{trial.number}.pt'
409
409
  model_path = join(ac.get_artifact_tmp_dir(), filename)
410
410
  # 모델 임시 폴더에 저장
411
411
  torch.save(
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aiauto-client"
7
- version = "0.1.21"
7
+ version = "0.1.23"
8
8
  description = "AI Auto HPO (Hyperparameter Optimization) Client Library"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,4 +1,5 @@
1
1
  from os import makedirs
2
+ import os
2
3
  import tempfile
3
4
  from typing import Union, Optional, List, Dict, Callable
4
5
  import optuna
@@ -44,9 +45,8 @@ class AIAutoController:
44
45
  "Please delete and reissue your token from the web dashboard at https://dashboard.common.aiauto.pangyo.ainode.ai"
45
46
  ) from e
46
47
 
47
- # artifact storage
48
- makedirs('./artifacts', exist_ok=True)
49
- self.artifact_store = optuna.artifacts.FileSystemArtifactStore('./artifacts')
48
+ # artifact storage: lazily resolved at call time based on runtime environment
49
+ self._artifact_store = None
50
50
  self.tmp_dir = tempfile.mkdtemp(prefix=f'ai_auto_tmp_')
51
51
 
52
52
  def get_storage(self):
@@ -57,7 +57,18 @@ class AIAutoController:
57
57
  optuna.artifacts.Boto3ArtifactStore,
58
58
  optuna.artifacts.GCSArtifactStore,
59
59
  ]:
60
- return self.artifact_store
60
+ # Lazy init: prefer container-mounted PVC at /artifacts (runner env),
61
+ # fallback to local ./artifacts for client/local usage.
62
+ if self._artifact_store is None:
63
+ if os.path.isdir('/artifacts'):
64
+ path = '/artifacts'
65
+ else:
66
+ path = './artifacts'
67
+ if not os.path.isdir(path):
68
+ makedirs(path, exist_ok=True)
69
+ self._artifact_store = optuna.artifacts.FileSystemArtifactStore(path)
70
+
71
+ return self._artifact_store
61
72
 
62
73
  def get_artifact_tmp_dir(self):
63
74
  return self.tmp_dir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.21
3
+ Version: 0.1.23
4
4
  Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
5
5
  Author-email: AIAuto Team <ainode@zeroone.ai>
6
6
  Project-URL: Homepage, https://dashboard.common.aiauto.pangyo.ainode.ai
File without changes
File without changes