Revert "Update finetune_on_pregenerated.py"

This reverts commit a1359b970c.
This commit is contained in:
Duzeyao 2019-08-20 16:40:39 +08:00
parent a1359b970c
commit 45ab8bf60e

View File

@ -314,8 +314,8 @@ def main():
mean_loss = tr_loss * args.gradient_accumulation_steps / nb_tr_steps
pbar.set_postfix_str(f"Loss: {mean_loss:.5f}")
if (step + 1) % args.gradient_accumulation_steps == 0:
optimizer.step()
scheduler.step() # Update learning rate schedule
optimizer.step()
optimizer.zero_grad()
global_step += 1