Skip to content

Commit 0498077

Browse files
authored
Merge branch 'master' into patch-1
2 parents 18e322a + 2a672bd commit 0498077

File tree

7 files changed

+62
-32
lines changed

7 files changed

+62
-32
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## v2.48.1 (2021-07-08)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* skip HF inference test
8+
* remove upsert from test_workflow
9+
10+
### Documentation Changes
11+
12+
* Add Hugging Face docs
13+
* add tuning step to doc
14+
315
## v2.48.0 (2021-07-07)
416

517
### Features

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.48.1.dev0
1+
2.48.2.dev0
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
HuggingFace
2-
===========
1+
Hugging Face
2+
============
33

4-
HuggingFace Estimator
5-
---------------------
4+
Hugging Face Estimator
5+
----------------------
66

77
.. autoclass:: sagemaker.huggingface.estimator.HuggingFace
88
:members:
99
:undoc-members:
1010
:show-inheritance:
11+
12+
Hugging Face Model
13+
------------------
14+
15+
.. autoclass:: sagemaker.huggingface.model.HuggingFaceModel
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
HuggingFace Predictor
21+
---------------------
22+
23+
.. autoclass:: sagemaker.huggingface.model.HuggingFacePredictor
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:

src/sagemaker/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ def compile_model(
718718
'onnx', 'xgboost'
719719
framework_version (str): The version of the framework
720720
compile_max_run (int): Timeout in seconds for compilation (default:
721-
3 * 60). After this amount of time Amazon SageMaker Neo
721+
15 * 60). After this amount of time Amazon SageMaker Neo
722722
terminates the compilation job regardless of its current status.
723723
tags (list[dict]): List of tags for labeling a compilation job. For
724724
more, see

src/sagemaker/huggingface/model.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030

3131

3232
class HuggingFacePredictor(Predictor):
33-
"""A Predictor for inference against HuggingFace Endpoints.
33+
"""A Predictor for inference against Hugging Face Endpoints.
3434
3535
This is able to serialize Python lists, dictionaries, and numpy arrays to
36-
multidimensional tensors for HuggingFace inference.
36+
multidimensional tensors for Hugging Face inference.
3737
"""
3838

3939
def __init__(
@@ -48,7 +48,7 @@ def __init__(
4848
Args:
4949
endpoint_name (str): The name of the endpoint to perform inference
5050
on.
51-
sagemaker_session (sagemaker.session.Session): Session object which
51+
sagemaker_session (sagemaker.session.Session): Session object that
5252
manages interactions with Amazon SageMaker APIs and any other
5353
AWS services needed. If not specified, the estimator creates one
5454
using the default AWS configuration chain.
@@ -85,7 +85,7 @@ def _validate_pt_tf_versions(pytorch_version, tensorflow_version, image_uri):
8585

8686

8787
class HuggingFaceModel(FrameworkModel):
88-
"""An HuggingFace SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``."""
88+
"""A Hugging Face SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``."""
8989

9090
_framework_name = "huggingface"
9191

@@ -106,19 +106,19 @@ def __init__(
106106
"""Initialize a HuggingFaceModel.
107107
108108
Args:
109-
model_data (str): The S3 location of a SageMaker model data
109+
model_data (str): The Amazon S3 location of a SageMaker model data
110110
``.tar.gz`` file.
111-
role (str): An AWS IAM role (either name or full ARN). The Amazon
111+
role (str): An AWS IAM role specified with either the name or full ARN. The Amazon
112112
SageMaker training jobs and APIs that create Amazon SageMaker
113113
endpoints use this role to access training data and model
114114
artifacts. After the endpoint is created, the inference code
115115
might use the IAM role, if it needs to access an AWS resource.
116-
entry_point (str): Path (absolute or relative) to the Python source
117-
file which should be executed as the entry point to model
116+
entry_point (str): The absolute or relative path to the Python source
117+
file that should be executed as the entry point to model
118118
hosting. If ``source_dir`` is specified, then ``entry_point``
119119
must point to a file located at the root of ``source_dir``.
120120
Defaults to None.
121-
transformers_version (str): transformers version you want to use for
121+
transformers_version (str): Transformers version you want to use for
122122
executing your model training code. Defaults to None. Required
123123
unless ``image_uri`` is provided.
124124
tensorflow_version (str): TensorFlow version you want to use for
@@ -132,7 +132,7 @@ def __init__(
132132
py_version (str): Python version you want to use for executing your
133133
model training code. Defaults to ``None``. Required unless
134134
``image_uri`` is provided.
135-
image_uri (str): A Docker image URI (default: None). If not specified, a
135+
image_uri (str): A Docker image URI. Defaults to None. If not specified, a
136136
default image for PyTorch will be used. If ``framework_version``
137137
or ``py_version`` are ``None``, then ``image_uri`` is required. If
138138
also ``None``, then a ``ValueError`` will be raised.
@@ -197,19 +197,21 @@ def register(
197197
transform_instances (list): A list of the instance types on which a transformation
198198
job can be run or on which an endpoint can be deployed.
199199
model_package_name (str): Model Package name, exclusive to `model_package_group_name`,
200-
using `model_package_name` makes the Model Package un-versioned (default: None).
200+
using `model_package_name` makes the Model Package un-versioned.
201+
Defaults to ``None``.
201202
model_package_group_name (str): Model Package Group name, exclusive to
202203
`model_package_name`, using `model_package_group_name` makes the Model Package
203-
versioned (default: None).
204-
image_uri (str): Inference image uri for the container. Model class' self.image will
205-
be used if it is None (default: None).
206-
model_metrics (ModelMetrics): ModelMetrics object (default: None).
207-
metadata_properties (MetadataProperties): MetadataProperties object (default: None).
204+
versioned. Defaults to ``None``.
205+
image_uri (str): Inference image URI for the container. Model class' self.image will
206+
be used if it is None. Defaults to ``None``.
207+
model_metrics (ModelMetrics): ModelMetrics object. Defaults to ``None``.
208+
metadata_properties (MetadataProperties): MetadataProperties object.
209+
Defaults to ``None``.
208210
marketplace_cert (bool): A boolean value indicating if the Model Package is certified
209-
for AWS Marketplace (default: False).
211+
for AWS Marketplace. Defaults to ``False``.
210212
approval_status (str): Model Approval Status, values can be "Approved", "Rejected",
211-
or "PendingManualApproval" (default: "PendingManualApproval").
212-
description (str): Model Package description (default: None).
213+
or "PendingManualApproval". Defaults to ``PendingManualApproval``.
214+
description (str): Model Package description. Defaults to ``None``.
213215
214216
Returns:
215217
A `sagemaker.model.ModelPackage` instance.

src/sagemaker/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def compile(
559559
role,
560560
tags=None,
561561
job_name=None,
562-
compile_max_run=5 * 60,
562+
compile_max_run=15 * 60,
563563
framework=None,
564564
framework_version=None,
565565
target_platform_os=None,
@@ -588,7 +588,7 @@ def compile(
588588
https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html.
589589
job_name (str): The name of the compilation job
590590
compile_max_run (int): Timeout in seconds for compilation (default:
591-
3 * 60). After this amount of time Amazon SageMaker Neo
591+
15 * 60). After this amount of time Amazon SageMaker Neo
592592
terminates the compilation job regardless of its current status.
593593
framework (str): The framework that is used to train the original
594594
model. Allowed values: 'mxnet', 'tensorflow', 'keras', 'pytorch',

tests/integ/test_huggingface.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ def test_huggingface_training(
6868
hf.fit(train_input)
6969

7070

71-
@pytest.mark.skip(
72-
reason="need to re enable it later",
71+
@pytest.mark.release
72+
@pytest.mark.skipif(
73+
integ.test_region() in integ.TRAINING_NO_P2_REGIONS, reason="no ml.p2 instances in this region"
7374
)
7475
def test_huggingface_training_tf(
7576
sagemaker_session,
@@ -107,9 +108,8 @@ def test_huggingface_training_tf(
107108
hf.fit(train_input)
108109

109110

110-
@pytest.mark.release
111-
@pytest.mark.skipif(
112-
integ.test_region() in integ.TRAINING_NO_P2_REGIONS, reason="no ml.p2 instances in this region"
111+
@pytest.mark.skip(
112+
reason="need to re enable it later",
113113
)
114114
def test_huggingface_inference(
115115
sagemaker_session,

0 commit comments

Comments
 (0)