Merge branch 'maas_flex_train_dev' modify finetune_text_classification for arguments collision between eval_strategy and by_e...

This commit is contained in:
zsl01670416
2023-06-30 19:04:14 +08:00
committed by yuze.zyz
parent 30599dc34f
commit 2a2cc594eb

View File

@@ -63,6 +63,8 @@ def cfg_modify_fn(cfg):
else:
cfg = config
cfg.model['num_labels'] = len(cfg.preprocessor.label2id)
if cfg.evaluation.period.eval_strategy == 'by_epoch':
cfg.evaluation.period.by_epoch = True
if cfg.train.lr_scheduler.type == 'LinearLR':
cfg.train.lr_scheduler['total_iters'] = \
int(len(train_dataset) / cfg.train.dataloader.batch_size_per_gpu) * cfg.train.max_epochs