Skip to content

Commit 8f948a7

Browse files
committed
updated user guide: prepare() with custom scorepy
1 parent 6368348 commit 8f948a7

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/source/user_guide/model_registration/model_artifact.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Auto generation of ``score.py`` with framework specific code for loading models
3030

3131
To accomodate for other frameworks that are unknown to ADS, a template code for ``score.py`` is generated in the provided artificat directory location.
3232

33+
3334
Prepare the Model Artifact
3435
--------------------------
3536

@@ -98,8 +99,25 @@ ADS automatically captures:
9899
* ``UseCaseType`` in ``metadata_taxonomy`` cannot be automatically populated. One way to populate the use case is to pass ``use_case_type`` to the ``prepare`` method.
99100
* Model introspection is automatically triggered.
100101

101-
.. include:: _template/score.rst
102+
Prepare with custom ``score.py``
103+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104+
105+
.. versionadded:: 2.8.4
102106

107+
You could provide the location of your own ``score.py`` by ``score_py_uri`` in :py:meth:`~ads.model.GenericModel.prepare`.
108+
The provided ``score.py`` will be added into model artifact.
109+
110+
.. code-block:: python3
111+
112+
tf_model.prepare(
113+
inference_conda_env="generalml_p38_cpu_v1",
114+
use_case_type=UseCaseType.MULTINOMIAL_CLASSIFICATION,
115+
X_sample=trainx,
116+
y_sample=trainy,
117+
score_py_uri="oci://my-bucket@my-namespace/score.py"
118+
)
119+
120+
.. include:: _template/score.rst
103121

104122
Model Introspection
105123
-------------------

0 commit comments

Comments
 (0)