push fix to training

This commit is contained in:
thomwolf
2019-09-25 17:33:16 +02:00
parent 5def3302f4
commit a049c8043b
6 changed files with 75 additions and 4 deletions

View File

@@ -154,8 +154,8 @@ def train(args, train_dataset, model, tokenizer):
tr_loss += loss.item()
if (step + 1) % args.gradient_accumulation_steps == 0:
scheduler.step() # Update learning rate schedule
optimizer.step()
scheduler.step() # Update learning rate schedule
model.zero_grad()
global_step += 1