Skip to content

Commit 7156292

Browse files
committed
s/or/and
1 parent 82adb10 commit 7156292

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

doc/frameworks/tensorflow/upgrade_from_legacy.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Upgrade from Legacy TensorFlow Support
33
######################################
44

5-
With version 2.0 or later of the SageMaker Python SDK, support for legacy SageMaker TensorFlow images has been deprecated.
5+
With version 2.0 and later of the SageMaker Python SDK, support for legacy SageMaker TensorFlow images has been deprecated.
66
This guide explains how to upgrade your SageMaker Python SDK usage.
77

88
For more information about using TensorFlow with the SageMaker Python SDK, see `Use TensorFlow with the SageMaker Python SDK <using_tf.html>`_.
@@ -67,13 +67,13 @@ For more information about implementing your own handlers, see `How to implement
6767
Continue with Legacy Versions
6868
*****************************
6969

70-
While not recommended, you can still use a legacy TensorFlow version with version 2.0 or later of the SageMaker Python SDK.
70+
While not recommended, you can still use a legacy TensorFlow version with version 2.0 and later of the SageMaker Python SDK.
7171
In order to do so, you need to change how a few parameters are defined.
7272

7373
Training
7474
========
7575

76-
When creating an estimator, the Python SDK version 2.0 or later requires the following changes:
76+
When creating an estimator, the Python SDK version 2.0 and later requires the following changes:
7777

7878
#. Explicitly specify the ECR image URI via ``image_name``.
7979
To determine the URI, you can use :func:`sagemaker.fw_utils.create_image_uri`.
@@ -99,7 +99,7 @@ the difference in code would be as follows:
9999
requirements_file="requirements.txt",
100100
)
101101
102-
# v2.0 or later
102+
# v2.0 and later
103103
estimator = TensorFlow(
104104
...
105105
source_dir="code",
@@ -123,7 +123,7 @@ To provide a requirements file, define a hyperparameter named "sagemaker_require
123123
Inference
124124
=========
125125

126-
Using a legacy TensorFlow version for endpoints and batch transform can be achieved with version 2.0 or later of the SageMaker Python SDK with some minor changes to your code.
126+
Using a legacy TensorFlow version for endpoints and batch transform can be achieved with version 2.0 and later of the SageMaker Python SDK with some minor changes to your code.
127127

128128
From an Estimator
129129
-----------------
@@ -137,13 +137,13 @@ To specify the number of model server workers, you need to set it through an env
137137
# v1.x
138138
estimator.deploy(..., model_server_workers=4)
139139
140-
# v2.0 or later
140+
# v2.0 and later
141141
estimator.deploy(..., env={"MODEL_SERVER_WORKERS": 4})
142142
143143
From a Trained Model
144144
--------------------
145145

146-
If you are starting with a trained model, the Python SDK version 2.0 or later requires the following changes:
146+
If you are starting with a trained model, the Python SDK version 2.0 and later requires the following changes:
147147

148148
#. Use the the :class:`sagemaker.model.FrameworkModel` class.
149149
#. Explicitly specify the ECR image URI via ``image``.
@@ -165,7 +165,7 @@ the difference in code would be as follows:
165165
model_server_workers=4,
166166
)
167167
168-
# v2.0 or later
168+
# v2.0 and later
169169
from sagemaker.model import FrameworkModel
170170
171171
model = FrameworkModel(

src/sagemaker/cli/compatibility/v2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
"""Tools to assist with upgrading to version 2.0 or later of the SageMaker Python SDK."""
13+
"""Tools to assist with upgrading to version 2.0 and later of the SageMaker Python SDK."""
1414
from __future__ import absolute_import

src/sagemaker/cli/compatibility/v2/files.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FileUpdater(object):
3030

3131
def __init__(self, input_path, output_path):
3232
"""Creates a ``FileUpdater`` for updating a file so that
33-
it is compatible with version 2.0 or later of the SageMaker Python SDK.
33+
it is compatible with version 2.0 and later of the SageMaker Python SDK.
3434
3535
Args:
3636
input_path (str): Location of the input file.
@@ -44,7 +44,7 @@ def __init__(self, input_path, output_path):
4444
@abstractmethod
4545
def update(self):
4646
"""Reads the input file, updates the code so that it is
47-
compatible with version 2.0 or later of the SageMaker Python SDK,
47+
compatible with version 2.0 and later of the SageMaker Python SDK,
4848
and writes the updated code to an output file.
4949
"""
5050

@@ -66,22 +66,22 @@ class PyFileUpdater(FileUpdater):
6666

6767
def update(self):
6868
"""Reads the input Python file, updates the code so that it is
69-
compatible with version 2.0 or later of the SageMaker Python SDK,
69+
compatible with version 2.0 and later of the SageMaker Python SDK,
7070
and writes the updated code to an output file.
7171
"""
7272
output = self._update_ast(self._read_input_file())
7373
self._write_output_file(output)
7474

7575
def _update_ast(self, input_ast):
7676
"""Updates an abstract syntax tree (AST) so that it is compatible
77-
with version 2.0 or later of the SageMaker Python SDK.
77+
with version 2.0 and later of the SageMaker Python SDK.
7878
7979
Args:
8080
input_ast (ast.Module): AST to be updated for use with
81-
the Python SDK version 2.0 or later.
81+
the Python SDK version 2.0 and later.
8282
8383
Returns:
84-
ast.Module: Updated AST that is compatible with the Python SDK version 2.0 or later.
84+
ast.Module: Updated AST that is compatible with the Python SDK version 2.0 and later.
8585
"""
8686
return ASTTransformer().visit(input_ast)
8787

@@ -116,7 +116,7 @@ class JupyterNotebookFileUpdater(FileUpdater):
116116

117117
def update(self):
118118
"""Reads the input Jupyter notebook file, updates the code so that it is
119-
compatible with version 2.0 or later of the SageMaker Python SDK, and writes the
119+
compatible with version 2.0 and later of the SageMaker Python SDK, and writes the
120120
updated code to an output file.
121121
"""
122122
nb_json = self._read_input_file()
@@ -129,7 +129,7 @@ def update(self):
129129

130130
def _update_code_from_cell(self, cell):
131131
"""Updates the code from a code cell so that it is
132-
compatible with version 2.0 or later of the SageMaker Python SDK.
132+
compatible with version 2.0 and later of the SageMaker Python SDK.
133133
134134
Args:
135135
cell (dict): A dictionary representation of a code cell from

src/sagemaker/cli/compatibility/v2/modifiers/tf_legacy_mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Classes to modify TensorFlow legacy mode code to be compatible
14-
with version 2.0 or later of the SageMaker Python SDK.
14+
with version 2.0 and later of the SageMaker Python SDK.
1515
"""
1616
from __future__ import absolute_import
1717

src/sagemaker/cli/compatibility/v2/modifiers/tfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
"""Classes to modify TensorFlow Serving code to be compatible
14-
with version 2.0 or later of the SageMaker Python SDK.
14+
with version 2.0 and later of the SageMaker Python SDK.
1515
"""
1616
from __future__ import absolute_import
1717

@@ -60,7 +60,7 @@ def node_should_be_modified(self, node):
6060

6161
def modify_node(self, node):
6262
"""Modifies the ``ast.Call`` node to use the classes for TensorFlow Serving available in
63-
version 2.0 or later of the Python SDK:
63+
version 2.0 and later of the Python SDK:
6464
6565
- ``sagemaker.tensorflow.TensorFlowModel``
6666
- ``sagemaker.tensorflow.TensorFlowPredictor``

src/sagemaker/cli/compatibility/v2/sagemaker_upgrade_v2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
"""A tool to upgrade SageMaker Python SDK code to be compatible with version 2.0 or later."""
13+
"""A tool to upgrade SageMaker Python SDK code to be compatible with version 2.0 and later."""
1414
from __future__ import absolute_import
1515

1616
import argparse
@@ -22,7 +22,7 @@
2222

2323

2424
def _update_file(input_file, output_file):
25-
"""Updates a file to be compatible with version 2.0 or later of the SageMaker Python SDK,
25+
"""Updates a file to be compatible with version 2.0 and later of the SageMaker Python SDK,
2626
and write the updated source to the output file.
2727
2828
Args:
@@ -54,7 +54,7 @@ def _parse_args():
5454
"""Parses CLI arguments."""
5555
parser = argparse.ArgumentParser(
5656
description="A tool to convert files to be compatible with "
57-
"version 2.0 or later of the SageMaker Python SDK. "
57+
"version 2.0 and later of the SageMaker Python SDK. "
5858
"Simple usage: sagemaker-upgrade-v2 --in-file foo.py --out-file bar.py"
5959
)
6060
parser.add_argument(

0 commit comments

Comments
 (0)