We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 852ae14 commit d774374Copy full SHA for d774374
cerebros/simplecerebrosrandomsearch/simple_cerebros_random_search.py
@@ -14,6 +14,7 @@
14
from multiprocessing import Process, Lock
15
import os
16
from gc import collect
17
+from shutil import rmtree
18
19
20
# import optuna
@@ -596,8 +597,14 @@ def has_valid_metric(num):
596
597
print(f"Best model name: {self.best_model_path}")
598
return best
599
- def get_best_model(self):
600
+ def purge_model_storage(self):
601
+ path_0 = f"{self.project_name}/models"
602
+ rmtree(path_0)
603
+
604
+ def get_best_model(self, purge_model_storage_files: bool=False):
605
best_model = tf.keras.models.load_model(self.best_model_path)
606
+ if purge_model_storage_files:
607
+ self.purge_model_storage()
608
return best_model
609
610
# ->
0 commit comments