Skip to content

Commit c4c9415

Browse files
authored
add the enable_add_to for the static bert
add the enable_add_to for the static bert
2 parents 1ef3378 + 57731ab commit c4c9415

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/language_model/bert/static/run_pretrain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def reset_program_state_dict(model, state_dict):
192192
return new_state_dict
193193

194194

195-
def create_strategy():
195+
def create_strategy(args):
196196
"""
197197
Create build strategy and exec strategy.
198198
"""
@@ -210,7 +210,7 @@ def dist_optimizer(args, optimizer):
210210
"""
211211
Create a distributed optimizer based on a normal optimizer
212212
"""
213-
build_strategy, exec_strategy = create_strategy()
213+
build_strategy, exec_strategy = create_strategy(args)
214214

215215
dist_strategy = fleet.DistributedStrategy()
216216
dist_strategy.execution_strategy = exec_strategy
@@ -344,8 +344,8 @@ def do_train(args):
344344
while True:
345345
files = [
346346
os.path.join(args.input_dir, f) for f in os.listdir(args.input_dir)
347-
if os.path.isfile(os.path.join(args.input_dir, f)) and
348-
"training" in f
347+
if os.path.isfile(os.path.join(args.input_dir, f)) and "training" in
348+
f
349349
]
350350
files.sort()
351351
num_files = len(files)

0 commit comments

Comments
 (0)