Skip to content

Commit

Permalink
fix max_step of transformer-xl (PaddlePaddle#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostML authored Mar 15, 2021
1 parent 18b0535 commit 54b4e64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/language_model/transformer-xl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ def do_train(args):
optimizer.set_lr(curr_lr)
elif args.scheduler == 'noam':
scheduler.step()
if step_idx >= args.max_step:
break
if step_idx >= args.max_step:
return

if args.save_model and rank == 0:
model_dir = os.path.join(args.save_model, "step_final")
Expand Down

0 comments on commit 54b4e64

Please sign in to comment.