|View source on GitHub|
A TFX component to push validated TensorFlow models to a model serving platform.
Pusher component can be used to push an validated SavedModel from output
of the Trainer component to
TensorFlow Serving. The Pusher
will check the validation results from the ModelValidator
before deploying the model. If the model has not been blessed, then the model
will not be pushed.
Note: The executor for this component can be overriden to enable the model to be pushed to other serving platforms than tf.serving. The Cloud AI Platform custom executor provides an example how to implement this.
# Checks whether the model passed the validation steps and pushes the model # to a file destination if check passed. pusher = Pusher( model_export=trainer.outputs.output, model_blessing=model_validator.outputs.blessing, push_destination=pusher_pb2.PushDestination( filesystem=pusher_pb2.PushDestination.Filesystem( base_directory=serving_model_dir)))
__init__( model_export=None, model_blessing=None, push_destination=None, custom_config=None, custom_executor_spec=None, model_push=None, model=None, instance_name=None )
Construct a Pusher component.
model_export: A Channel of 'ModelExportPath' type, usually produced by Trainer component. Will be deprecated in the future for the
model_blessing: A Channel of 'ModelBlessingPath' type, usually produced by ModelValidator component. required
push_destination: A pusher_pb2.PushDestination instance, providing info for tensorflow serving to load models. Optional if executor_class doesn't require push_destination.
custom_config: A dict which contains the deployment job parameters to be passed to cloud-based training platforms. The Kubeflow example contains an example how this can be used by custom executors.
custom_executor_spec: Optional custom executor spec.
model_push: Optional output 'ModelPushPath' channel with result of push.
model: Forwards compatibility alias for the 'model_exports' argument.
instance_name: Optional unique instance name. Necessary if multiple Pusher components are declared in the same pipeline.
Component id, unique across all component instances in a pipeline.
If unique name is available, component_id will be: