Skip to content

Commit 494d62e

Browse files
committed
Slight fixes to sagemaker inference sample
1 parent 03b3a4a commit 494d62e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sagemaker-inference/ReadMe.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ This is a small example about how you can use LocalStack to host your PyTorch ML
55
Before using this example you should setup your Docker Client to pull the AWS Deep Learning images ([more info here](https://github.com/aws/deep-learning-containers/blob/master/available_images.md)):
66

77
```bash
8-
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 763104351884.dkr.ecr.us-east-1.amazonaws.com
8+
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 763104351884.dkr.ecr.us-east-1.amazonaws.com
99
```
10+
11+
Because the images tend to be really big (multiple GB), you might want to `docker pull` them beforehand to avoid any timeouts.

sagemaker-inference/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
CONTAINER_IMAGE = "763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference:1.5.0-cpu-py3"
2121
EXECUTION_ROLE_ARN = "arn:aws:iam::0000000000000:role/sagemaker-role"
2222

23-
sagemaker: SageMakerClient = boto3.client("sagemaker", endpoint_url=LOCALSTACK_ENDPOINT)
24-
sagemaker_runtime: SageMakerRuntimeClient = boto3.client("sagemaker-runtime", endpoint_url=LOCALSTACK_ENDPOINT)
25-
s3: S3Client = boto3.client("s3", endpoint_url=LOCALSTACK_ENDPOINT)
23+
sagemaker: SageMakerClient = boto3.client("sagemaker", endpoint_url=LOCALSTACK_ENDPOINT, region_name="us-east-1")
24+
sagemaker_runtime: SageMakerRuntimeClient = boto3.client("sagemaker-runtime", endpoint_url=LOCALSTACK_ENDPOINT,
25+
region_name="us-east-1")
26+
s3: S3Client = boto3.client("s3", endpoint_url=LOCALSTACK_ENDPOINT, region_name="us-east-1")
2627

2728

2829
def deploy_model(run_id: str = "0"):

0 commit comments

Comments
 (0)