aiauto-client 0.1.20__py3-none-any.whl → 0.1.22__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
@@ -153,10 +164,15 @@ class CallbackTopNArtifact:
153
164
  if artifact_id:
154
165
  try:
155
166
  self.artifact_store.remove(artifact_id)
156
- # user_attr에서도 제거
157
- study._storage.set_trial_user_attr(old_trial._trial_id, self.check_attr_name, None)
158
167
  except Exception as e:
159
168
  print(f"Warning: Failed to remove artifact {artifact_id}: {e}")
169
+ finally:
170
+ try:
171
+ # 일부 스토리지(GrpcStorageProxy)는 None 값을 무시하거나 직렬화하지 않을 수 있음.
172
+ # UI에서 링크를 숨기기 위해 빈 문자열로 설정(빈 문자열은 falsy로 처리됨).
173
+ study._storage.set_trial_user_attr(old_trial._trial_id, self.check_attr_name, "")
174
+ except Exception as e2:
175
+ print(f"Warning: Failed to clear user_attr {self.check_attr_name} for trial {old_trial.number}: {e2}")
160
176
 
161
177
 
162
178
  class StudyWrapper:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.20
3
+ Version: 0.1.22
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=z46oRcuwRR4xfqKbbokqB13vo29ayLxjZeGi8zAKNuA,10306
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.20.dist-info/METADATA,sha256=Y5yipDItVcPwbE0lzI7FwKbwJ8CXJnR1AW4Q5XpH1Gw,25746
8
- aiauto_client-0.1.20.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
- aiauto_client-0.1.20.dist-info/top_level.txt,sha256=Sk2ctO9_Bf_tAPwq1x6Vfl6OuL29XzwMTO4F_KG6oJE,7
10
- aiauto_client-0.1.20.dist-info/RECORD,,
7
+ aiauto_client-0.1.22.dist-info/METADATA,sha256=TprOc3A7bMm3tt61-gXvq8HWAok3vxoi9XoXlppGN90,25746
8
+ aiauto_client-0.1.22.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
+ aiauto_client-0.1.22.dist-info/top_level.txt,sha256=Sk2ctO9_Bf_tAPwq1x6Vfl6OuL29XzwMTO4F_KG6oJE,7
10
+ aiauto_client-0.1.22.dist-info/RECORD,,