From 4ace5a95b052d338947fc88809a440ccd55cf6b4 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期四, 16 十一月 2023 16:39:52 +0800
Subject: [PATCH] funasr pages
---
funasr/build_utils/build_streaming_iterator.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/funasr/build_utils/build_streaming_iterator.py b/funasr/build_utils/build_streaming_iterator.py
index ad36b4e..02fc263 100644
--- a/funasr/build_utils/build_streaming_iterator.py
+++ b/funasr/build_utils/build_streaming_iterator.py
@@ -1,6 +1,5 @@
import numpy as np
from torch.utils.data import DataLoader
-from typeguard import check_argument_types
from funasr.datasets.iterable_dataset import IterableESPnetDataset
from funasr.datasets.small_datasets.collate_fn import CommonCollateFn
@@ -18,14 +17,16 @@
dtype: str = np.float32,
num_workers: int = 1,
use_collate_fn: bool = True,
+ preprocess_fn=None,
ngpu: int = 0,
- train: bool=False,
+ train: bool = False,
) -> DataLoader:
"""Build DataLoader using iterable dataset"""
- assert check_argument_types()
# preprocess
- if preprocess_args is not None:
+ if preprocess_fn is not None:
+ preprocess_fn = preprocess_fn
+ elif preprocess_args is not None:
preprocess_args.task_name = task_name
preprocess_fn = build_preprocess(preprocess_args, train)
else:
--
Gitblit v1.9.1