Skip to content

Commit

Permalink
Merge pull request #15 from jina-ai/fix-model-deploy
Browse files Browse the repository at this point in the history
fix: remove params that cause issue
  • Loading branch information
deepankarm committed Jan 5, 2024
2 parents 2ff59a8 + b5ca924 commit 77714f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jina_sagemaker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,24 @@ def create_endpoint(
f"Endpoint {endpoint_name} already exists and recreate={recreate}."
)

# Check if there is already endpoint config, if so delete it or it will block model.deploy
try:
self._sm_client.delete_endpoint_config(EndpointConfigName=endpoint_name)
except ClientError:
pass

model = sagemaker.ModelPackage(
role=role,
model_data=None,
sagemaker_session=self._sm_session, # makes sure the right region is used
model_package_arn=arn,
)

validation_params = dict(
model_data_download_timeout=2400,
container_startup_health_check_timeout=2400,
)

try:
model.deploy(
n_instances,
instance_type,
endpoint_name=endpoint_name,
**validation_params,
)
except ParamValidationError:
model.deploy(n_instances, instance_type, endpoint_name=endpoint_name)
Expand Down

0 comments on commit 77714f8

Please sign in to comment.