speech_asr
2023-04-17 4012630708cd2dee7f2f292b3961e6054b9b66c1
update
1个文件已修改
13 ■■■■ 已修改文件
funasr/datasets/small_datasets/build_loader.py 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/datasets/small_datasets/build_loader.py
@@ -1,16 +1,15 @@
import torch
from funasr.datasets.small_datasets.dataset import ESPnetDataset
from funasr.datasets.small_datasets.build_preprocess import build_preprocess
from funasr.datasets.small_datasets.preprocessor import build_preprocess
def build_dataloader(args):
    if args.frontend_conf is not None:
        dest_sample_rate = args.frontend_conf["fs"] if (args.frontend_conf is not None and "fs" in args.frontend_conf) else 16000
    preprocess_fn = build_preprocess()
def build_dataloader(args, train=False):
    preprocess_fn = build_preprocess(args, train=train)
    dest_sample_rate = args.frontend_conf["fs"] if (args.frontend_conf is not None and "fs" in args.frontend_conf) else 16000
    dataset = ESPnetDataset(
        iter_options.data_path_and_name_and_type,
        float_dtype=args.train_dtype,
        preprocess=preprocess_fn,
        max_cache_size=iter_options.max_cache_size,
        max_cache_fd=iter_options.max_cache_fd,
        max_cache_size=args.max_cache_size,
        max_cache_fd=args.max_cache_fd,
        dest_sample_rate=dest_sample_rate,
    )