Skip to content

Commit

Permalink
Update train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yfyeung authored Apr 11, 2024
1 parent ba5b2e8 commit ab91fff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion egs/librispeech/ASR/zipformer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,10 @@ def save_bad_model(suffix: str = ""):
scaler.step(optimizer)
scaler.update()
optimizer.zero_grad()
except: # noqa
except Exception as e:
logging.info(
f"Caught exception: {e}."
)
save_bad_model()
display_and_save_batch(batch, params=params, sp=sp)
raise
Expand Down

0 comments on commit ab91fff

Please sign in to comment.