-
I am following the tutorial at [1] to load the model at [2] for serving into amazon sage maker.
-
my source code is as follows:
# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
transformers_version='4.26.0',
pytorch_version='1.13.1',
py_version='py39',
model_data="s3://talaobucketone/model.tar.gz", # path to your trained SageMaker model
# model_data="https://talaobucketone.s3.us-west-2.amazonaws.com/model.tar.gz",
role=role,
)
# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
initial_instance_count=1, # number of instances
instance_type='ml.m5.xlarge' # ec2 instance type
)
- execution is failing for
ClientError: An error occurred (ValidationException) when calling the CreateModel operation: Could not access model data at s3://talaobucketone/model.tar.gz. Please ensure that the role "arn:aws:iam::637423572524:role/service-role/AmazonSageMakerServiceCatalogProductsUseRole" exists and that its trust relationship policy allows the action "sts:AssumeRole" for the service principal "sagemaker.amazonaws.com". Also ensure that the role has "s3:GetObject" permissions and that the object is located in us-east-2. If your Model uses multiple models or uncompressed models, please ensure that the role has "s3:ListBucket" permission.
which makes sense, given the model.tar.gz is only available in us-west-2.
Question: where do i setup the model to look for the data on us-west-2 instead of us-east-1?
[1]Deploy models to Amazon SageMaker
[2]naver-clova-ix/donut-base-finetuned-cord-v2 at official