Skip to content

Commit e92bd12

Browse files
authored
Merge branch 'master' into pipeline-model-network-isolation
2 parents 86b0c1c + 67ef671 commit e92bd12

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

src/sagemaker/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ def __init__(
791791
authentication if they are provided; otherwise, python SDK will
792792
try to use either CodeCommit credential helper or local
793793
credential storage for authentication.
794-
**kwargs: Keyword arguments passed to the ``Model`` initializer.
794+
**kwargs: Keyword arguments passed to the superclass
795+
:class:`~sagemaker.model.Model`.
795796
796797
.. tip::
797798

src/sagemaker/mxnet/model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ def __init__(
107107
model_server_workers (int): Optional. The number of worker processes
108108
used by the inference server. If None, server will use one
109109
worker per vCPU.
110-
**kwargs: Keyword arguments passed to the ``FrameworkModel``
111-
initializer.
110+
**kwargs: Keyword arguments passed to the superclass
111+
:class:`~sagemaker.model.FrameworkModel` and, subsequently, its
112+
superclass :class:`~sagemaker.model.Model`.
112113
113114
.. tip::
114115

src/sagemaker/processing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import pathlib
2222

2323
from six.moves.urllib.parse import urlparse
24+
from six.moves.urllib.request import url2pathname
2425

2526
from sagemaker import s3
2627
from sagemaker.job import _Job
@@ -535,21 +536,22 @@ def _handle_user_code_url(self, code):
535536
user_code_s3_uri = code
536537
elif code_url.scheme == "" or code_url.scheme == "file":
537538
# Validate that the file exists locally and is not a directory.
538-
if not os.path.exists(code):
539+
code_path = url2pathname(code_url.path)
540+
if not os.path.exists(code_path):
539541
raise ValueError(
540542
"""code {} wasn't found. Please make sure that the file exists.
541543
""".format(
542544
code
543545
)
544546
)
545-
if not os.path.isfile(code):
547+
if not os.path.isfile(code_path):
546548
raise ValueError(
547549
"""code {} must be a file, not a directory. Please pass a path to a file.
548550
""".format(
549551
code
550552
)
551553
)
552-
user_code_s3_uri = self._upload_code(code)
554+
user_code_s3_uri = self._upload_code(code_path)
553555
else:
554556
raise ValueError(
555557
"code {} url scheme {} is not recognized. Please pass a file path or S3 url".format(

src/sagemaker/pytorch/model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(
7575
model_server_workers=None,
7676
**kwargs
7777
):
78-
"""Initialize an PyTorchModel.
78+
"""Initialize a PyTorchModel.
7979
8080
Args:
8181
model_data (str): The S3 location of a SageMaker model data
@@ -106,8 +106,9 @@ def __init__(
106106
model_server_workers (int): Optional. The number of worker processes
107107
used by the inference server. If None, server will use one
108108
worker per vCPU.
109-
**kwargs: Keyword arguments passed to the ``FrameworkModel``
110-
initializer.
109+
**kwargs: Keyword arguments passed to the superclass
110+
:class:`~sagemaker.model.FrameworkModel` and, subsequently, its
111+
superclass :class:`~sagemaker.model.Model`.
111112
112113
.. tip::
113114

src/sagemaker/tensorflow/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ def __init__(
175175
to call to create a predictor with an endpoint name and
176176
SageMaker ``Session``. If specified, ``deploy()`` returns the
177177
result of invoking this function on the created endpoint name.
178-
**kwargs: Keyword arguments passed to the ``Model`` initializer.
178+
**kwargs: Keyword arguments passed to the superclass
179+
:class:`~sagemaker.model.FrameworkModel` and, subsequently, its
180+
superclass :class:`~sagemaker.model.Model`.
179181
180182
.. tip::
181183

src/sagemaker/xgboost/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def __init__(
9090
created endpoint name.
9191
model_server_workers (int): Optional. The number of worker processes used by the
9292
inference server. If None, server will use one worker per vCPU.
93-
**kwargs: Keyword arguments passed to the ``FrameworkModel`` initializer.
93+
**kwargs: Keyword arguments passed to the superclass
94+
:class:`~sagemaker.model.FrameworkModel` and, subsequently, its
95+
superclass :class:`~sagemaker.model.Model`.
9496
9597
.. tip::
9698

0 commit comments

Comments
 (0)