Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(components): support aliases arg in ModelUploadOp #10404

Merged
merged 1 commit into from Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions components/google-cloud/RELEASE.md
Expand Up @@ -4,6 +4,7 @@
* Upload the tuned adapter to Model Registry instead of model checkpoint from `preview.llm.rlhf_pipeline`.
* Add Vertex model get component (`v1.model.ModelGetOp`).
* Migrate to Protobuf 4 (`protobuf>=4.21.1,<5`). Require `kfp>=2.6.0`.
* Support setting version aliases in (`v1.model.ModelUploadOp`).

## Release 2.8.0
* Release AutoSxS pipeline to preview.
Expand Down
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict
from typing import Dict, List

from google_cloud_pipeline_components import _image
from google_cloud_pipeline_components import _placeholders
Expand All @@ -39,6 +39,7 @@ def model_upload(
unmanaged_container_model: Input[UnmanagedContainerModel] = None,
explanation_metadata: Dict[str, str] = {},
explanation_parameters: Dict[str, str] = {},
version_aliases: List[str] = [],
labels: Dict[str, str] = {},
encryption_spec_key_name: str = '',
project: str = _placeholders.PROJECT_ID_PLACEHOLDER,
Expand All @@ -60,6 +61,7 @@ def model_upload(

explanation_metadata: Metadata describing the Model's input and output for explanation. Both `explanation_metadata` and `explanation_parameters` must be passed together when used. [More information.](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/ExplanationSpec#explanationmetadata)
explanation_parameters: Parameters to configure explaining for Model's predictions. [More information.](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/ExplanationSpec#ExplanationParameters)
version_aliases: User provided version aliases so that a model version can be referenced via alias (i.e. `projects/{project}/locations/{location}/models/{modelId}@{version_alias}` instead of auto-generated version id (i.e. `projects/{project}/locations/{location}/models/{modelId}@{versionId}`). The format is [a-z][a-zA-Z0-9-]{0,126}[a-z0-9] to distinguish from versionId. A default version alias will be created for the first version of the model, and there must be exactly one default version alias for a model.
encryption_spec_key_name: Customer-managed encryption key spec for a Model. If set, this Model and all sub-resources of this Model will be secured by this key. Has the form: `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.
labels: The labels with user-defined metadata to organize your model. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
project: Project to upload this Model to. Defaults to the project in which the PipelineJob is run.
Expand Down Expand Up @@ -98,6 +100,8 @@ def model_upload(
', "encryption_spec": {"kms_key_name":"',
encryption_spec_key_name,
'"}',
', "version_aliases": ',
version_aliases,
', "labels": ',
labels,
', "pipeline_job": "',
Expand Down