Loading eval_lm.py +1 −2 Changes for eval_lm.py: 1 added line, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,8 +17,7 @@ from fairseq.sequence_scorer import SequenceScorer def main(args): assert args.path is not None, '--path required for evaluation!' if args.tokens_per_sample is None: args.tokens_per_sample = 1024 args.tokens_per_sample = getattr(args, 'tokens_per_sample', 1024) print(args) use_cuda = torch.cuda.is_available() and not args.cpu Loading train.py +1 −1 Changes for train.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ def main(args): train_meter.start() valid_losses = [None] valid_subsets = args.valid_subset.split(',') while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update: while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update: # train for one epoch train(args, trainer, task, epoch_itr) Loading Loading
eval_lm.py +1 −2 Changes for eval_lm.py: 1 added line, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,8 +17,7 @@ from fairseq.sequence_scorer import SequenceScorer def main(args): assert args.path is not None, '--path required for evaluation!' if args.tokens_per_sample is None: args.tokens_per_sample = 1024 args.tokens_per_sample = getattr(args, 'tokens_per_sample', 1024) print(args) use_cuda = torch.cuda.is_available() and not args.cpu Loading
train.py +1 −1 Changes for train.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ def main(args): train_meter.start() valid_losses = [None] valid_subsets = args.valid_subset.split(',') while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update: while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update: # train for one epoch train(args, trainer, task, epoch_itr) Loading