30
30
31
31
32
32
class HuggingFacePredictor (Predictor ):
33
- """A Predictor for inference against HuggingFace Endpoints.
33
+ """A Predictor for inference against Hugging Face Endpoints.
34
34
35
35
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.
37
37
"""
38
38
39
39
def __init__ (
@@ -48,7 +48,7 @@ def __init__(
48
48
Args:
49
49
endpoint_name (str): The name of the endpoint to perform inference
50
50
on.
51
- sagemaker_session (sagemaker.session.Session): Session object which
51
+ sagemaker_session (sagemaker.session.Session): Session object that
52
52
manages interactions with Amazon SageMaker APIs and any other
53
53
AWS services needed. If not specified, the estimator creates one
54
54
using the default AWS configuration chain.
@@ -85,7 +85,7 @@ def _validate_pt_tf_versions(pytorch_version, tensorflow_version, image_uri):
85
85
86
86
87
87
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``."""
89
89
90
90
_framework_name = "huggingface"
91
91
@@ -106,19 +106,19 @@ def __init__(
106
106
"""Initialize a HuggingFaceModel.
107
107
108
108
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
110
110
``.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
112
112
SageMaker training jobs and APIs that create Amazon SageMaker
113
113
endpoints use this role to access training data and model
114
114
artifacts. After the endpoint is created, the inference code
115
115
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
118
118
hosting. If ``source_dir`` is specified, then ``entry_point``
119
119
must point to a file located at the root of ``source_dir``.
120
120
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
122
122
executing your model training code. Defaults to None. Required
123
123
unless ``image_uri`` is provided.
124
124
tensorflow_version (str): TensorFlow version you want to use for
@@ -132,7 +132,7 @@ def __init__(
132
132
py_version (str): Python version you want to use for executing your
133
133
model training code. Defaults to ``None``. Required unless
134
134
``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
136
136
default image for PyTorch will be used. If ``framework_version``
137
137
or ``py_version`` are ``None``, then ``image_uri`` is required. If
138
138
also ``None``, then a ``ValueError`` will be raised.
@@ -197,19 +197,21 @@ def register(
197
197
transform_instances (list): A list of the instance types on which a transformation
198
198
job can be run or on which an endpoint can be deployed.
199
199
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``.
201
202
model_package_group_name (str): Model Package Group name, exclusive to
202
203
`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``.
208
210
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`` .
210
212
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`` .
213
215
214
216
Returns:
215
217
A `sagemaker.model.ModelPackage` instance.
0 commit comments