Skip to content

Commit

Permalink
add --max-tokens-valid option for validation
Browse files Browse the repository at this point in the history
Summary: Add the max-token-valid option. Sometime a separate max batch tokens for validation may be helpful, for example when there is a long sequence in validation set thats larger than max_tokens (it's rare in MT but could happen in ASR or AST).

Reviewed By: myleott

Differential Revision: D16076951

fbshipit-source-id: ae7f4218594580b9450a8196d7afa1e7e2018aee
  • Loading branch information
Xutai Ma authored and yzpang committed Feb 19, 2021
1 parent 54275c5 commit 7253686
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def validate(args, trainer, task, epoch_itr, subsets):
# Initialize data iterator
itr = task.get_batch_iterator(
dataset=task.dataset(subset),
max_tokens=args.max_tokens,
max_tokens=args.max_tokens_valid,
max_sentences=args.max_sentences_valid,
max_positions=utils.resolve_max_positions(
task.max_positions(),
Expand Down

0 comments on commit 7253686

Please sign in to comment.