wandb 0.19.4rc1__py3-none-musllinux_1_2_aarch64.whl → 0.19.6rc4__py3-none-musllinux_1_2_aarch64.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.
- wandb/__init__.py +1 -1
- wandb/__init__.pyi +1 -8
- wandb/_iterutils.py +46 -0
- wandb/apis/internal.py +4 -0
- wandb/apis/normalize.py +13 -5
- wandb/bin/gpu_stats +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/cli.py +9 -2
- wandb/proto/v3/wandb_internal_pb2.py +36 -36
- wandb/proto/v3/wandb_settings_pb2.py +2 -2
- wandb/proto/v4/wandb_internal_pb2.py +36 -36
- wandb/proto/v4/wandb_settings_pb2.py +2 -2
- wandb/proto/v5/wandb_internal_pb2.py +36 -36
- wandb/proto/v5/wandb_settings_pb2.py +2 -2
- wandb/sdk/artifacts/artifact.py +120 -8
- wandb/sdk/artifacts/storage_handlers/local_file_handler.py +12 -5
- wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -1
- wandb/sdk/backend/backend.py +7 -11
- wandb/sdk/data_types/base_types/wb_value.py +10 -10
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +2 -2
- wandb/sdk/data_types/helper_types/image_mask.py +2 -2
- wandb/sdk/data_types/image.py +0 -3
- wandb/sdk/data_types/saved_model.py +1 -1
- wandb/sdk/data_types/utils.py +2 -6
- wandb/sdk/interface/interface.py +26 -12
- wandb/sdk/interface/interface_sock.py +7 -11
- wandb/sdk/internal/internal_api.py +9 -1
- wandb/sdk/internal/sender.py +2 -2
- wandb/sdk/internal/system/assets/cpu.py +1 -1
- wandb/sdk/lib/apikey.py +7 -19
- wandb/sdk/lib/mailbox.py +0 -14
- wandb/sdk/lib/retry.py +6 -3
- wandb/sdk/lib/run_moment.py +19 -7
- wandb/sdk/lib/server.py +20 -0
- wandb/sdk/lib/service_connection.py +2 -2
- wandb/sdk/wandb_init.py +71 -46
- wandb/sdk/wandb_login.py +86 -110
- wandb/sdk/wandb_metadata.py +60 -31
- wandb/sdk/wandb_run.py +32 -45
- wandb/sdk/wandb_settings.py +465 -143
- wandb/sdk/wandb_setup.py +10 -22
- wandb/util.py +44 -12
- {wandb-0.19.4rc1.dist-info → wandb-0.19.6rc4.dist-info}/METADATA +1 -1
- {wandb-0.19.4rc1.dist-info → wandb-0.19.6rc4.dist-info}/RECORD +683 -682
- {wandb-0.19.4rc1.dist-info → wandb-0.19.6rc4.dist-info}/WHEEL +0 -0
- {wandb-0.19.4rc1.dist-info → wandb-0.19.6rc4.dist-info}/entry_points.txt +0 -0
- {wandb-0.19.4rc1.dist-info → wandb-0.19.6rc4.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_setup.py
CHANGED
@@ -177,42 +177,30 @@ class _WandbSetup:
|
|
177
177
|
def _get_entity(self) -> str | None:
|
178
178
|
if self._settings and self._settings._offline:
|
179
179
|
return None
|
180
|
-
|
181
|
-
self._load_viewer()
|
182
|
-
assert self._server is not None
|
183
|
-
entity = self._server._viewer.get("entity")
|
180
|
+
entity = self.viewer.get("entity")
|
184
181
|
return entity
|
185
182
|
|
186
183
|
def _get_username(self) -> str | None:
|
187
184
|
if self._settings and self._settings._offline:
|
188
185
|
return None
|
189
|
-
|
190
|
-
self._load_viewer()
|
191
|
-
assert self._server is not None
|
192
|
-
return self._server._viewer.get("username")
|
186
|
+
return self.viewer.get("username")
|
193
187
|
|
194
188
|
def _get_teams(self) -> list[str]:
|
195
189
|
if self._settings and self._settings._offline:
|
196
190
|
return []
|
197
|
-
|
198
|
-
self._load_viewer()
|
199
|
-
assert self._server is not None
|
200
|
-
teams = self._server._viewer.get("teams")
|
191
|
+
teams = self.viewer.get("teams")
|
201
192
|
if teams:
|
202
193
|
teams = [team["node"]["name"] for team in teams["edges"]]
|
203
194
|
return teams or []
|
204
195
|
|
205
|
-
|
206
|
-
|
207
|
-
return
|
208
|
-
s = server.Server(settings=self._settings)
|
209
|
-
s.query_with_timeout()
|
210
|
-
self._server = s
|
211
|
-
|
212
|
-
def _load_user_settings(self) -> dict[str, Any] | None:
|
196
|
+
@property
|
197
|
+
def viewer(self) -> dict[str, Any]:
|
213
198
|
if self._server is None:
|
214
|
-
self.
|
199
|
+
self._server = server.Server(settings=self._settings)
|
215
200
|
|
201
|
+
return self._server.viewer
|
202
|
+
|
203
|
+
def _load_user_settings(self) -> dict[str, Any] | None:
|
216
204
|
# offline?
|
217
205
|
if self._server is None:
|
218
206
|
return None
|
@@ -222,7 +210,7 @@ class _WandbSetup:
|
|
222
210
|
if "code_saving_enabled" in flags:
|
223
211
|
user_settings["save_code"] = flags["code_saving_enabled"]
|
224
212
|
|
225
|
-
email = self.
|
213
|
+
email = self.viewer.get("email", None)
|
226
214
|
if email:
|
227
215
|
user_settings["email"] = email
|
228
216
|
|
wandb/util.py
CHANGED
@@ -854,20 +854,52 @@ def no_retry_4xx(e: Exception) -> bool:
|
|
854
854
|
|
855
855
|
|
856
856
|
def parse_backend_error_messages(response: requests.Response) -> List[str]:
|
857
|
-
|
857
|
+
"""Returns error messages stored in a backend response.
|
858
|
+
|
859
|
+
If the response is not in an expected format, an empty list is returned.
|
860
|
+
|
861
|
+
Args:
|
862
|
+
response: A response to an HTTP request to the W&B server.
|
863
|
+
"""
|
858
864
|
try:
|
859
865
|
data = response.json()
|
860
|
-
except
|
861
|
-
return
|
866
|
+
except requests.JSONDecodeError:
|
867
|
+
return []
|
868
|
+
|
869
|
+
if not isinstance(data, dict):
|
870
|
+
return []
|
862
871
|
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
872
|
+
# Backend error values are returned in one of two ways:
|
873
|
+
# - A string containing the error message
|
874
|
+
# - A JSON object with a "message" field that is a string
|
875
|
+
def get_message(err: Any) -> Optional[str]:
|
876
|
+
if isinstance(error, str):
|
877
|
+
return error
|
878
|
+
elif (
|
879
|
+
isinstance(error, dict)
|
880
|
+
and (message := error.get("message"))
|
881
|
+
and isinstance(message, str)
|
882
|
+
):
|
883
|
+
return message
|
884
|
+
else:
|
885
|
+
return None
|
886
|
+
|
887
|
+
# The response can contain an "error" field with a single error
|
888
|
+
# or an "errors" field with a list of errors.
|
889
|
+
if error := data.get("error"):
|
890
|
+
message = get_message(error)
|
891
|
+
return [message] if message else []
|
892
|
+
|
893
|
+
elif (errors := data.get("errors")) and isinstance(errors, list):
|
894
|
+
messages: List[str] = []
|
895
|
+
for error in errors:
|
896
|
+
message = get_message(error)
|
897
|
+
if message:
|
898
|
+
messages.append(message)
|
899
|
+
return messages
|
900
|
+
|
901
|
+
else:
|
902
|
+
return []
|
871
903
|
|
872
904
|
|
873
905
|
def no_retry_auth(e: Any) -> bool:
|
@@ -1266,7 +1298,7 @@ def prompt_choices(
|
|
1266
1298
|
) -> str:
|
1267
1299
|
"""Allow a user to choose from a list of options."""
|
1268
1300
|
for i, choice in enumerate(choices):
|
1269
|
-
wandb.termlog(f"({i+1}) {choice}")
|
1301
|
+
wandb.termlog(f"({i + 1}) {choice}")
|
1270
1302
|
|
1271
1303
|
idx = -1
|
1272
1304
|
while idx < 0 or idx > len(choices) - 1:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: wandb
|
3
|
-
Version: 0.19.
|
3
|
+
Version: 0.19.6rc4
|
4
4
|
Summary: A CLI and library for interacting with the Weights & Biases API.
|
5
5
|
Project-URL: Source, https://github.com/wandb/wandb
|
6
6
|
Project-URL: Bug Reports, https://github.com/wandb/wandb/issues
|