Skip to content

Commit 3d32326

Browse files
author
Wang Napieralski
committed
allow to not provide inference script with HuggingFace model deployment
1 parent 13a3e4d commit 3d32326

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/sagemaker/huggingface/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
self,
9393
model_data,
9494
role,
95-
entry_point,
95+
entry_point=None,
9696
transformers_version=None,
9797
tensorflow_version=None,
9898
pytorch_version=None,
@@ -116,6 +116,7 @@ def __init__(
116116
file which should be executed as the entry point to model
117117
hosting. If ``source_dir`` is specified, then ``entry_point``
118118
must point to a file located at the root of ``source_dir``.
119+
Defaults to None.
119120
transformers_version (str): transformers version you want to use for
120121
executing your model training code. Defaults to None. Required
121122
unless ``image_uri`` is provided.

src/sagemaker/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ def prepare_container_def(self, instance_type=None, accelerator_type=None):
11111111
def _upload_code(self, key_prefix, repack=False):
11121112
"""Placeholder Docstring"""
11131113
local_code = utils.get_config_value("local.local_code", self.sagemaker_session.config)
1114-
if self.sagemaker_session.local_mode and local_code:
1114+
if (self.sagemaker_session.local_mode and local_code) or self.entry_point is None:
11151115
self.uploaded_code = None
11161116
elif not repack:
11171117
bucket = self.bucket or self.sagemaker_session.default_bucket()

0 commit comments

Comments
 (0)