zenml-nightly 0.54.1.dev20240118__py3-none-any.whl → 0.54.1.dev20240120__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.
- zenml/__init__.py +10 -4
- zenml/artifacts/artifact_config.py +12 -12
- zenml/artifacts/external_artifact.py +3 -3
- zenml/artifacts/external_artifact_config.py +8 -8
- zenml/artifacts/utils.py +4 -4
- zenml/cli/__init__.py +4 -4
- zenml/cli/artifact.py +38 -18
- zenml/cli/base.py +3 -3
- zenml/cli/model.py +24 -16
- zenml/cli/server.py +9 -0
- zenml/cli/utils.py +3 -3
- zenml/client.py +13 -2
- zenml/config/compiler.py +1 -1
- zenml/config/pipeline_configurations.py +2 -2
- zenml/config/pipeline_run_configuration.py +2 -2
- zenml/config/step_configurations.py +2 -2
- zenml/integrations/__init__.py +2 -4
- zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +11 -9
- zenml/metadata/lazy_load.py +5 -5
- zenml/model/lazy_load.py +2 -2
- zenml/model/{model_version.py → model.py} +47 -38
- zenml/model/utils.py +33 -33
- zenml/model_registries/base_model_registry.py +10 -8
- zenml/models/__init__.py +2 -0
- zenml/models/v2/base/filter.py +3 -0
- zenml/models/v2/base/scoped.py +59 -0
- zenml/models/v2/core/artifact.py +2 -2
- zenml/models/v2/core/artifact_version.py +6 -6
- zenml/models/v2/core/model.py +6 -6
- zenml/models/v2/core/model_version.py +9 -9
- zenml/models/v2/core/run_metadata.py +2 -2
- zenml/new/pipelines/model_utils.py +20 -20
- zenml/new/pipelines/pipeline.py +47 -54
- zenml/new/pipelines/pipeline_context.py +1 -1
- zenml/new/pipelines/pipeline_decorator.py +4 -4
- zenml/new/steps/step_context.py +15 -15
- zenml/new/steps/step_decorator.py +5 -5
- zenml/orchestrators/input_utils.py +5 -7
- zenml/orchestrators/step_launcher.py +12 -19
- zenml/orchestrators/step_runner.py +8 -10
- zenml/pipelines/base_pipeline.py +1 -1
- zenml/pipelines/pipeline_decorator.py +6 -6
- zenml/steps/base_step.py +15 -15
- zenml/steps/step_decorator.py +6 -6
- zenml/steps/utils.py +68 -0
- zenml/zen_server/deploy/helm/templates/server-db-job.yaml +1 -1
- zenml/zen_server/deploy/helm/templates/server-secret.yaml +1 -1
- zenml/zen_server/deploy/helm/templates/serviceaccount.yaml +1 -1
- zenml/zen_server/utils.py +19 -1
- zenml/zen_stores/migrations/versions/4d688d8f7aff_rename_model_version_to_model.py +94 -0
- zenml/zen_stores/migrations/versions/7b651bf6822e_track_secrets_in_db.py +16 -4
- zenml/zen_stores/rest_zen_store.py +2 -2
- zenml/zen_stores/sql_zen_store.py +4 -1
- {zenml_nightly-0.54.1.dev20240118.dist-info → zenml_nightly-0.54.1.dev20240120.dist-info}/METADATA +1 -1
- {zenml_nightly-0.54.1.dev20240118.dist-info → zenml_nightly-0.54.1.dev20240120.dist-info}/RECORD +58 -57
- {zenml_nightly-0.54.1.dev20240118.dist-info → zenml_nightly-0.54.1.dev20240120.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.54.1.dev20240118.dist-info → zenml_nightly-0.54.1.dev20240120.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.54.1.dev20240118.dist-info → zenml_nightly-0.54.1.dev20240120.dist-info}/entry_points.txt +0 -0
zenml/__init__.py
CHANGED
@@ -42,15 +42,19 @@ from zenml.artifacts.utils import (
|
|
42
42
|
save_artifact,
|
43
43
|
load_artifact,
|
44
44
|
)
|
45
|
-
from zenml.model.utils import
|
45
|
+
from zenml.model.utils import (
|
46
|
+
log_model_metadata,
|
47
|
+
link_artifact_to_model,
|
48
|
+
log_model_version_metadata,
|
49
|
+
)
|
46
50
|
from zenml.artifacts.artifact_config import ArtifactConfig
|
47
51
|
from zenml.artifacts.external_artifact import ExternalArtifact
|
48
|
-
from zenml.model.
|
49
|
-
from zenml.model.utils import log_model_version_metadata
|
52
|
+
from zenml.model.model import Model
|
50
53
|
from zenml.new.pipelines.pipeline_context import get_pipeline_context
|
51
54
|
from zenml.new.pipelines.pipeline_decorator import pipeline
|
52
55
|
from zenml.new.steps.step_decorator import step
|
53
56
|
from zenml.new.steps.step_context import get_step_context
|
57
|
+
from zenml.steps.utils import log_step_metadata
|
54
58
|
|
55
59
|
__all__ = [
|
56
60
|
"ArtifactConfig",
|
@@ -60,8 +64,10 @@ __all__ = [
|
|
60
64
|
"load_artifact",
|
61
65
|
"log_artifact_metadata",
|
62
66
|
"log_model_metadata",
|
67
|
+
"log_model_version_metadata",
|
68
|
+
"log_step_metadata",
|
69
|
+
"Model",
|
63
70
|
"link_artifact_to_model",
|
64
|
-
"ModelVersion",
|
65
71
|
"pipeline",
|
66
72
|
"save_artifact",
|
67
73
|
"show",
|
@@ -22,7 +22,7 @@ from zenml.logger import get_logger
|
|
22
22
|
from zenml.new.steps.step_context import get_step_context
|
23
23
|
|
24
24
|
if TYPE_CHECKING:
|
25
|
-
from zenml.model.
|
25
|
+
from zenml.model.model import Model
|
26
26
|
|
27
27
|
|
28
28
|
logger = get_logger(__name__)
|
@@ -52,7 +52,7 @@ class ArtifactConfig(BaseModel):
|
|
52
52
|
version: The version of the artifact.
|
53
53
|
tags: The tags of the artifact.
|
54
54
|
model_name: The name of the model to link artifact to.
|
55
|
-
model_version: The identifier of the model
|
55
|
+
model_version: The identifier of a version of the model to link the artifact
|
56
56
|
to. It can be an exact version ("my_version"), exact version number
|
57
57
|
(42), stage (ModelStages.PRODUCTION or "production"), or
|
58
58
|
(ModelStages.LATEST or None) for the latest version (default).
|
@@ -88,26 +88,26 @@ class ArtifactConfig(BaseModel):
|
|
88
88
|
smart_union = True
|
89
89
|
|
90
90
|
@property
|
91
|
-
def
|
92
|
-
"""The model
|
91
|
+
def _model(self) -> Optional["Model"]:
|
92
|
+
"""The model linked to this artifact.
|
93
93
|
|
94
94
|
Returns:
|
95
|
-
The model
|
95
|
+
The model or None if the model version cannot be determined.
|
96
96
|
"""
|
97
97
|
try:
|
98
|
-
|
98
|
+
model_ = get_step_context().model
|
99
99
|
except (StepContextError, RuntimeError):
|
100
|
-
|
100
|
+
model_ = None
|
101
101
|
# Check if another model name was specified
|
102
102
|
if (self.model_name is not None) and (
|
103
|
-
|
103
|
+
model_ is None or model_.name != self.model_name
|
104
104
|
):
|
105
|
-
# Create a new
|
106
|
-
from zenml.model.
|
105
|
+
# Create a new Model instance with the provided model name and version
|
106
|
+
from zenml.model.model import Model
|
107
107
|
|
108
|
-
on_the_fly_config =
|
108
|
+
on_the_fly_config = Model(
|
109
109
|
name=self.model_name, version=self.model_version
|
110
110
|
)
|
111
111
|
return on_the_fly_config
|
112
112
|
|
113
|
-
return
|
113
|
+
return model_
|
@@ -56,8 +56,8 @@ class ExternalArtifact(ExternalArtifactConfiguration):
|
|
56
56
|
`version`, `pipeline_run_name`, or `pipeline_name` are set, the
|
57
57
|
latest version of the artifact will be used.
|
58
58
|
version: Version of the artifact to search. Only used when `name` is
|
59
|
-
provided. Cannot be used together with `
|
60
|
-
|
59
|
+
provided. Cannot be used together with `model`.
|
60
|
+
model: The model to search in. Only used when `name`
|
61
61
|
is provided. Cannot be used together with `version`.
|
62
62
|
materializer: The materializer to use for saving the artifact value
|
63
63
|
to the artifact store. Only used when `value` is provided.
|
@@ -149,5 +149,5 @@ class ExternalArtifact(ExternalArtifactConfiguration):
|
|
149
149
|
id=self.id,
|
150
150
|
name=self.name,
|
151
151
|
version=self.version,
|
152
|
-
|
152
|
+
model=self.model,
|
153
153
|
)
|
@@ -18,7 +18,7 @@ from uuid import UUID
|
|
18
18
|
from pydantic import BaseModel, root_validator
|
19
19
|
|
20
20
|
from zenml.logger import get_logger
|
21
|
-
from zenml.model.
|
21
|
+
from zenml.model.model import Model
|
22
22
|
from zenml.models.v2.core.artifact_version import ArtifactVersionResponse
|
23
23
|
|
24
24
|
logger = get_logger(__name__)
|
@@ -33,13 +33,13 @@ class ExternalArtifactConfiguration(BaseModel):
|
|
33
33
|
id: Optional[UUID] = None
|
34
34
|
name: Optional[str] = None
|
35
35
|
version: Optional[str] = None
|
36
|
-
|
36
|
+
model: Optional[Model] = None
|
37
37
|
|
38
38
|
@root_validator
|
39
39
|
def _validate_all_eac(cls, values: Dict[str, Any]) -> Dict[str, Any]:
|
40
|
-
if values.get("version", None) and values.get("
|
40
|
+
if values.get("version", None) and values.get("model", None):
|
41
41
|
raise ValueError(
|
42
|
-
"Cannot provide both `version` and `
|
42
|
+
"Cannot provide both `version` and `model` when "
|
43
43
|
"creating an external artifact."
|
44
44
|
)
|
45
45
|
return values
|
@@ -67,13 +67,13 @@ class ExternalArtifactConfiguration(BaseModel):
|
|
67
67
|
response = client.get_artifact_version(
|
68
68
|
self.name, version=self.version
|
69
69
|
)
|
70
|
-
elif self.
|
71
|
-
response_ = self.
|
70
|
+
elif self.model:
|
71
|
+
response_ = self.model.get_artifact(self.name)
|
72
72
|
if not isinstance(response_, ArtifactVersionResponse):
|
73
73
|
raise RuntimeError(
|
74
74
|
f"Failed to pull artifact `{self.name}` from the Model "
|
75
|
-
f"
|
76
|
-
f"`{self.
|
75
|
+
f"(name=`{self.model.name}`, version="
|
76
|
+
f"`{self.model.version}`). Please validate the "
|
77
77
|
"input and try again."
|
78
78
|
)
|
79
79
|
response = response_
|
zenml/artifacts/utils.py
CHANGED
@@ -233,14 +233,14 @@ def save_artifact(
|
|
233
233
|
saved_artifact_versions={name: response.id}
|
234
234
|
),
|
235
235
|
)
|
236
|
-
error_message = "model
|
237
|
-
|
238
|
-
if
|
236
|
+
error_message = "model"
|
237
|
+
model = step_context.model
|
238
|
+
if model:
|
239
239
|
from zenml.model.utils import link_artifact_to_model
|
240
240
|
|
241
241
|
link_artifact_to_model(
|
242
242
|
artifact_version_id=response.id,
|
243
|
-
|
243
|
+
model=model,
|
244
244
|
is_model_artifact=is_model_artifact,
|
245
245
|
is_deployment_artifact=is_deployment_artifact,
|
246
246
|
)
|
zenml/cli/__init__.py
CHANGED
@@ -796,7 +796,7 @@ Administering your Models
|
|
796
796
|
----------------------------
|
797
797
|
|
798
798
|
ZenML provides several CLI commands to help you administer your models and
|
799
|
-
|
799
|
+
their versions as part of the Model Control Plane.
|
800
800
|
|
801
801
|
To register a new model, you can use the following CLI command:
|
802
802
|
```bash
|
@@ -805,7 +805,7 @@ zenml model register --name <NAME> [--MODEL_OPTIONS]
|
|
805
805
|
|
806
806
|
To list all registered models, use:
|
807
807
|
```bash
|
808
|
-
zenml model list
|
808
|
+
zenml model list [MODEL_FILTER_OPTIONS]
|
809
809
|
```
|
810
810
|
|
811
811
|
To update a model, use:
|
@@ -827,7 +827,7 @@ zenml model delete <MODEL_NAME_OR_ID>
|
|
827
827
|
The CLI interface for models also helps to navigate through artifacts linked to a specific model versions.
|
828
828
|
```bash
|
829
829
|
zenml model data_artifacts <MODEL_NAME_OR_ID> [-v <VERSION>]
|
830
|
-
zenml model
|
830
|
+
zenml model deployment_artifacts <MODEL_NAME_OR_ID> [-v <VERSION>]
|
831
831
|
zenml model model_artifacts <MODEL_NAME_OR_ID> [-v <VERSION>]
|
832
832
|
```
|
833
833
|
|
@@ -838,7 +838,7 @@ zenml model runs <MODEL_NAME_OR_ID> [-v <VERSION>]
|
|
838
838
|
|
839
839
|
To list the model versions of a specific model, use:
|
840
840
|
```bash
|
841
|
-
zenml model version list <
|
841
|
+
zenml model version list [--model-name <MODEL_NAME> --name <MODEL_VERSION_NAME> OTHER_OPTIONS]
|
842
842
|
```
|
843
843
|
|
844
844
|
To delete a model version, use:
|
zenml/cli/artifact.py
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""CLI functionality to interact with artifacts."""
|
15
15
|
from functools import partial
|
16
|
-
from typing import Any, List, Optional
|
16
|
+
from typing import Any, Dict, List, Optional
|
17
17
|
|
18
18
|
import click
|
19
19
|
|
@@ -23,6 +23,8 @@ from zenml.client import Client
|
|
23
23
|
from zenml.enums import CliCategories
|
24
24
|
from zenml.logger import get_logger
|
25
25
|
from zenml.models import ArtifactFilter, ArtifactVersionFilter
|
26
|
+
from zenml.models.v2.core.artifact import ArtifactResponse
|
27
|
+
from zenml.models.v2.core.artifact_version import ArtifactVersionResponse
|
26
28
|
from zenml.utils.pagination_utils import depaginate
|
27
29
|
|
28
30
|
logger = get_logger(__name__)
|
@@ -47,10 +49,11 @@ def list_artifacts(**kwargs: Any) -> None:
|
|
47
49
|
cli_utils.declare("No artifacts found.")
|
48
50
|
return
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
52
|
+
to_print = []
|
53
|
+
for artifact in artifacts:
|
54
|
+
to_print.append(_artifact_to_print(artifact))
|
55
|
+
|
56
|
+
cli_utils.print_table(to_print)
|
54
57
|
|
55
58
|
|
56
59
|
@artifact.command("update", help="Update an artifact.")
|
@@ -126,19 +129,11 @@ def list_artifact_versions(**kwargs: Any) -> None:
|
|
126
129
|
cli_utils.declare("No artifact versions found.")
|
127
130
|
return
|
128
131
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
"user",
|
135
|
-
"workspace",
|
136
|
-
"producer_step_run_id",
|
137
|
-
"run_metadata",
|
138
|
-
"artifact_store_id",
|
139
|
-
"visualizations",
|
140
|
-
],
|
141
|
-
)
|
132
|
+
to_print = []
|
133
|
+
for artifact_version in artifact_versions:
|
134
|
+
to_print.append(_artifact_version_to_print(artifact_version))
|
135
|
+
|
136
|
+
cli_utils.print_table(to_print)
|
142
137
|
|
143
138
|
|
144
139
|
@version.command("update", help="Update an artifact version.")
|
@@ -281,3 +276,28 @@ def prune_artifacts(
|
|
281
276
|
except Exception as e:
|
282
277
|
cli_utils.error(str(e))
|
283
278
|
cli_utils.declare("All unused artifacts and artifact versions deleted.")
|
279
|
+
|
280
|
+
|
281
|
+
def _artifact_version_to_print(
|
282
|
+
artifact_version: ArtifactVersionResponse,
|
283
|
+
) -> Dict[str, Any]:
|
284
|
+
return {
|
285
|
+
"id": artifact_version.id,
|
286
|
+
"name": artifact_version.artifact.name,
|
287
|
+
"version": artifact_version.version,
|
288
|
+
"uri": artifact_version.uri,
|
289
|
+
"type": artifact_version.type,
|
290
|
+
"materializer": artifact_version.materializer,
|
291
|
+
"data_type": artifact_version.data_type,
|
292
|
+
"tags": [t.name for t in artifact_version.tags],
|
293
|
+
}
|
294
|
+
|
295
|
+
|
296
|
+
def _artifact_to_print(
|
297
|
+
artifact_version: ArtifactResponse,
|
298
|
+
) -> Dict[str, Any]:
|
299
|
+
return {
|
300
|
+
"id": artifact_version.id,
|
301
|
+
"name": artifact_version.name,
|
302
|
+
"tags": [t.name for t in artifact_version.tags],
|
303
|
+
}
|
zenml/cli/base.py
CHANGED
@@ -73,15 +73,15 @@ class ZenMLProjectTemplateLocation(BaseModel):
|
|
73
73
|
ZENML_PROJECT_TEMPLATES = dict(
|
74
74
|
e2e_batch=ZenMLProjectTemplateLocation(
|
75
75
|
github_url="zenml-io/template-e2e-batch",
|
76
|
-
github_tag="2024.01.
|
76
|
+
github_tag="2024.01.18", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
|
77
77
|
),
|
78
78
|
starter=ZenMLProjectTemplateLocation(
|
79
79
|
github_url="zenml-io/template-starter",
|
80
|
-
github_tag="
|
80
|
+
github_tag="2024.01.12", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
|
81
81
|
),
|
82
82
|
nlp=ZenMLProjectTemplateLocation(
|
83
83
|
github_url="zenml-io/template-nlp",
|
84
|
-
github_tag="
|
84
|
+
github_tag="2024.01.12", # Make sure it is aligned with .github/workflows/update-templates-to-examples.yml
|
85
85
|
),
|
86
86
|
)
|
87
87
|
|
zenml/cli/model.py
CHANGED
@@ -23,6 +23,7 @@ from zenml.enums import CliCategories, ModelStages
|
|
23
23
|
from zenml.exceptions import EntityExistsError
|
24
24
|
from zenml.logger import get_logger
|
25
25
|
from zenml.models import (
|
26
|
+
ModelFilter,
|
26
27
|
ModelResponse,
|
27
28
|
ModelVersionArtifactFilter,
|
28
29
|
ModelVersionFilter,
|
@@ -54,13 +55,19 @@ def _model_to_print(model: ModelResponse) -> Dict[str, Any]:
|
|
54
55
|
def _model_version_to_print(
|
55
56
|
model_version: ModelVersionResponse,
|
56
57
|
) -> Dict[str, Any]:
|
58
|
+
run_metadata = None
|
59
|
+
if model_version.run_metadata:
|
60
|
+
run_metadata = {
|
61
|
+
k: v.value for k, v in model_version.run_metadata.items()
|
62
|
+
}
|
57
63
|
return {
|
58
64
|
"id": model_version.id,
|
65
|
+
"model": model_version.model.name,
|
59
66
|
"name": model_version.name,
|
60
67
|
"number": model_version.number,
|
61
68
|
"description": model_version.description,
|
62
69
|
"stage": model_version.stage,
|
63
|
-
"
|
70
|
+
"run_metadata": run_metadata,
|
64
71
|
"tags": [t.name for t in model_version.tags],
|
65
72
|
"data_artifacts_count": len(model_version.data_artifact_ids),
|
66
73
|
"model_artifacts_count": len(model_version.model_artifact_ids),
|
@@ -77,21 +84,17 @@ def model() -> None:
|
|
77
84
|
"""Interact with models and model versions in the Model Control Plane."""
|
78
85
|
|
79
86
|
|
80
|
-
@
|
81
|
-
"--name",
|
82
|
-
"-n",
|
83
|
-
help="The name of the model.",
|
84
|
-
type=str,
|
85
|
-
required=False,
|
86
|
-
)
|
87
|
+
@cli_utils.list_options(ModelFilter)
|
87
88
|
@model.command("list", help="List models with filter.")
|
88
|
-
def list_models(
|
89
|
+
def list_models(**kwargs: Any) -> None:
|
89
90
|
"""List models with filter in the Model Control Plane.
|
90
91
|
|
91
92
|
Args:
|
92
|
-
|
93
|
+
**kwargs: Keyword arguments to filter models.
|
93
94
|
"""
|
94
|
-
models = Client().list_models(
|
95
|
+
models = Client().zen_store.list_models(
|
96
|
+
model_filter_model=ModelFilter(**kwargs)
|
97
|
+
)
|
95
98
|
|
96
99
|
if not models:
|
97
100
|
cli_utils.declare("No models found.")
|
@@ -369,18 +372,23 @@ def version() -> None:
|
|
369
372
|
|
370
373
|
|
371
374
|
@cli_utils.list_options(ModelVersionFilter)
|
372
|
-
@click.
|
375
|
+
@click.option(
|
376
|
+
"--model-name",
|
377
|
+
"-n",
|
378
|
+
help="The name of the parent model.",
|
379
|
+
type=str,
|
380
|
+
required=False,
|
381
|
+
)
|
373
382
|
@version.command("list", help="List model versions with filter.")
|
374
|
-
def list_model_versions(
|
383
|
+
def list_model_versions(model_name: str, **kwargs: Any) -> None:
|
375
384
|
"""List model versions with filter in the Model Control Plane.
|
376
385
|
|
377
386
|
Args:
|
378
|
-
|
387
|
+
model_name: The name of the parent model.
|
379
388
|
**kwargs: Keyword arguments to filter models.
|
380
389
|
"""
|
381
|
-
model_id = Client().get_model(model_name_or_id=model_name_or_id).id
|
382
390
|
model_versions = Client().zen_store.list_model_versions(
|
383
|
-
model_name_or_id=
|
391
|
+
model_name_or_id=model_name,
|
384
392
|
model_version_filter_model=ModelVersionFilter(**kwargs),
|
385
393
|
)
|
386
394
|
|
zenml/cli/server.py
CHANGED
@@ -185,7 +185,16 @@ def up(
|
|
185
185
|
from zenml.zen_server.deploy.deployment import ServerDeploymentConfig
|
186
186
|
|
187
187
|
server_config = ServerDeploymentConfig(**config_attrs)
|
188
|
+
if blocking:
|
189
|
+
from zenml.constants import (
|
190
|
+
DEFAULT_USERNAME,
|
191
|
+
)
|
188
192
|
|
193
|
+
cli_utils.declare(
|
194
|
+
"The local ZenML dashboard is about to deploy in a "
|
195
|
+
"blocking process. You can connect to it using the "
|
196
|
+
f"'{DEFAULT_USERNAME}' username and an empty password."
|
197
|
+
)
|
189
198
|
server = deployer.deploy_server(server_config)
|
190
199
|
|
191
200
|
assert gc.store is not None
|
zenml/cli/utils.py
CHANGED
@@ -58,8 +58,8 @@ from zenml.constants import (
|
|
58
58
|
from zenml.enums import GenericFilterOps, StackComponentType
|
59
59
|
from zenml.logger import get_logger
|
60
60
|
from zenml.model_registries.base_model_registry import (
|
61
|
-
ModelVersion,
|
62
61
|
RegisteredModel,
|
62
|
+
RegistryModelVersion,
|
63
63
|
)
|
64
64
|
from zenml.models import (
|
65
65
|
BaseFilter,
|
@@ -1182,7 +1182,7 @@ def pretty_print_registered_model_table(
|
|
1182
1182
|
|
1183
1183
|
|
1184
1184
|
def pretty_print_model_version_table(
|
1185
|
-
model_versions: List["
|
1185
|
+
model_versions: List["RegistryModelVersion"],
|
1186
1186
|
) -> None:
|
1187
1187
|
"""Given a list of model_versions, print all associated key-value pairs.
|
1188
1188
|
|
@@ -1206,7 +1206,7 @@ def pretty_print_model_version_table(
|
|
1206
1206
|
|
1207
1207
|
|
1208
1208
|
def pretty_print_model_version_details(
|
1209
|
-
model_version: "
|
1209
|
+
model_version: "RegistryModelVersion",
|
1210
1210
|
) -> None:
|
1211
1211
|
"""Given a model_version, print all associated key-value pairs.
|
1212
1212
|
|
zenml/client.py
CHANGED
@@ -2713,6 +2713,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2713
2713
|
name: Optional[str] = None,
|
2714
2714
|
has_custom_name: Optional[bool] = None,
|
2715
2715
|
hydrate: bool = False,
|
2716
|
+
tag: Optional[str] = None,
|
2716
2717
|
) -> Page[ArtifactResponse]:
|
2717
2718
|
"""Get a list of artifacts.
|
2718
2719
|
|
@@ -2728,6 +2729,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2728
2729
|
has_custom_name: Filter artifacts with/without custom names.
|
2729
2730
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2730
2731
|
by including metadata fields in the response.
|
2732
|
+
tag: Filter artifacts by tag.
|
2731
2733
|
|
2732
2734
|
Returns:
|
2733
2735
|
A list of artifacts.
|
@@ -2742,6 +2744,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2742
2744
|
updated=updated,
|
2743
2745
|
name=name,
|
2744
2746
|
has_custom_name=has_custom_name,
|
2747
|
+
tag=tag,
|
2745
2748
|
)
|
2746
2749
|
return self.zen_store.list_artifacts(
|
2747
2750
|
artifact_filter_model,
|
@@ -2865,6 +2868,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2865
2868
|
only_unused: Optional[bool] = False,
|
2866
2869
|
has_custom_name: Optional[bool] = None,
|
2867
2870
|
hydrate: bool = False,
|
2871
|
+
tag: Optional[str] = None,
|
2868
2872
|
) -> Page[ArtifactVersionResponse]:
|
2869
2873
|
"""Get a list of artifact versions.
|
2870
2874
|
|
@@ -2892,6 +2896,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2892
2896
|
has_custom_name: Filter artifacts with/without custom names.
|
2893
2897
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
2894
2898
|
by including metadata fields in the response.
|
2899
|
+
tag: A tag to filter by.
|
2895
2900
|
|
2896
2901
|
Returns:
|
2897
2902
|
A list of artifact versions.
|
@@ -2917,6 +2922,7 @@ class Client(metaclass=ClientMetaClass):
|
|
2917
2922
|
user_id=user_id,
|
2918
2923
|
only_unused=only_unused,
|
2919
2924
|
has_custom_name=has_custom_name,
|
2925
|
+
tag=tag,
|
2920
2926
|
)
|
2921
2927
|
artifact_version_filter_model.set_scope_workspace(
|
2922
2928
|
self.active_workspace.id
|
@@ -4788,6 +4794,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4788
4794
|
updated: Optional[Union[datetime, str]] = None,
|
4789
4795
|
name: Optional[str] = None,
|
4790
4796
|
hydrate: bool = False,
|
4797
|
+
tag: Optional[str] = None,
|
4791
4798
|
) -> Page[ModelResponse]:
|
4792
4799
|
"""Get models by filter from Model Control Plane.
|
4793
4800
|
|
@@ -4801,6 +4808,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4801
4808
|
name: The name of the model to filter by.
|
4802
4809
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
4803
4810
|
by including metadata fields in the response.
|
4811
|
+
tag: The tag of the model to filter by.
|
4804
4812
|
|
4805
4813
|
Returns:
|
4806
4814
|
A page object with all models.
|
@@ -4813,11 +4821,11 @@ class Client(metaclass=ClientMetaClass):
|
|
4813
4821
|
logical_operator=logical_operator,
|
4814
4822
|
created=created,
|
4815
4823
|
updated=updated,
|
4824
|
+
tag=tag,
|
4816
4825
|
)
|
4817
4826
|
|
4818
4827
|
return self.zen_store.list_models(
|
4819
|
-
model_filter_model=filter,
|
4820
|
-
hydrate=hydrate,
|
4828
|
+
model_filter_model=filter, hydrate=hydrate
|
4821
4829
|
)
|
4822
4830
|
|
4823
4831
|
#################
|
@@ -4976,6 +4984,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4976
4984
|
number: Optional[int] = None,
|
4977
4985
|
stage: Optional[Union[str, ModelStages]] = None,
|
4978
4986
|
hydrate: bool = False,
|
4987
|
+
tag: Optional[str] = None,
|
4979
4988
|
) -> Page[ModelVersionResponse]:
|
4980
4989
|
"""Get model versions by filter from Model Control Plane.
|
4981
4990
|
|
@@ -4993,6 +5002,7 @@ class Client(metaclass=ClientMetaClass):
|
|
4993
5002
|
stage: stage of the model version.
|
4994
5003
|
hydrate: Flag deciding whether to hydrate the output model(s)
|
4995
5004
|
by including metadata fields in the response.
|
5005
|
+
tag: The tag to filter by.
|
4996
5006
|
|
4997
5007
|
Returns:
|
4998
5008
|
A page object with all model versions.
|
@@ -5007,6 +5017,7 @@ class Client(metaclass=ClientMetaClass):
|
|
5007
5017
|
name=name,
|
5008
5018
|
number=number,
|
5009
5019
|
stage=stage,
|
5020
|
+
tag=tag,
|
5010
5021
|
)
|
5011
5022
|
|
5012
5023
|
return self.zen_store.list_model_versions(
|
zenml/config/compiler.py
CHANGED
@@ -19,7 +19,7 @@ from pydantic import validator
|
|
19
19
|
from zenml.config.constants import DOCKER_SETTINGS_KEY
|
20
20
|
from zenml.config.source import Source, convert_source_validator
|
21
21
|
from zenml.config.strict_base_model import StrictBaseModel
|
22
|
-
from zenml.model.
|
22
|
+
from zenml.model.model import Model
|
23
23
|
|
24
24
|
if TYPE_CHECKING:
|
25
25
|
from zenml.config import DockerSettings
|
@@ -40,7 +40,7 @@ class PipelineConfigurationUpdate(StrictBaseModel):
|
|
40
40
|
extra: Dict[str, Any] = {}
|
41
41
|
failure_hook_source: Optional[Source] = None
|
42
42
|
success_hook_source: Optional[Source] = None
|
43
|
-
|
43
|
+
model: Optional[Model] = None
|
44
44
|
parameters: Optional[Dict[str, Any]] = None
|
45
45
|
|
46
46
|
_convert_source = convert_source_validator(
|
@@ -19,7 +19,7 @@ from zenml.config.base_settings import BaseSettings
|
|
19
19
|
from zenml.config.schedule import Schedule
|
20
20
|
from zenml.config.step_configurations import StepConfigurationUpdate
|
21
21
|
from zenml.config.strict_base_model import StrictBaseModel
|
22
|
-
from zenml.model.
|
22
|
+
from zenml.model.model import Model
|
23
23
|
from zenml.models import PipelineBuildBase
|
24
24
|
from zenml.utils import pydantic_utils
|
25
25
|
|
@@ -39,5 +39,5 @@ class PipelineRunConfiguration(
|
|
39
39
|
steps: Dict[str, StepConfigurationUpdate] = {}
|
40
40
|
settings: Dict[str, BaseSettings] = {}
|
41
41
|
extra: Dict[str, Any] = {}
|
42
|
-
|
42
|
+
model: Optional[Model] = None
|
43
43
|
parameters: Optional[Dict[str, Any]] = None
|
@@ -35,7 +35,7 @@ from zenml.config.source import Source, convert_source_validator
|
|
35
35
|
from zenml.config.strict_base_model import StrictBaseModel
|
36
36
|
from zenml.logger import get_logger
|
37
37
|
from zenml.model.lazy_load import ModelVersionDataLazyLoader
|
38
|
-
from zenml.model.
|
38
|
+
from zenml.model.model import Model
|
39
39
|
from zenml.utils import deprecation_utils
|
40
40
|
|
41
41
|
if TYPE_CHECKING:
|
@@ -135,7 +135,7 @@ class StepConfigurationUpdate(StrictBaseModel):
|
|
135
135
|
extra: Dict[str, Any] = {}
|
136
136
|
failure_hook_source: Optional[Source] = None
|
137
137
|
success_hook_source: Optional[Source] = None
|
138
|
-
|
138
|
+
model: Optional[Model] = None
|
139
139
|
|
140
140
|
outputs: Mapping[str, PartialArtifactConfiguration] = {}
|
141
141
|
|
zenml/integrations/__init__.py
CHANGED
@@ -40,7 +40,9 @@ from zenml.integrations.kserve import KServeIntegration # noqa
|
|
40
40
|
from zenml.integrations.kubeflow import KubeflowIntegration # noqa
|
41
41
|
from zenml.integrations.kubernetes import KubernetesIntegration # noqa
|
42
42
|
from zenml.integrations.label_studio import LabelStudioIntegration # noqa
|
43
|
+
from zenml.integrations.langchain import LangchainIntegration # noqa
|
43
44
|
from zenml.integrations.lightgbm import LightGBMIntegration # noqa
|
45
|
+
# from zenml.integrations.llama_index import LlamaIndexIntegration # noqa
|
44
46
|
from zenml.integrations.mlflow import MlflowIntegration # noqa
|
45
47
|
from zenml.integrations.neptune import NeptuneIntegration # noqa
|
46
48
|
from zenml.integrations.neural_prophet import NeuralProphetIntegration # noqa
|
@@ -67,7 +69,3 @@ from zenml.integrations.tensorflow import TensorflowIntegration # noqa
|
|
67
69
|
from zenml.integrations.wandb import WandbIntegration # noqa
|
68
70
|
from zenml.integrations.whylogs import WhylogsIntegration # noqa
|
69
71
|
from zenml.integrations.xgboost import XgboostIntegration # noqa
|
70
|
-
|
71
|
-
if sys.version_info > (3, 7):
|
72
|
-
# from zenml.integrations.llama_index import LlamaIndexIntegration # noqa
|
73
|
-
from zenml.integrations.langchain import LangchainIntegration # noqa
|