Skip to content

Commit 24e7872

Browse files
author
Judy Heflin
committed
Fixed JS Model docstring formatting
1 parent 5331b8a commit 24e7872

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

doc/api/inference/model.rst

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Model
77
:show-inheritance:
88
:inherited-members:
99

10+
.. autoclass:: sagemaker.jumpstart.model.JumpStartModel
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
:inherited-members:
15+
1016
.. autoclass:: sagemaker.model.FrameworkModel
1117
:members:
1218
:undoc-members:

doc/overview.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ You can then run inference with the deployed model using the ``predict`` method.
749749
response = predictor.predict(question)
750750
print(response)
751751
752-
You can optionally include specific model versions or instance types. For more information about the JumpStartModel class and its parameters, see JumpStartModel.
752+
You can optionally include specific model versions or instance types. For more information about the ``JumpStartModel`` class and its parameters,
753+
see `JumpStartModel <https://sagemaker.readthedocs.io/en/stable/api/inference/model.html#sagemaker.jumpstart.model.JumpStartModel>`__.
753754

754755
Deploy a Pre-Trained Model Directly to a SageMaker Endpoint
755756
============================================================

src/sagemaker/jumpstart/model.py

+15-22
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def __init__(
138138
when training on Amazon SageMaker. If 'git_config' is provided,
139139
'source_dir' should be a relative location to a directory in the Git repo.
140140
If the directory points to S3, no code is uploaded and the S3 location
141-
is used instead.
141+
is used instead. (Default: None).
142142
143143
.. admonition:: Example
144144
@@ -150,7 +150,6 @@ def __init__(
150150
>>> |----- test.py
151151
152152
You can assign entry_point='inference.py', source_dir='src'.
153-
(Default: None).
154153
code_location (Optional[str]): Name of the S3 bucket where custom code is
155154
uploaded (Default: None). If not specified, the default bucket
156155
created by ``sagemaker.session.Session`` is used. (Default: None).
@@ -159,9 +158,9 @@ def __init__(
159158
model hosting. (Default: None). If ``source_dir`` is specified, then ``entry_point``
160159
must point to a file located at the root of ``source_dir``.
161160
If 'git_config' is provided, 'entry_point' should be
162-
a relative location to the Python source file in the Git repo.
161+
a relative location to the Python source file in the Git repo. (Default: None).
163162
164-
Example:
163+
.. admonition:: Example
165164
With the following GitHub repo directory structure:
166165
167166
>>> |----- README.md
@@ -170,8 +169,6 @@ def __init__(
170169
>>> |----- test.py
171170
172171
You can assign entry_point='src/inference.py'.
173-
174-
(Default: None).
175172
container_log_level (Optional[Union[int, PipelineVariable]]): Log level to use
176173
within the container. Valid values are defined in the Python
177174
logging module. (Default: None).
@@ -183,7 +180,8 @@ def __init__(
183180
list of relative locations to directories with any additional
184181
libraries needed in the Git repo. If the ```source_dir``` points
185182
to S3, code will be uploaded and the S3 location will be used
186-
instead.
183+
instead. This is not supported with "local code" in Local Mode.
184+
(Default: None).
187185
188186
.. admonition:: Example
189187
@@ -200,9 +198,6 @@ def __init__(
200198
>>> |------ inference.py
201199
>>> |------ common
202200
>>> |------ virtual-env
203-
204-
This is not supported with "local code" in Local Mode.
205-
(Default: None).
206201
git_config (Optional[dict[str, str]]): Git configurations used for cloning
207202
files, including ``repo``, ``branch``, ``commit``,
208203
``2FA_enabled``, ``username``, ``password`` and ``token``. The
@@ -212,18 +207,6 @@ def __init__(
212207
'master' is used. If you don't provide ``commit``, the latest
213208
commit in the specified branch is used.
214209
215-
.. admonition:: Example
216-
217-
The following config:
218-
219-
>>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
220-
>>> 'branch': 'test-branch-git-config',
221-
>>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
222-
223-
results in cloning the repo specified in 'repo', then
224-
checking out the 'master' branch, and checking out the specified
225-
commit.
226-
227210
``2FA_enabled``, ``username``, ``password`` and ``token`` are
228211
used for authentication. For GitHub (or other Git) accounts, set
229212
``2FA_enabled`` to 'True' if two-factor authentication is
@@ -255,6 +238,16 @@ def __init__(
255238
credential helper or local credential storage for authentication.
256239
(Default: None).
257240
241+
.. admonition:: Example
242+
243+
The following config results in cloning the repo specified in 'repo', then
244+
checking out the 'master' branch, and checking out the specified
245+
commit.
246+
247+
>>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
248+
>>> 'branch': 'test-branch-git-config',
249+
>>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
250+
258251
Raises:
259252
ValueError: If the model ID is not recognized by JumpStart.
260253
"""

0 commit comments

Comments
 (0)