Fast Pre-trained Model Deployment - The code only approach
Deploying pre-trained and foundation models quickly, and programmatically, using Amazon SageMaker JumpStart, and the SageMaker SDK.
pip
you can install the latest SageMaker SDK as follows:list_jumpstart_models()
JumpStart notebook utility allows us to get a list of all the current JumpStart models. Let's get them all and count them!pytorch
models for image classification (ic
).all_models
(created above using list_jumpstart_models()
), and parse it.model
, if you have a look, they include models from Stability AI and include their famous Stable Diffusion text to image models.image_uri
is the location in the Amazon Elastic Container Registry for a container image that is compatible with the model we select.source_uri
is the location in S3 of pre-written code to perform inference or training (when supported) as per the scope we selected. Feel free to download this code, take a look, and even make some changes. If you do change the code you will need to re-compress (tar.gz) and make it available in an S3 bucket you control.model_uri
is the location in S3 of the model itself.deploy
on the model object. We pass in the number of instances we want. This step will take a few minutes while the infrastructure is deployed.model_predictor
, navigate to Amazon SageMaker in the console, click Inference
from the left hand menu, and use Models
and Endpoints
to delete the resources.transformer
, navigate to Amazon SageMaker in the console, click Inference
from the left hand menu and use Models
to delete the resource.Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.