| | |
| | | args = build_args(args, parser, extra_task_params) |
| | | |
| | | if args.local_rank is not None: |
| | | args.distributed = True |
| | | args.simple_ddp = True |
| | | distributed = True |
| | | else: |
| | | args.distributed = False |
| | | args.ngpu = 1 |
| | | distributed = False |
| | | args.local_rank = args.local_rank if args.local_rank is not None else 0 |
| | | local_rank = args.local_rank |
| | | if "CUDA_VISIBLE_DEVICES" in os.environ.keys(): |
| | |
| | | init_param = modelscope_dict['init_model'] |
| | | cmvn_file = modelscope_dict['cmvn_file'] |
| | | seg_dict_file = modelscope_dict['seg_dict'] |
| | | if 'bpemodel' in modelscope_dict: |
| | | bpemodel = modelscope_dict['bpemodel'] |
| | | else: |
| | | bpemodel = None |
| | | |
| | | # overwrite parameters |
| | | with open(config) as f: |
| | |
| | | args.seg_dict_file = seg_dict_file |
| | | else: |
| | | args.seg_dict_file = None |
| | | if bpemodel is not None and os.path.exists(bpemodel): |
| | | args.bpemodel = bpemodel |
| | | else: |
| | | args.bpemodel = None |
| | | args.data_dir = data_dir |
| | | args.train_set = train_set |
| | | args.dev_set = dev_set |
| | |
| | | args.batch_type = "length" |
| | | args.oss_bucket = None |
| | | args.input_size = None |
| | | if distributed: |
| | | args.distributed = True |
| | | args.simple_ddp = True |
| | | else: |
| | | args.distributed = False |
| | | args.ngpu = 1 |
| | | if optim is not None: |
| | | args.optim = optim |
| | | if lr is not None: |
| | |
| | | if batch_bins is not None: |
| | | if args.dataset_type == "small": |
| | | args.batch_bins = batch_bins |
| | | args.dataset_conf["batch_conf"]["batch_size"] = batch_bins |
| | | elif args.dataset_type == "large": |
| | | args.dataset_conf["batch_conf"]["batch_size"] = batch_bins |
| | | else: |