aiauto-client 0.1.21__py3-none-any.whl → 0.1.23__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.
aiauto/core.py CHANGED
@@ -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
@@ -1,10 +1,10 @@
1
1
  aiauto/__init__.py,sha256=sF7sJaXg7-MqolSYLxsaXAir1dBzARhXLrHo7zLsupg,345
2
2
  aiauto/_config.py,sha256=hTFh2bH9m-HuX6QCpNtBC0j6rEB0S97hhPKjbEjv4Tg,89
3
3
  aiauto/constants.py,sha256=rBibGOQHHrdkwaai92-3I8-N0cu-B4CoCoQbG9-Cl8k,821
4
- aiauto/core.py,sha256=cHTkg-K7Q1WvGGlOZN4Vof0UzCra2jf6YFWUGTtQXuQ,10735
4
+ aiauto/core.py,sha256=qQkLpeWIQZwXeYvbdUw9p2p--0vZx3rZLpHb4N7vj9o,11203
5
5
  aiauto/http_client.py,sha256=v_nPdb-2tIeH1XrOYqzMGvFfXLKEDbQoSaQYPsB0Hik,2587
6
6
  aiauto/serializer.py,sha256=BJmeq6uCD9D2_6bXu_sMBQLSsXCUMIMM10iX923DTXE,2749
7
- aiauto_client-0.1.21.dist-info/METADATA,sha256=utaLL9kxOHFigDto-2zdkDLlBONC51_olXfir9zhL3U,25746
8
- aiauto_client-0.1.21.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
- aiauto_client-0.1.21.dist-info/top_level.txt,sha256=Sk2ctO9_Bf_tAPwq1x6Vfl6OuL29XzwMTO4F_KG6oJE,7
10
- aiauto_client-0.1.21.dist-info/RECORD,,
7
+ aiauto_client-0.1.23.dist-info/METADATA,sha256=Gn6_mp6YHjc3P-UTHv3kQsgFXoG0KZHPxTWJgrRxGig,25746
8
+ aiauto_client-0.1.23.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
+ aiauto_client-0.1.23.dist-info/top_level.txt,sha256=Sk2ctO9_Bf_tAPwq1x6Vfl6OuL29XzwMTO4F_KG6oJE,7
10
+ aiauto_client-0.1.23.dist-info/RECORD,,