You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/user_guide/model_registration/frameworks/huggingfacemodel.rst
+25-38Lines changed: 25 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ See `API Documentation <../../../ads.model_framework.html#ads.model.framework.hu
10
10
Overview
11
11
========
12
12
13
-
The ``ads.model.framework.huggingface_model.HuggingFacePipelineModel`` class in ADS is designed to allow you to rapidly get a HuggingFace Pipeline into production. The ``.prepare()`` method creates the model artifacts that are needed to deploy a functioning pipeline without you having to configure it or write code. However, you can customize the required ``score.py`` file.
13
+
The ``ads.model.framework.huggingface_model.HuggingFacePipelineModel`` class in ADS is designed to allow you to rapidly get a HuggingFace pipelines into production. The ``.prepare()`` method creates the model artifacts that are needed to deploy a functioning pipeline without you having to configure it or write code. However, you can customize the required ``score.py`` file.
14
14
15
15
.. include:: ../_template/overview.rst
16
16
@@ -22,15 +22,13 @@ Load a `ImageSegmentationPipeline <https://huggingface.co/docs/transformers/main
# More info here - https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
66
64
67
65
68
-
Instantiate a ``HuggingFacePipelineModel()`` object with a HuggingFace Pipelines model. Each instance accepts the following parameters:
69
-
70
-
* ``artifact_dir: str``. Artifact directory to store the files needed for deployment.
71
-
* ``auth: (Dict, optional)``: Defaults to ``None``. The default authentication is set using the ``ads.set_auth`` API. To override the default, use ``ads.common.auth.api_keys()`` or ``ads.common.auth.resource_principal()`` and create the appropriate authentication signer and the ``**kwargs`` required to instantiate the ``IdentityClient`` object.
72
-
* ``estimator: Callable``. Any model object generated by the PyTorch framework.
73
-
* ``properties: (ModelProperties, optional)``. Defaults to ``None``. The ``ModelProperties`` object required to save and deploy model.
66
+
Instantiate a ``HuggingFacePipelineModel()`` object with HuggingFace pipelines. All the pipelines related files are saved under the ``artifact_dir``.
74
67
75
68
For more detailed information on what parameters that ``HuggingFacePipelineModel`` takes, refer to the `API Documentation <../../../ads.model_framework.html#ads.model.framework.huggingface_model.HuggingFacePipelineModel>`__
76
-
All the pipelines related files are saved under the ``artifact_dir``.
77
69
78
-
.. include:: ../_template/initialize.rst
79
70
80
71
81
72
Summary Status
@@ -106,35 +97,31 @@ Deploy and Generate Endpoint
106
97
107
98
>>> # Deploy and create an endpoint for the huggingface_pipeline_model
108
99
>>> huggingface_pipeline_model.deploy(
109
-
display_name="HuggingFace Pipeline Model For Image Segmentation",
>>> print([{"score": round(pred["score"], 4), "label": pred["label"]} for pred in preds['prediction']])
138
125
[{'score': 0.9879, 'label': 'LABEL_184'},
139
126
{'score': 0.9973, 'label': 'snow'},
140
127
{'score': 0.9972, 'label': 'cat'}]
@@ -157,6 +144,7 @@ Predict with Multiple Arguments
157
144
If your model takes more than one argument, you can pass in through dictionary with the keys as the argument name and values as the value of the arguement.
0 commit comments