Skip to content

Commit 801477b

Browse files
committed
change temp dir to current dir
1 parent 01f3d54 commit 801477b

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ Prepare Model Artifact
4343
4444
from ads.common.model_metadata import UseCaseType
4545
from ads.model.framework.tensorflow_model import TensorFlowModel
46-
import tempfile
4746
48-
artifact_dir = tempfile.mkdtemp()
49-
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir=artifact_dir)
47+
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir="./")
5048
tensorflow_model.prepare(
5149
inference_conda_env="tensorflow28_p38_cpu_v1",
5250
training_conda_env="tensorflow28_p38_cpu_v1",
@@ -233,8 +231,6 @@ Example
233231
234232
import tensorflow as tf
235233
236-
import tempfile
237-
238234
# Load MNIST Data
239235
mnist = tf.keras.datasets.mnist
240236
(trainx, trainy), (testx, testy) = mnist.load_data()
@@ -253,11 +249,8 @@ Example
253249
model.compile(optimizer="adam", loss=loss_fn, metrics=["accuracy"])
254250
model.fit(trainx, trainy, epochs=1)
255251
256-
257-
artifact_dir = tempfile.mkdtemp()
258-
259252
# Prepare Model Artifact for TensorFlow model
260-
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir=artifact_dir)
253+
tensorflow_model = TensorFlowModel(estimator=model, artifact_dir="./")
261254
tensorflow_model.prepare(
262255
inference_conda_env="tensorflow28_p38_cpu_v1",
263256
training_conda_env="tensorflow28_p38_cpu_v1",

docs/source/user_guide/model_registration/quick_start.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ Create a model, prepare it, verify that it works, save it to the model catalog,
246246
.. code-block:: python3
247247
248248
from ads.model.framework.tensorflow_model import TensorFlowModel
249-
import tempfile
250249
import tensorflow as tf
251250
252251
mnist = tf.keras.datasets.mnist
@@ -266,7 +265,7 @@ Create a model, prepare it, verify that it works, save it to the model catalog,
266265
tf_estimator.fit(x_train, y_train, epochs=1)
267266
268267
# Instantite ads.model.framework.tensorflow_model.TensorFlowModel using the pre-trained TensorFlow Model
269-
tf_model = TensorFlowModel(tf_estimator, artifact_dir=tempfile.mkdtemp())
268+
tf_model = TensorFlowModel(tf_estimator, artifact_dir="./")
270269
271270
# Autogenerate score.py, pickled model, runtime.yaml, input_schema.json and output_schema.json
272271
tf_model.prepare(inference_conda_env="tensorflow28_p38_cpu_v1")

0 commit comments

Comments
 (0)