Manage model cards - Amazon SageMaker

Manage model cards

After you've created a model card, you can manage them. Managing model cards include the following actions:

  • Editing a model card

  • Deleting a model card

  • Exporting a model card to a PDF

You can manage using either the Amazon SageMaker console or the SageMaker Python SDK.

Manage model cards using the console

Use the information in the following sections to manage your model cards with the Amazon SageMaker console.

Edit a model card

To edit a model card, navigate to the model card of your choice by selecting its name in the Amazon SageMaker Model Card console and choose Edit.

After you save a model card, you cannot edit the name of that model card. After you save a model card version, you cannot update that version of the model card. Any edits that you need to make are saved as a subsequent version in order to have an immutable record of model changes.

To view different versions of the model card, choose Actions, Select version, and then choose the version that you want to view.

Export a model card

Follow these steps to export a model card.

  1. Go to the Amazon SageMaker Model Card console.

  2. Choose the name of the model card you want to export.

  3. In the model card overview, choose Actions and then Export PDF.

  4. Enter an S3 URI or browse available S3 buckets for your model card PDF.

  5. If your model card exports successfully, you can either choose Download PDF in the resulting banner or download your PDF directly from Amazon S3.

Delete a model card

Follow these steps to permanently delete one or more model cards.

  1. Go to the Amazon SageMaker Model Cards console.

  2. Check the box to the left of the name of the card(s) you want to delete.

  3. Choose Delete in the upper right-hand corner.

  4. Confirm your request to permanently delete one or more cards..

You can also delete a model card when viewing the model card overview in the console by choosing Actions and then Delete model card.

Manage model cards using the SageMaker Python SDK

Use the information in the following sections to manage your model cards with the Amazon SageMaker Python SDK.

Use model cards through the SageMaker Python SDK

You can create an Amazon SageMaker Model Card programmatically through the SageMaker Python SDK. For more information see Amazon SageMaker Model Cards in the SageMaker Python SDK API reference.

Edit a model card

You can edit a model card using the model_card.update() method. Updating a model card creates a new model card version in order to have an immutable record of model changes. You cannot update the name of a model card.

my_card.model_overview.model_description = "updated-model-decription" my_card.update()

Export a model card

Specify an S3 output path and export your model card PDF to it with the following commands:

s3_output_path = f"s3://{bucket}/{prefix}/export" pdf_s3_url = my_card.export_pdf(s3_output_path=s3_output_path).delete()

Delete a model card

Permanently delete a model card with the following command:

my_card.delete()

Sample notebooks

For more information on working with model cards through the SageMaker Python SDK, see the Amazon SageMaker Model Governance - Model Card example notebook.