Skip to content

Commit 7cb0459

Browse files
committed
ODSC-40388: fix the folder
1 parent 801477b commit 7cb0459

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

docs/source/user_guide/model_registration/frameworks/tensorflowmodel.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ Prepare Model Artifact
4343
4444
from ads.common.model_metadata import UseCaseType
4545
from ads.model.framework.tensorflow_model import TensorFlowModel
46+
from uuid import uuid4
4647
47-
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir="./")
48+
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir=f"./model-artifact-{str(uuid4())}")
4849
tensorflow_model.prepare(
4950
inference_conda_env="tensorflow28_p38_cpu_v1",
5051
training_conda_env="tensorflow28_p38_cpu_v1",
@@ -230,6 +231,7 @@ Example
230231
from ads.model.framework.tensorflow_model import TensorFlowModel
231232
232233
import tensorflow as tf
234+
from uuid import uuid4
233235
234236
# Load MNIST Data
235237
mnist = tf.keras.datasets.mnist
@@ -250,7 +252,7 @@ Example
250252
model.fit(trainx, trainy, epochs=1)
251253
252254
# Prepare Model Artifact for TensorFlow model
253-
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir="./")
255+
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir=f"./model-artifact-{str(uuid4())}")
254256
tensorflow_model.prepare(
255257
inference_conda_env="tensorflow28_p38_cpu_v1",
256258
training_conda_env="tensorflow28_p38_cpu_v1",

docs/source/user_guide/model_registration/model_artifact.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Here is an example for preparing a model artifact for ``TensorFlow`` model.
4646
.. code-block:: python3
4747
4848
from ads.model.framework.tensorflow_model import TensorFlowModel
49-
import tempfile
49+
from uuid import uuid4
5050
import tensorflow as tf
5151
from ads.common.model_metadata import UseCaseType
5252
@@ -66,7 +66,7 @@ Here is an example for preparing a model artifact for ``TensorFlow`` model.
6666
tf_estimator.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"])
6767
tf_estimator.fit(x_train, y_train, epochs=1)
6868
69-
tf_model = TensorFlowModel(tf_estimator, artifact_dir=tempfile.mkdtemp())
69+
tf_model = TensorFlowModel(tf_estimator, artifact_dir=f"./model-artifact-{str(uuid4())}")
7070
7171
# Autogenerate score.py, pickled model, runtime.yaml, input_schema.json and output_schema.json
7272
tf_model.prepare(inference_conda_env="generalml_p38_cpu_v1",

docs/source/user_guide/model_registration/model_file_customization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Step1: Train your estimator and then generate the Model artifact as shown below
1212
1313
from ads.catalog.model import ModelCatalog
1414
from ads.model.framework.tensorflow_model import TensorFlowModel
15-
import tempfile
1615
import tensorflow as tf
16+
from uuid import uuid4
1717
from ads.common.model_metadata import UseCaseType
1818
1919
mnist = tf.keras.datasets.mnist
@@ -32,7 +32,7 @@ Step1: Train your estimator and then generate the Model artifact as shown below
3232
tf_estimator.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"])
3333
tf_estimator.fit(x_train, y_train, epochs=1)
3434
35-
tf_model = TensorFlowModel(tf_estimator, artifact_dir=tempfile.mkdtemp())
35+
tf_model = TensorFlowModel(tf_estimator, artifact_dir=f"./model-artifact-{str(uuid4())}")
3636
3737
# Autogenerate score.py, pickled model, runtime.yaml, input_schema.json and output_schema.json
3838
tf_model.prepare(inference_conda_env="generalml_p38_cpu_v1",

docs/source/user_guide/model_registration/quick_start.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Create a model, prepare it, verify that it works, save it to the model catalog,
247247
248248
from ads.model.framework.tensorflow_model import TensorFlowModel
249249
import tensorflow as tf
250+
from uuid import uuid4
250251
251252
mnist = tf.keras.datasets.mnist
252253
(x_train, y_train), (x_test, y_test) = mnist.load_data()
@@ -265,7 +266,7 @@ Create a model, prepare it, verify that it works, save it to the model catalog,
265266
tf_estimator.fit(x_train, y_train, epochs=1)
266267
267268
# Instantite ads.model.framework.tensorflow_model.TensorFlowModel using the pre-trained TensorFlow Model
268-
tf_model = TensorFlowModel(tf_estimator, artifact_dir="./")
269+
tf_model = TensorFlowModel(tf_estimator, artifact_dir=f"./model-artifact-{str(uuid4())}")
269270
270271
# Autogenerate score.py, pickled model, runtime.yaml, input_schema.json and output_schema.json
271272
tf_model.prepare(inference_conda_env="tensorflow28_p38_cpu_v1")

0 commit comments

Comments
 (0)