Last active
April 16, 2020 11:03
-
-
Save ResidentMario/9de138a804e521fae8ec0aa06ea0c4e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sagemaker as sage | |
# get and pass the auth role and image path, same as before | |
# this step is unchanged from the training script | |
role = sage.get_execution_role() | |
sess = sage.Session() | |
account = sess.boto_session.client('sts').get_caller_identity()['Account'] | |
region = sess.boto_session.region_name | |
image = '{}.dkr.ecr.{}.amazonaws.com/quiltdata/sagemaker-demo'.format(account, region) | |
# create a new Model object | |
clf = Model( | |
# insert model path below | |
model_data='s3://quilt-example/quilt/quilt_sagemaker_demo/model/sagemaker-demo-[...]/output/model.tar.gz', | |
image=image, | |
role=role, | |
sagemaker_session=sess | |
) | |
# deploy it to an endpoint | |
predictor = clf.deploy(1, 'ml.c4.2xlarge') | |
# connect to the endpoint | |
predictor = sage.predictor.RealTimePredictor( | |
'sagemaker-demo-[...]', # insert model name here | |
sagemaker_session=sess, | |
content_type="text/csv" | |
) |
Hi, awesome tutorial! But where does the
Model
in line 12 come from?
sagemaker.model.Model
why you store clf.deploy(1, 'ml.c4.2xlarge')
in predictor
if later your overwrite predictor
with sage.predictor.RealTimePredictor(...
?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, awesome tutorial! But where does the
Model
in line 12 come from?