mirror of
https://github.com/modelscope/modelscope.git
synced 2026-05-18 13:15:06 +02:00
Merge branch 'maas_flex_train_dev' modify finetune_text_classification for arguments collision between eval_strategy and by_e...
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user