Why am I getting an error when deploying a model from my S3 bucket to Sagemaker?

42 views Asked by At

I am getting an error while deploying the model from S3 bucket using Sagemaker Notebook. My model that is upload on S3 is "https://huggingface.co/openchat/openchat-3.5-0106".

The error:

ClientError: An error occurred (InternalFailure) when calling the CreateModel operation (reached max retries: 4):

Code:

import json
import sagemaker
import boto3
from sagemaker.huggingface import HuggingFaceModel
from botocore.config import Config

sm_boto = boto3.client('sagemaker', 
                       config=Config(connect_timeout=5, read_timeout=60, retries={'max_attempts': 20}))
sagemaker_session = sagemaker.Session(sagemaker_client=sm_boto)
role = sagemaker.get_execution_role(sagemaker_session=sagemaker_session)

>! model path is working fine and i have checked it.
model_path = "s3://arn:aws:s3:us-east-1:******:****/******"

huggingface_model = HuggingFaceModel(
    model_data = model_path,
    role=role,
    transformers_version="4.6", # transformers version used
    pytorch_version="1.7", # pytorch version used
    py_version='py36',
)

predictor = huggingface_model.deploy(
    initial_instance_count=1,
    instance_type="ml.m5.2xlarge",
)

I tried to extend the timeout and retries but it's still 4 retries. I want to identify the error in my code or in my environment.

0

There are 0 answers