Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit 21873ee

Browse files
codesuehanneshapke
andcommitted
Deprecate ModelCardGenerator component
Co-authored-by: Suzen Fylke <codesue@users.noreply.github.com> Co-authored-by: Hannes Hapke <hanneshapke@users.noreply.github.com>
1 parent 8e45afb commit 21873ee

24 files changed

+75
-2273
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ The Model Card Toolkit is hosted on [PyPI](https://pypi.org/project/model-card-t
3535

3636
## Model Card Generation on TFX
3737

38-
If you are using [TensorFlow Extended (TFX)](https://www.tensorflow.org/tfx), you can incorporate model card generation into your TFX pipeline via the [`ModelCardGenerator`](https://www.tensorflow.org/responsible_ai/model_card_toolkit/api_docs/python/model_card_toolkit/ModelCardGenerator) component. See our [guide](model_card_toolkit/documentation/guide/templates.md) for more details, [this case study](model_card_toolkit/documentation/examples/MLMD_Model_Card_Toolkit_Demo.ipynb) for a demonstration.
38+
If you are using [TensorFlow Extended (TFX)](https://www.tensorflow.org/tfx), you can
39+
incorporate model card generation into your TFX pipeline via the `ModelCardGenerator`
40+
component. The `ModelCardGenerator` component is moving to the
41+
[TFX Addons](https://github.com/tensorflow/tfx-addons) library and will not be
42+
included in Model Card Toolkit from version 1.4.0. This page will be updated to
43+
include the new links for the Model Cards in TFX
44+
guide and the end-to-end demo when that migration is completed.
3945

4046
## Schema
4147

model_card_toolkit/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
"""A module to streamline and automate generation of Model Cards."""
1515
from model_card_toolkit.core import ModelCardToolkit
1616
from model_card_toolkit.model_card import *
17-
from model_card_toolkit.tfx.component import ModelCardGenerator
1817
from model_card_toolkit.utils.source import *
1918
from model_card_toolkit.version import __version__

model_card_toolkit/core_test.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
from model_card_toolkit.utils import source as src
2727
from model_card_toolkit.utils.testdata import testdata_utils
2828
from model_card_toolkit.utils.testdata.tfxtest import TfxTest
29+
from model_card_toolkit.utils.tfx_util import _TFX_METRICS_TYPE
30+
from model_card_toolkit.utils.tfx_util import _TFX_STATS_TYPE
2931
import tensorflow_model_analysis as tfma
30-
from tfx.types import standard_artifacts
32+
33+
from ml_metadata.proto import metadata_store_pb2
3134

3235

3336
class CoreTest(parameterized.TestCase, TfxTest):
@@ -115,11 +118,11 @@ def test_scaffold_assets_with_source(self, output_file_format: str,
115118
self._write_tfdv(tfdv_path, train_dataset_name, train_features,
116119
eval_dataset_name, eval_features, mlmd_store)
117120
model_evaluation_artifacts = mlmd_store.get_artifacts_by_type(
118-
standard_artifacts.ModelEvaluation.TYPE_NAME)
121+
_TFX_METRICS_TYPE)
119122
example_statistics_artifacts = mlmd_store.get_artifacts_by_type(
120-
standard_artifacts.ExampleStatistics.TYPE_NAME)
121-
pushed_model_artifact = standard_artifacts.PushedModel()
122-
pushed_model_artifact.uri = pushed_model_path
123+
_TFX_STATS_TYPE)
124+
# Use placeholder artifact to avoid introducing tfx as a dependency
125+
pushed_model_artifact = metadata_store_pb2.Artifact(uri=pushed_model_path)
123126
tfma_src = src.TfmaSource(
124127
model_evaluation_artifacts=model_evaluation_artifacts,
125128
metrics_exclude=['average_loss'])

model_card_toolkit/documentation/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@ html = mct.export_format()
3333

3434
* [Standalone Model Card Toolkit](https://colab.sandbox.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/Standalone_Model_Card_Toolkit_Demo.ipynb)
3535
* [Scikit-Learn with Model Card Toolkit](https://colab.sandbox.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/Scikit_Learn_Model_Card_Toolkit_Demo.ipynb)
36-
* [MLMD with Model Card Toolkit](https://colab.sandbox.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/MLMD_Model_Card_Toolkit_Demo.ipynb)
3736

3837
If you want to try out the Model Card Toolkit (MCT) right away, you can run the
3938
[standalone Model Card Toolkit demo](https://colab.sandbox.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/Standalone_Model_Card_Toolkit_Demo.ipynb),
4039
or the
4140
[Scikit-Learn Model Card Toolkit demo](https://colab.sandbox.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/Scikit_Learn_Model_Card_Toolkit_Demo.ipynb),
42-
which demonstrates how MCT can be used in a Scikit-Learn workspace. If you are
43-
using [MLMD/TFX](https://www.tensorflow.org/tfx) and want to incorporate MCT
44-
into your workflow, you can try out the
45-
[MLMD Model Card Toolkit demo](https://colab.sandbox.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/MLMD_Model_Card_Toolkit_Demo.ipynb).
41+
which demonstrates how MCT can be used in a Scikit-Learn workspace.
4642

4743
These demos can be run directly from your browser. Click
4844
[here](https://github.com/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/README.md)

0 commit comments

Comments
 (0)