How to use the stepfunctions.steps.ModelStep function in stepfunctions

To help you get started, we’ve selected a few stepfunctions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-step-functions-data-science-sdk-python / src / stepfunctions / template / pipeline / inference.py View on Github external
training_step = TrainingStep(
            StepId.Train.value,
            estimator=self.estimator,
            job_name=default_name + '/estimator-source',
            data=self.inputs,
        )

        pipeline_model = PipelineModel(
            name='PipelineModel',
            role=self.estimator.role,
            models=[
                self.preprocessor.create_model(),
                self.estimator.create_model()
            ]
        )
        pipeline_model_step = ModelStep(
            StepId.CreatePipelineModel.value,
            instance_type=train_instance_type,
            model=preprocessor_model,
            model_name=default_name
        )
        pipeline_model_step.parameters = self.pipeline_model_config(train_instance_type, pipeline_model)

        deployable_model = Model(model_data='', image='')

        # Deployment
        endpoint_config_step = EndpointConfigStep(
            StepId.ConfigureEndpoint.value,
            endpoint_config_name=default_name,
            model_name=default_name,
            initial_instance_count=train_instance_count,
            instance_type=train_instance_type
github aws / aws-step-functions-data-science-sdk-python / src / stepfunctions / template / pipeline / inference.py View on Github external
:class:`~stepfunctions.steps.states.Chain`: Workflow definition as a chain of states involved in the the inference pipeline.
        """
        default_name = self.pipeline_name

        train_instance_type = self.preprocessor.train_instance_type
        train_instance_count = self.preprocessor.train_instance_count

        # Preprocessor for feature transformation
        preprocessor_train_step = TrainingStep(
            StepId.TrainPreprocessor.value,
            estimator=self.preprocessor,
            job_name=default_name + '/preprocessor-source',
            data=self.inputs,
        )
        preprocessor_model = self.preprocessor.create_model()
        preprocessor_model_step = ModelStep(
            StepId.CreatePreprocessorModel.value,
            instance_type=train_instance_type,
            model=preprocessor_model,
            model_name=default_name
        )
        preprocessor_transform_step = TransformStep(
            StepId.TransformInput.value,
            transformer=self.preprocessor.transformer(instance_count=train_instance_count, instance_type=train_instance_type, max_payload=20),
            job_name=default_name,
            model_name=default_name,
            data=self.inputs['train'],
            compression_type=self.compression_type,
            content_type=self.content_type
        )

        # Training