speech_asr
2023-04-18 c2b99916f5f87ed9c2c5b5f3ba5aa914c057a8e8
funasr/bin/train.py
@@ -4,6 +4,7 @@
import torch
from funasr.torch_utils.set_all_random_seed import set_all_random_seed
from funasr.utils import config_argparse
from funasr.utils.build_distributed import build_distributed
from funasr.utils.prepare_data import prepare_data
@@ -24,6 +25,7 @@
        help="The number of gpus. 0 indicates CPU mode",
    )
    parser.add_argument("--seed", type=int, default=0, help="Random seed")
    parser.add_argument("--task_name", type=str, default="asr", help="Name for different tasks")
    # ddp related
    parser.add_argument(
@@ -340,4 +342,10 @@
                                                                   distributed_option.dist_rank,
                                                                   distributed_option.local_rank))
    # prepare files for dataloader
    prepare_data(args, distributed_option)
    set_all_random_seed(args.seed)
    torch.backends.cudnn.enabled = args.cudnn_enabled
    torch.backends.cudnn.benchmark = args.cudnn_benchmark
    torch.backends.cudnn.deterministic = args.cudnn_deterministic