wandb 0.13.10__py3-none-any.whl → 0.14.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- wandb/__init__.py +2 -3
- wandb/apis/__init__.py +1 -3
- wandb/apis/importers/__init__.py +4 -0
- wandb/apis/importers/base.py +312 -0
- wandb/apis/importers/mlflow.py +113 -0
- wandb/apis/internal.py +29 -2
- wandb/apis/normalize.py +6 -5
- wandb/apis/public.py +163 -180
- wandb/apis/reports/_templates.py +6 -12
- wandb/apis/reports/report.py +1 -1
- wandb/apis/reports/runset.py +1 -3
- wandb/apis/reports/util.py +12 -10
- wandb/beta/workflows.py +57 -34
- wandb/catboost/__init__.py +1 -2
- wandb/cli/cli.py +215 -133
- wandb/data_types.py +63 -56
- wandb/docker/__init__.py +78 -16
- wandb/docker/auth.py +21 -22
- wandb/env.py +0 -1
- wandb/errors/__init__.py +8 -116
- wandb/errors/term.py +1 -1
- wandb/fastai/__init__.py +1 -2
- wandb/filesync/dir_watcher.py +8 -5
- wandb/filesync/step_prepare.py +76 -75
- wandb/filesync/step_upload.py +1 -2
- wandb/integration/catboost/__init__.py +1 -3
- wandb/integration/catboost/catboost.py +8 -14
- wandb/integration/fastai/__init__.py +7 -13
- wandb/integration/gym/__init__.py +35 -4
- wandb/integration/keras/__init__.py +3 -3
- wandb/integration/keras/callbacks/metrics_logger.py +9 -8
- wandb/integration/keras/callbacks/model_checkpoint.py +9 -9
- wandb/integration/keras/callbacks/tables_builder.py +31 -19
- wandb/integration/kfp/kfp_patch.py +20 -17
- wandb/integration/kfp/wandb_logging.py +1 -2
- wandb/integration/lightgbm/__init__.py +21 -19
- wandb/integration/prodigy/prodigy.py +6 -7
- wandb/integration/sacred/__init__.py +9 -12
- wandb/integration/sagemaker/__init__.py +1 -3
- wandb/integration/sagemaker/auth.py +0 -1
- wandb/integration/sagemaker/config.py +1 -1
- wandb/integration/sagemaker/resources.py +1 -1
- wandb/integration/sb3/sb3.py +8 -4
- wandb/integration/tensorboard/__init__.py +1 -3
- wandb/integration/tensorboard/log.py +8 -8
- wandb/integration/tensorboard/monkeypatch.py +11 -9
- wandb/integration/tensorflow/__init__.py +1 -3
- wandb/integration/xgboost/__init__.py +4 -6
- wandb/integration/yolov8/__init__.py +7 -0
- wandb/integration/yolov8/yolov8.py +250 -0
- wandb/jupyter.py +31 -35
- wandb/lightgbm/__init__.py +1 -2
- wandb/old/settings.py +2 -2
- wandb/plot/bar.py +1 -2
- wandb/plot/confusion_matrix.py +1 -3
- wandb/plot/histogram.py +1 -2
- wandb/plot/line.py +1 -2
- wandb/plot/line_series.py +4 -4
- wandb/plot/pr_curve.py +17 -20
- wandb/plot/roc_curve.py +1 -3
- wandb/plot/scatter.py +1 -2
- wandb/proto/v3/wandb_server_pb2.py +85 -39
- wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
- wandb/proto/v4/wandb_server_pb2.py +51 -39
- wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
- wandb/sdk/__init__.py +1 -3
- wandb/sdk/backend/backend.py +1 -1
- wandb/sdk/data_types/_dtypes.py +38 -30
- wandb/sdk/data_types/base_types/json_metadata.py +1 -3
- wandb/sdk/data_types/base_types/media.py +17 -17
- wandb/sdk/data_types/base_types/wb_value.py +33 -26
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +91 -125
- wandb/sdk/data_types/helper_types/classes.py +1 -1
- wandb/sdk/data_types/helper_types/image_mask.py +12 -12
- wandb/sdk/data_types/histogram.py +5 -4
- wandb/sdk/data_types/html.py +1 -2
- wandb/sdk/data_types/image.py +11 -11
- wandb/sdk/data_types/molecule.py +3 -6
- wandb/sdk/data_types/object_3d.py +1 -2
- wandb/sdk/data_types/plotly.py +1 -2
- wandb/sdk/data_types/saved_model.py +10 -8
- wandb/sdk/data_types/video.py +1 -1
- wandb/sdk/integration_utils/data_logging.py +5 -5
- wandb/sdk/interface/artifacts.py +288 -266
- wandb/sdk/interface/interface.py +2 -3
- wandb/sdk/interface/interface_grpc.py +1 -1
- wandb/sdk/interface/interface_queue.py +1 -1
- wandb/sdk/interface/interface_relay.py +1 -1
- wandb/sdk/interface/interface_shared.py +1 -2
- wandb/sdk/interface/interface_sock.py +1 -1
- wandb/sdk/interface/message_future.py +1 -1
- wandb/sdk/interface/message_future_poll.py +1 -1
- wandb/sdk/interface/router.py +1 -1
- wandb/sdk/interface/router_queue.py +1 -1
- wandb/sdk/interface/router_relay.py +1 -1
- wandb/sdk/interface/router_sock.py +1 -1
- wandb/sdk/interface/summary_record.py +1 -1
- wandb/sdk/internal/artifacts.py +1 -1
- wandb/sdk/internal/datastore.py +2 -3
- wandb/sdk/internal/file_pusher.py +5 -3
- wandb/sdk/internal/file_stream.py +22 -19
- wandb/sdk/internal/handler.py +5 -4
- wandb/sdk/internal/internal.py +1 -1
- wandb/sdk/internal/internal_api.py +115 -55
- wandb/sdk/internal/job_builder.py +1 -3
- wandb/sdk/internal/profiler.py +1 -1
- wandb/sdk/internal/progress.py +4 -6
- wandb/sdk/internal/sample.py +1 -3
- wandb/sdk/internal/sender.py +28 -16
- wandb/sdk/internal/settings_static.py +5 -5
- wandb/sdk/internal/system/assets/__init__.py +1 -0
- wandb/sdk/internal/system/assets/cpu.py +3 -9
- wandb/sdk/internal/system/assets/disk.py +2 -4
- wandb/sdk/internal/system/assets/gpu.py +6 -18
- wandb/sdk/internal/system/assets/gpu_apple.py +2 -4
- wandb/sdk/internal/system/assets/interfaces.py +50 -22
- wandb/sdk/internal/system/assets/ipu.py +1 -3
- wandb/sdk/internal/system/assets/memory.py +7 -13
- wandb/sdk/internal/system/assets/network.py +4 -8
- wandb/sdk/internal/system/assets/open_metrics.py +283 -0
- wandb/sdk/internal/system/assets/tpu.py +1 -4
- wandb/sdk/internal/system/assets/trainium.py +26 -14
- wandb/sdk/internal/system/system_info.py +2 -3
- wandb/sdk/internal/system/system_monitor.py +52 -20
- wandb/sdk/internal/tb_watcher.py +12 -13
- wandb/sdk/launch/_project_spec.py +54 -65
- wandb/sdk/launch/agent/agent.py +374 -90
- wandb/sdk/launch/builder/abstract.py +61 -7
- wandb/sdk/launch/builder/build.py +81 -110
- wandb/sdk/launch/builder/docker_builder.py +181 -0
- wandb/sdk/launch/builder/kaniko_builder.py +419 -0
- wandb/sdk/launch/builder/noop.py +31 -12
- wandb/sdk/launch/builder/templates/_wandb_bootstrap.py +70 -20
- wandb/sdk/launch/environment/abstract.py +28 -0
- wandb/sdk/launch/environment/aws_environment.py +276 -0
- wandb/sdk/launch/environment/gcp_environment.py +271 -0
- wandb/sdk/launch/environment/local_environment.py +65 -0
- wandb/sdk/launch/github_reference.py +3 -8
- wandb/sdk/launch/launch.py +38 -29
- wandb/sdk/launch/launch_add.py +6 -8
- wandb/sdk/launch/loader.py +230 -0
- wandb/sdk/launch/registry/abstract.py +54 -0
- wandb/sdk/launch/registry/elastic_container_registry.py +163 -0
- wandb/sdk/launch/registry/google_artifact_registry.py +203 -0
- wandb/sdk/launch/registry/local_registry.py +62 -0
- wandb/sdk/launch/runner/abstract.py +1 -16
- wandb/sdk/launch/runner/{kubernetes.py → kubernetes_runner.py} +83 -95
- wandb/sdk/launch/runner/local_container.py +46 -22
- wandb/sdk/launch/runner/local_process.py +1 -4
- wandb/sdk/launch/runner/{aws.py → sagemaker_runner.py} +53 -212
- wandb/sdk/launch/runner/{gcp_vertex.py → vertex_runner.py} +38 -55
- wandb/sdk/launch/sweeps/__init__.py +3 -2
- wandb/sdk/launch/sweeps/scheduler.py +132 -39
- wandb/sdk/launch/sweeps/scheduler_sweep.py +80 -89
- wandb/sdk/launch/utils.py +101 -30
- wandb/sdk/launch/wandb_reference.py +2 -7
- wandb/sdk/lib/_settings_toposort_generate.py +166 -0
- wandb/sdk/lib/_settings_toposort_generated.py +201 -0
- wandb/sdk/lib/apikey.py +2 -4
- wandb/sdk/lib/config_util.py +4 -1
- wandb/sdk/lib/console.py +1 -3
- wandb/sdk/lib/deprecate.py +3 -3
- wandb/sdk/lib/file_stream_utils.py +7 -5
- wandb/sdk/lib/filenames.py +1 -1
- wandb/sdk/lib/filesystem.py +61 -5
- wandb/sdk/lib/git.py +1 -3
- wandb/sdk/lib/import_hooks.py +4 -7
- wandb/sdk/lib/ipython.py +8 -5
- wandb/sdk/lib/lazyloader.py +1 -3
- wandb/sdk/lib/mailbox.py +14 -4
- wandb/sdk/lib/proto_util.py +10 -5
- wandb/sdk/lib/redirect.py +15 -22
- wandb/sdk/lib/reporting.py +1 -3
- wandb/sdk/lib/retry.py +4 -5
- wandb/sdk/lib/runid.py +1 -3
- wandb/sdk/lib/server.py +15 -9
- wandb/sdk/lib/sock_client.py +1 -1
- wandb/sdk/lib/sparkline.py +1 -1
- wandb/sdk/lib/wburls.py +1 -1
- wandb/sdk/service/port_file.py +1 -2
- wandb/sdk/service/service.py +36 -13
- wandb/sdk/service/service_base.py +12 -1
- wandb/sdk/verify/verify.py +5 -7
- wandb/sdk/wandb_artifacts.py +142 -177
- wandb/sdk/wandb_config.py +5 -8
- wandb/sdk/wandb_helper.py +1 -1
- wandb/sdk/wandb_init.py +24 -13
- wandb/sdk/wandb_login.py +9 -9
- wandb/sdk/wandb_manager.py +39 -4
- wandb/sdk/wandb_metric.py +2 -6
- wandb/sdk/wandb_require.py +4 -15
- wandb/sdk/wandb_require_helpers.py +1 -9
- wandb/sdk/wandb_run.py +95 -141
- wandb/sdk/wandb_save.py +1 -3
- wandb/sdk/wandb_settings.py +149 -54
- wandb/sdk/wandb_setup.py +66 -46
- wandb/sdk/wandb_summary.py +13 -10
- wandb/sdk/wandb_sweep.py +6 -7
- wandb/sdk/wandb_watch.py +1 -1
- wandb/sklearn/calculate/confusion_matrix.py +1 -1
- wandb/sklearn/calculate/learning_curve.py +1 -1
- wandb/sklearn/calculate/summary_metrics.py +1 -3
- wandb/sklearn/plot/__init__.py +1 -1
- wandb/sklearn/plot/classifier.py +27 -18
- wandb/sklearn/plot/clusterer.py +4 -5
- wandb/sklearn/plot/regressor.py +4 -4
- wandb/sklearn/plot/shared.py +2 -2
- wandb/sync/__init__.py +1 -3
- wandb/sync/sync.py +4 -5
- wandb/testing/relay.py +11 -10
- wandb/trigger.py +1 -1
- wandb/util.py +106 -81
- wandb/viz.py +4 -4
- wandb/wandb_agent.py +50 -50
- wandb/wandb_controller.py +2 -3
- wandb/wandb_run.py +1 -2
- wandb/wandb_torch.py +1 -1
- wandb/xgboost/__init__.py +1 -2
- {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/METADATA +6 -2
- {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/RECORD +224 -209
- {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/WHEEL +1 -1
- wandb/sdk/launch/builder/docker.py +0 -80
- wandb/sdk/launch/builder/kaniko.py +0 -393
- wandb/sdk/launch/builder/loader.py +0 -32
- wandb/sdk/launch/runner/loader.py +0 -50
- {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/LICENSE +0 -0
- {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/entry_points.txt +0 -0
- {wandb-0.13.10.dist-info → wandb-0.14.0.dist-info}/top_level.txt +0 -0
wandb/sdk/lib/retry.py
CHANGED
@@ -12,9 +12,10 @@ from typing import Any, Awaitable, Callable, Generic, Optional, Tuple, Type, Typ
|
|
12
12
|
from requests import HTTPError
|
13
13
|
|
14
14
|
import wandb
|
15
|
-
from wandb.errors import ContextCancelledError
|
16
15
|
from wandb.util import CheckRetryFnType
|
17
16
|
|
17
|
+
from .mailbox import ContextCancelledError
|
18
|
+
|
18
19
|
logger = logging.getLogger(__name__)
|
19
20
|
|
20
21
|
|
@@ -26,7 +27,7 @@ SLEEP_ASYNC_FN = asyncio.sleep
|
|
26
27
|
|
27
28
|
|
28
29
|
class TransientError(Exception):
|
29
|
-
"""Exception type designated for errors that may only be temporary
|
30
|
+
"""Exception type designated for errors that may only be temporary.
|
30
31
|
|
31
32
|
Can have its own message and/or wrap another exception.
|
32
33
|
"""
|
@@ -43,7 +44,7 @@ _R = TypeVar("_R")
|
|
43
44
|
|
44
45
|
|
45
46
|
class Retry(Generic[_R]):
|
46
|
-
"""
|
47
|
+
"""Create a retryable version of a function.
|
47
48
|
|
48
49
|
Calling this will call the passed function, retrying if any exceptions in
|
49
50
|
retryable_exceptions are caught, with exponential backoff.
|
@@ -98,7 +99,6 @@ class Retry(Generic[_R]):
|
|
98
99
|
sleep_base (kwarg): amount of time to sleep upon first failure, all other sleeps
|
99
100
|
are derived from this one.
|
100
101
|
"""
|
101
|
-
|
102
102
|
retry_timedelta = kwargs.pop("retry_timedelta", self._retry_timedelta)
|
103
103
|
if retry_timedelta is None:
|
104
104
|
retry_timedelta = datetime.timedelta(days=365)
|
@@ -279,7 +279,6 @@ async def retry_async(
|
|
279
279
|
|
280
280
|
Each time `fn` fails, `on_exc` is called with the exception.
|
281
281
|
"""
|
282
|
-
|
283
282
|
while True:
|
284
283
|
try:
|
285
284
|
return await fn(*args, **kwargs)
|
wandb/sdk/lib/runid.py
CHANGED
wandb/sdk/lib/server.py
CHANGED
@@ -1,26 +1,32 @@
|
|
1
|
-
"""
|
2
|
-
module server
|
3
|
-
"""
|
1
|
+
"""module server."""
|
4
2
|
|
5
3
|
import json
|
4
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
6
5
|
|
7
6
|
from wandb import util
|
8
7
|
from wandb.apis import InternalApi
|
9
8
|
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from wandb.sdk.wandb_settings import Settings
|
11
|
+
|
10
12
|
|
11
13
|
class ServerError(Exception):
|
12
14
|
pass
|
13
15
|
|
14
16
|
|
15
17
|
class Server:
|
16
|
-
def __init__(
|
18
|
+
def __init__(
|
19
|
+
self,
|
20
|
+
api: Optional[InternalApi] = None,
|
21
|
+
settings: Optional["Settings"] = None,
|
22
|
+
) -> None:
|
17
23
|
self._api = api or InternalApi(default_settings=settings)
|
18
|
-
self._error_network = None
|
19
|
-
self._viewer = {}
|
20
|
-
self._flags = {}
|
24
|
+
self._error_network: Optional[bool] = None
|
25
|
+
self._viewer: Dict[str, Any] = {}
|
26
|
+
self._flags: Dict[str, Any] = {}
|
21
27
|
self._settings = settings
|
22
28
|
|
23
|
-
def query_with_timeout(self, timeout=None):
|
29
|
+
def query_with_timeout(self, timeout: Union[int, float, None] = None) -> None:
|
24
30
|
if self._settings and self._settings._disable_viewer:
|
25
31
|
return
|
26
32
|
timeout = timeout or 5
|
@@ -40,7 +46,7 @@ class Server:
|
|
40
46
|
self._viewer, self._serverinfo = viewer_tuple
|
41
47
|
self._flags = json.loads(self._viewer.get("flags", "{}"))
|
42
48
|
|
43
|
-
def is_valid(self):
|
49
|
+
def is_valid(self) -> bool:
|
44
50
|
if self._error_network is None:
|
45
51
|
raise Exception("invalid usage: must query server")
|
46
52
|
return self._error_network
|
wandb/sdk/lib/sock_client.py
CHANGED
wandb/sdk/lib/sparkline.py
CHANGED
@@ -13,7 +13,7 @@ def isfinite(f):
|
|
13
13
|
|
14
14
|
|
15
15
|
def sparkify(series: List[Union[float, int]]) -> str:
|
16
|
-
"""
|
16
|
+
"""Convert <series> to a sparkline string.
|
17
17
|
|
18
18
|
Example:
|
19
19
|
>>> sparkify([ 0.5, 1.2, 3.5, 7.3, 8.0, 12.5, 13.2, 15.0, 14.2, 11.8, 6.1,
|
wandb/sdk/lib/wburls.py
CHANGED
@@ -27,7 +27,7 @@ class WBURLs:
|
|
27
27
|
cli_launch="https://wandb.me/launch",
|
28
28
|
doc_run="https://wandb.me/run",
|
29
29
|
doc_require="https://wandb.me/library-require",
|
30
|
-
doc_start_err="https://docs.wandb.ai/
|
30
|
+
doc_start_err="https://docs.wandb.ai/guides/track/tracking-faq#initstarterror-error-communicating-with-wandb-process-",
|
31
31
|
doc_artifacts_guide="https://docs.wandb.ai/guides/artifacts",
|
32
32
|
upgrade_server="https://wandb.me/server-upgrade",
|
33
33
|
multiprocess="http://wandb.me/init-multiprocess",
|
wandb/sdk/service/port_file.py
CHANGED
wandb/sdk/service/service.py
CHANGED
@@ -12,12 +12,9 @@ import tempfile
|
|
12
12
|
import time
|
13
13
|
from typing import TYPE_CHECKING, Any, Dict, Optional
|
14
14
|
|
15
|
-
from
|
16
|
-
|
17
|
-
|
18
|
-
ServiceStartTimeoutError,
|
19
|
-
)
|
20
|
-
from ...util import sentry_reraise, sentry_set_scope
|
15
|
+
from wandb.errors import Error
|
16
|
+
from wandb.util import sentry_reraise, sentry_set_scope
|
17
|
+
|
21
18
|
from . import _startup_debug, port_file
|
22
19
|
from .service_base import ServiceInterface
|
23
20
|
from .service_sock import ServiceSockInterface
|
@@ -26,6 +23,24 @@ if TYPE_CHECKING:
|
|
26
23
|
from wandb.sdk.wandb_settings import Settings
|
27
24
|
|
28
25
|
|
26
|
+
class ServiceStartProcessError(Error):
|
27
|
+
"""Raised when a known error occurs when launching wandb service."""
|
28
|
+
|
29
|
+
pass
|
30
|
+
|
31
|
+
|
32
|
+
class ServiceStartTimeoutError(Error):
|
33
|
+
"""Raised when service start times out."""
|
34
|
+
|
35
|
+
pass
|
36
|
+
|
37
|
+
|
38
|
+
class ServiceStartPortError(Error):
|
39
|
+
"""Raised when service start fails to find a port."""
|
40
|
+
|
41
|
+
pass
|
42
|
+
|
43
|
+
|
29
44
|
class _Service:
|
30
45
|
_settings: "Settings"
|
31
46
|
_grpc_port: Optional[int]
|
@@ -69,8 +84,7 @@ class _Service:
|
|
69
84
|
def _wait_for_ports(
|
70
85
|
self, fname: str, proc: Optional[subprocess.Popen] = None
|
71
86
|
) -> None:
|
72
|
-
"""
|
73
|
-
Wait for the service to write the port file and then read it.
|
87
|
+
"""Wait for the service to write the port file and then read it.
|
74
88
|
|
75
89
|
Args:
|
76
90
|
fname: The path to the port file.
|
@@ -87,14 +101,24 @@ class _Service:
|
|
87
101
|
if proc and proc.poll():
|
88
102
|
# process finished
|
89
103
|
# define these variables for sentry context grab:
|
90
|
-
command = proc.args
|
91
|
-
sys_executable = sys.executable
|
92
|
-
which_python = shutil.which("python3")
|
104
|
+
# command = proc.args
|
105
|
+
# sys_executable = sys.executable
|
106
|
+
# which_python = shutil.which("python3")
|
107
|
+
# proc_out = proc.stdout.read()
|
108
|
+
# proc_err = proc.stderr.read()
|
109
|
+
context = dict(
|
110
|
+
command=proc.args,
|
111
|
+
sys_executable=sys.executable,
|
112
|
+
which_python=shutil.which("python3"),
|
113
|
+
proc_out=proc.stdout.read() if proc.stdout else "",
|
114
|
+
proc_err=proc.stderr.read() if proc.stderr else "",
|
115
|
+
)
|
93
116
|
raise ServiceStartProcessError(
|
94
117
|
f"The wandb service process exited with {proc.returncode}. "
|
95
118
|
"Ensure that `sys.executable` is a valid python interpreter. "
|
96
119
|
"You can override it with the `_executable` setting "
|
97
|
-
"or with the `WANDB__EXECUTABLE` environment variable."
|
120
|
+
"or with the `WANDB__EXECUTABLE` environment variable.",
|
121
|
+
context=context,
|
98
122
|
)
|
99
123
|
if not os.path.isfile(fname):
|
100
124
|
time.sleep(0.2)
|
@@ -122,7 +146,6 @@ class _Service:
|
|
122
146
|
|
123
147
|
def _launch_server(self) -> None:
|
124
148
|
"""Launch server and set ports."""
|
125
|
-
|
126
149
|
# References for starting processes
|
127
150
|
# - https://github.com/wandb/wandb/blob/archive/old-cli/wandb/__init__.py
|
128
151
|
# - https://stackoverflow.com/questions/1196074/how-to-start-a-background-process-in-python
|
@@ -38,7 +38,18 @@ def _pbmap_apply_dict(
|
|
38
38
|
elif isinstance(v, str):
|
39
39
|
sv.string_value = v
|
40
40
|
elif isinstance(v, Iterable) and not isinstance(v, (str, bytes, Mapping)):
|
41
|
-
|
41
|
+
if all(isinstance(x, str) for x in v): # Iterable[str]
|
42
|
+
sv.tuple_value.string_values.extend(v)
|
43
|
+
elif isinstance(v, Mapping):
|
44
|
+
for kk, vv in v.items():
|
45
|
+
if isinstance(vv, str):
|
46
|
+
# flat map
|
47
|
+
sv.map_value.map_values[kk] = vv
|
48
|
+
elif isinstance(vv, Mapping):
|
49
|
+
# nested map
|
50
|
+
for kkk, vvv in vv.items():
|
51
|
+
sv.nested_map_value.nested_map_values[kk].map_values[kkk] = vvv
|
52
|
+
|
42
53
|
elif isinstance(v, datetime.datetime):
|
43
54
|
sv.timestamp_value = datetime.datetime.strftime(v, "%Y%m%d_%H%M%S")
|
44
55
|
else:
|
wandb/sdk/verify/verify.py
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
"""
|
2
|
-
Utilities for wandb verify
|
3
|
-
"""
|
1
|
+
"""Utilities for wandb verify."""
|
4
2
|
import getpass
|
5
3
|
import os
|
6
4
|
import time
|
7
5
|
from functools import partial
|
6
|
+
from pathlib import Path
|
8
7
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
9
8
|
|
10
9
|
import click
|
@@ -253,11 +252,11 @@ def artifact_with_path_or_paths(
|
|
253
252
|
with open(f"{verify_dir}/verify_1.txt", "w") as f:
|
254
253
|
f.write("1")
|
255
254
|
art.add_dir(verify_dir)
|
256
|
-
|
257
|
-
|
255
|
+
file3 = Path(verify_dir) / "verify_3.txt"
|
256
|
+
file3.write_text("3")
|
258
257
|
|
259
258
|
# reference to local file
|
260
|
-
art.add_reference(
|
259
|
+
art.add_reference(file3.resolve().as_uri())
|
261
260
|
|
262
261
|
return art
|
263
262
|
|
@@ -276,7 +275,6 @@ def log_use_download_artifact(
|
|
276
275
|
project=PROJECT_NAME,
|
277
276
|
config={"test": "artifact log"},
|
278
277
|
) as log_art_run:
|
279
|
-
|
280
278
|
if add_extra_file:
|
281
279
|
with open("verify_2.txt", "w") as f:
|
282
280
|
f.write("2")
|