Skip to content

Commit abfc1fc

Browse files
Merge branch 'main' into 208-refactor-nlp-example-to-tokenize-first
2 parents 2a69e95 + 8c5a60d commit abfc1fc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/automerge.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ name: Python application
55

66
on:
77
push:
8+
89
branches: [ "main", "208-refactor-nlp-example-to-tokenize-first" ]
910

11+
1012
permissions:
1113
contents: read
1214

cerebros/simplecerebrosrandomsearch/simple_cerebros_random_search.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# from cmdutil.cmdutil import run_command
1414
from multiprocessing import Process, Lock
1515
import os
16+
from gc import collect
17+
1618

1719
# import optuna
1820
# from optuna.pruners import BasePruner
@@ -480,6 +482,8 @@ def run_moity_permutations(self, spec, subtrial_number, lock):
480482
model_graph_file=model_graph_file,
481483
train_data_dtype=self.train_data_dtype
482484
)
485+
tf.keras.backend.clear_session()
486+
collect()
483487
nnf.materialize()
484488
nnf.compile_neural_network()
485489
neural_network = nnf.materialized_neural_network
@@ -515,7 +519,11 @@ def run_moity_permutations(self, spec, subtrial_number, lock):
515519
index=False,
516520
header=self.needs_oracle_header,
517521
mode='a')
522+
518523
self.needs_oracle_header = False
524+
neural_network = None
525+
tf.keras.backend.clear_session()
526+
collect()
519527
return 0
520528

521529
def run_random_search(self):

0 commit comments

Comments
 (0)