Skip to content

Commit

Permalink
Run keras tuner from a temp directory
Browse files Browse the repository at this point in the history
Otherwise the temporary saved models will always be in your current
working directory. I don't think we need to make this configurable, as
you can already specify the output directory for the best saved model.
  • Loading branch information
mattdangerw committed May 25, 2022
1 parent 1ca9ae1 commit 4d99574
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/bert/bert_finetune_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
"""Run finetuning on a GLUE task."""

import tempfile

import datasets
import keras_tuner
import tensorflow as tf
Expand Down Expand Up @@ -251,6 +253,7 @@ def preprocess_data(inputs, labels):
max_trials=4,
overwrite=True,
project_name="hyperparameter_tuner_results",
directory=tempfile.mkdtemp(),
)

tuner.search(
Expand Down

0 comments on commit 4d99574

Please sign in to comment.