Should be easy, but....
I'm trying to create a simple inference pipeline (see Inference Pipeline Example. )
In my case I have two ^existing^ endpoints and I'm trying to 'get' the model from those endpoints for the pipeline creation.
sm_model = PipelineModel( name=model_name, role=role, models=[model_1, model_2] )
I do not have the Estimator object (so can't call create_model())... I'm looking at the docs/google.. and I can't see how to do the equivalent of 'get_model()' from an endpoint.
Here's my current 'long way around' path, this seems silly.. the endpoint obviously knows it's model(s) so having to do a this lengthy process must not be the right way...
- Get the model name from endpoint
sm_client.describe_endpoint_config(EndpointConfigName=<endpoint_config_name>)
...'ProductionVariants': [{'VariantName': 'AllTraffic', 'ModelName': <model_name_is_here>
- Get the model data url by using the model name
sm_client.describe_model(ModelName=<model_name>)
...PrimaryContainer': {'Image': '683313688378.dkr.ecr.us-east-1.amazonaws.com/sagemaker-scikit-learn:0.23-1-cpu-py3',
'Mode': 'SingleModel',
'ModelDataUrl': <here... blah/blah/model.tar.gz>
- Get the image from the endpoint
sm_client.describe_endpoint(EndpointName=<endpoint name>)
'ProductionVariants': [{'VariantName': 'AllTraffic', 'DeployedImages': <image_is_here>
- Create a new model
model = Model(model_data=model_data, image_uri=endpoint_iimage, role=role)
And ^finally^ do that twice (for each endpoint) and use those models as my arguments to PipelineModel
PipelineModel(name=model_name, role=role, models=[model_1, model_2])