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/apis/reports/_templates.py
CHANGED
@@ -4,9 +4,7 @@ from .util import coalesce
|
|
4
4
|
|
5
5
|
|
6
6
|
def create_example_header():
|
7
|
-
"""
|
8
|
-
Creates an example header with image at top.
|
9
|
-
"""
|
7
|
+
"""Create an example header with image at top."""
|
10
8
|
import wandb.apis.reports as wr
|
11
9
|
|
12
10
|
return [
|
@@ -23,9 +21,7 @@ def create_example_header():
|
|
23
21
|
|
24
22
|
|
25
23
|
def create_example_footer():
|
26
|
-
"""
|
27
|
-
Creates an example footer with image and text at bottom.
|
28
|
-
"""
|
24
|
+
"""Create an example footer with image and text at bottom."""
|
29
25
|
import wandb.apis.reports as wr
|
30
26
|
|
31
27
|
return [
|
@@ -49,9 +45,9 @@ def create_enterprise_report(
|
|
49
45
|
body=None,
|
50
46
|
footer=None,
|
51
47
|
):
|
52
|
-
"""
|
53
|
-
|
54
|
-
|
48
|
+
"""Create an example enterprise report with a header and footer.
|
49
|
+
|
50
|
+
Can be used to add custom branding to reports.
|
55
51
|
"""
|
56
52
|
import wandb.apis.reports as wr
|
57
53
|
|
@@ -74,9 +70,7 @@ def create_customer_landing_page(
|
|
74
70
|
main_contact="My Contact (name@email.com)",
|
75
71
|
slack_link="https://company.slack.com",
|
76
72
|
):
|
77
|
-
"""
|
78
|
-
Creates an example customer landing page using data from Andrew's demo.
|
79
|
-
"""
|
73
|
+
"""Create an example customer landing page using data from Andrew's demo."""
|
80
74
|
import wandb.apis.reports as wr
|
81
75
|
|
82
76
|
project = coalesce(project, "default-project")
|
wandb/apis/reports/report.py
CHANGED
@@ -220,7 +220,7 @@ class Report(Base):
|
|
220
220
|
return self
|
221
221
|
|
222
222
|
def to_html(self, height: int = 1024, hidden: bool = False) -> str:
|
223
|
-
"""Generate HTML containing an iframe displaying this report"""
|
223
|
+
"""Generate HTML containing an iframe displaying this report."""
|
224
224
|
try:
|
225
225
|
url = self.url + "?jupyter=true"
|
226
226
|
style = f"border:none;width:100%;height:{height}px;"
|
wandb/apis/reports/runset.py
CHANGED
@@ -43,9 +43,7 @@ class Runset(Base):
|
|
43
43
|
|
44
44
|
@classmethod
|
45
45
|
def from_json(cls, spec: Dict[str, Any]) -> T:
|
46
|
-
"""
|
47
|
-
This has a custom implementation because sometimes runsets are missing the project field.
|
48
|
-
"""
|
46
|
+
"""This has a custom implementation because sometimes runsets are missing the project field."""
|
49
47
|
obj = cls()
|
50
48
|
obj._spec = spec
|
51
49
|
|
wandb/apis/reports/util.py
CHANGED
@@ -22,10 +22,10 @@ Func = Callable[[T], V]
|
|
22
22
|
|
23
23
|
|
24
24
|
def generate_name(length: int = 12) -> str:
|
25
|
-
"""
|
26
|
-
|
25
|
+
"""Generate a random name.
|
26
|
+
|
27
27
|
This implementation roughly based the following snippet in core:
|
28
|
-
https://github.com/wandb/core/blob/master/lib/js/cg/src/utils/string.ts#L39-L44
|
28
|
+
https://github.com/wandb/core/blob/master/lib/js/cg/src/utils/string.ts#L39-L44.
|
29
29
|
"""
|
30
30
|
|
31
31
|
# Borrowed from numpy: https://github.com/numpy/numpy/blob/v1.23.0/numpy/core/numeric.py#L2069-L2123
|
@@ -54,14 +54,17 @@ def generate_name(length: int = 12) -> str:
|
|
54
54
|
|
55
55
|
|
56
56
|
def coalesce(*arg: Any) -> Any:
|
57
|
-
"""Return the first non-none value in the list of arguments.
|
57
|
+
"""Return the first non-none value in the list of arguments.
|
58
|
+
|
59
|
+
Similar to ?? in C#.
|
60
|
+
"""
|
58
61
|
return next((a for a in arg if a is not None), None)
|
59
62
|
|
60
63
|
|
61
64
|
def nested_get(json: dict, keys: str) -> Any:
|
62
|
-
"""
|
63
|
-
|
64
|
-
The first item of the path can be an object
|
65
|
+
"""Get the element at the terminal node of a nested JSON dict based on `path`.
|
66
|
+
|
67
|
+
The first item of the path can be an object.
|
65
68
|
"""
|
66
69
|
keys = keys.split(".")
|
67
70
|
if len(keys) == 1:
|
@@ -81,8 +84,8 @@ def nested_get(json: dict, keys: str) -> Any:
|
|
81
84
|
|
82
85
|
|
83
86
|
def nested_set(json: dict, keys: str, value: Any) -> None:
|
84
|
-
"""
|
85
|
-
|
87
|
+
"""Set the element at the terminal node of a nested JSON dict based on `path`.
|
88
|
+
|
86
89
|
The first item of the path can be an object.
|
87
90
|
|
88
91
|
If nodes do not exist, they are created along the way.
|
@@ -323,7 +326,6 @@ def fix_collisions(panels: List[Panel]) -> List[Panel]:
|
|
323
326
|
for i, p1 in enumerate(panels):
|
324
327
|
for p2 in panels[i:]:
|
325
328
|
if collides(p1, p2):
|
326
|
-
|
327
329
|
# try to move right
|
328
330
|
x, y = shift(p1, p2)
|
329
331
|
if p2.layout["x"] + p2.layout["w"] + x <= x_max:
|
wandb/beta/workflows.py
CHANGED
@@ -16,15 +16,17 @@ def _add_any(
|
|
16
16
|
], # todo: add dataframe
|
17
17
|
name: Optional[str],
|
18
18
|
) -> Any:
|
19
|
-
"""
|
20
|
-
under Artifact depending on the type of object that's passed in. This will probably be moved
|
21
|
-
to the Artifact class in the future.
|
19
|
+
"""Add an object to an artifact.
|
22
20
|
|
23
|
-
|
24
|
-
|
21
|
+
High-level wrapper to add object(s) to an artifact - calls any of the .add* methods
|
22
|
+
under Artifact depending on the type of object that's passed in. This will probably
|
23
|
+
be moved to the Artifact class in the future.
|
25
24
|
|
26
|
-
|
27
|
-
|
25
|
+
Args:
|
26
|
+
artifact: `ArtifactInterface` - most likely a LocalArtifact created with
|
27
|
+
`wandb.Artifact(...)`
|
28
|
+
path_or_obj: `Union[str, ArtifactManifestEntry, data_types.WBValue]` - either a
|
29
|
+
str or valid object which indicates what to add to an artifact.
|
28
30
|
|
29
31
|
name: `str` - the name of the object which is added to an artifact.
|
30
32
|
|
@@ -61,15 +63,20 @@ def _log_artifact_version(
|
|
61
63
|
scope_project: Optional[bool] = None,
|
62
64
|
job_type: str = "auto",
|
63
65
|
) -> ArtifactInterface:
|
64
|
-
"""
|
66
|
+
"""Create an artifact, populate it, and log it with a run.
|
67
|
+
|
65
68
|
If a run is not present, we create one.
|
66
69
|
|
67
70
|
Args:
|
68
|
-
name: `str` - name of the artifact. If not scoped to a project, name will be
|
69
|
-
|
70
|
-
|
71
|
+
name: `str` - name of the artifact. If not scoped to a project, name will be
|
72
|
+
suffixed by "-{run_id}".
|
73
|
+
type: `str` - type of the artifact, used in the UI to group artifacts of the
|
74
|
+
same type.
|
75
|
+
entries: `Dict` - dictionary containing the named objects we want added to this
|
76
|
+
artifact.
|
71
77
|
description: `str` - text description of artifact.
|
72
|
-
metadata: `Dict` - users can pass in artifact-specific metadata here, will be
|
78
|
+
metadata: `Dict` - users can pass in artifact-specific metadata here, will be
|
79
|
+
visible in the UI.
|
73
80
|
project: `str` - project under which to place this artifact.
|
74
81
|
scope_project: `bool` - if True, we will not suffix `name` with "-{run_id}".
|
75
82
|
job_type: `str` - Only applied if run is not present and we create one.
|
@@ -114,28 +121,35 @@ def log_model(
|
|
114
121
|
scope_project: Optional[bool] = None,
|
115
122
|
**kwargs: Dict[str, Any],
|
116
123
|
) -> "_SavedModel":
|
117
|
-
"""
|
118
|
-
|
119
|
-
|
124
|
+
"""Log a model object to enable model-centric workflows in the UI.
|
125
|
+
|
126
|
+
Supported frameworks include PyTorch, Keras, Tensorflow, Scikit-learn, etc. Under
|
127
|
+
the hood, we create a model artifact, bind it to the run that produced this model,
|
120
128
|
associate it with the latest metrics logged with `wandb.log(...)` and more.
|
121
129
|
|
122
130
|
Args:
|
123
|
-
model_obj: any model object created with the following ML frameworks: PyTorch,
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
131
|
+
model_obj: any model object created with the following ML frameworks: PyTorch,
|
132
|
+
Keras, Tensorflow, Scikit-learn. name: `str` - name of the model artifact
|
133
|
+
that will be created to house this model_obj.
|
134
|
+
aliases: `str, List[str]` - optional alias(es) that will be applied on this
|
135
|
+
model and allow for unique identification. The alias "latest" will always be
|
136
|
+
applied to the latest version of a model.
|
137
|
+
description: `str` - text description/notes about the model - will be visible in
|
138
|
+
the Model Card UI.
|
128
139
|
metadata: `Dict` - model-specific metadata goes here - will be visible the UI.
|
129
140
|
project: `str` - project under which to place this artifact.
|
130
|
-
scope_project: `bool` - If true, name of this model artifact will not be
|
141
|
+
scope_project: `bool` - If true, name of this model artifact will not be
|
142
|
+
suffixed by `-{run_id}`.
|
131
143
|
|
132
144
|
Returns:
|
133
145
|
_SavedModel instance
|
134
146
|
|
135
147
|
Example:
|
148
|
+
```python
|
136
149
|
import torch.nn as nn
|
137
150
|
import torch.nn.functional as F
|
138
151
|
|
152
|
+
|
139
153
|
class Net(nn.Module):
|
140
154
|
def __init__(self):
|
141
155
|
super(Net, self).__init__()
|
@@ -146,8 +160,10 @@ def log_model(
|
|
146
160
|
x = F.relu(x)
|
147
161
|
return x
|
148
162
|
|
163
|
+
|
149
164
|
model = Net()
|
150
165
|
sm = log_model(model, "my-simple-model", aliases=["best"])
|
166
|
+
```
|
151
167
|
|
152
168
|
"""
|
153
169
|
model = data_types._SavedModel.init(model_obj, **kwargs)
|
@@ -169,21 +185,25 @@ def log_model(
|
|
169
185
|
|
170
186
|
|
171
187
|
def use_model(aliased_path: str) -> "_SavedModel":
|
172
|
-
"""
|
173
|
-
|
174
|
-
|
175
|
-
|
188
|
+
"""Fetch a saved model from an alias.
|
189
|
+
|
190
|
+
Under the hood, we use the alias to fetch the model artifact containing the
|
191
|
+
serialized model files and rebuild the model object from these files. We also
|
192
|
+
declare the fetched model artifact as an input to the run (with `run.use_artifact`).
|
176
193
|
|
177
194
|
Args:
|
178
|
-
aliased_path: `str` - the following forms are valid: "name:version",
|
195
|
+
aliased_path: `str` - the following forms are valid: "name:version",
|
196
|
+
"name:alias". May be prefixed with "entity/project".
|
179
197
|
|
180
198
|
Returns:
|
181
199
|
_SavedModel instance
|
182
200
|
|
183
201
|
Example:
|
184
|
-
|
202
|
+
```python
|
203
|
+
# Assuming you have previously logged a model with the name "my-simple-model":
|
185
204
|
sm = use_model("my-simple-model:latest")
|
186
205
|
model = sm.model_obj()
|
206
|
+
```
|
187
207
|
"""
|
188
208
|
if ":" not in aliased_path:
|
189
209
|
raise ValueError(
|
@@ -213,15 +233,19 @@ def link_model(
|
|
213
233
|
target_path: str,
|
214
234
|
aliases: Optional[Union[str, List[str]]] = None,
|
215
235
|
) -> None:
|
216
|
-
"""
|
236
|
+
"""Link the given model to a portfolio.
|
237
|
+
|
238
|
+
A portfolio is a promoted collection which contains (in this case) model artifacts.
|
217
239
|
Linking to a portfolio allows for useful model-centric workflows in the UI.
|
218
240
|
|
219
241
|
Args:
|
220
|
-
model: `_SavedModel` - an instance of _SavedModel, most likely from the output
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
242
|
+
model: `_SavedModel` - an instance of _SavedModel, most likely from the output
|
243
|
+
of `log_model` or `use_model`.
|
244
|
+
target_path: `str` - the target portfolio. The following forms are valid for the
|
245
|
+
string: {portfolio}, {project/portfolio},{entity}/{project}/{portfolio}.
|
246
|
+
aliases: `str, List[str]` - optional alias(es) that will only be applied on this
|
247
|
+
linked model inside the portfolio. The alias "latest" will always be applied
|
248
|
+
to the latest version of a model.
|
225
249
|
|
226
250
|
Returns:
|
227
251
|
None
|
@@ -231,7 +255,6 @@ def link_model(
|
|
231
255
|
link_model(sm, "my-portfolio")
|
232
256
|
|
233
257
|
"""
|
234
|
-
|
235
258
|
aliases = wandb.util._resolve_aliases(aliases)
|
236
259
|
|
237
260
|
if wandb.run:
|
wandb/catboost/__init__.py
CHANGED