mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-07 08:04:18 +00:00
Support specifying number of workers for on-the-fly feature extraction.
This commit is contained in:
parent
bbf074a36b
commit
0cc13bc702
@ -101,6 +101,13 @@ class AsrDataModule:
|
|||||||
"collect the batches.",
|
"collect the batches.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
group.add_argument(
|
||||||
|
"--on-the-fly-num-workers",
|
||||||
|
type=int,
|
||||||
|
default=0,
|
||||||
|
help="The number of workers for on-the-fly feature extraction",
|
||||||
|
)
|
||||||
|
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--enable-spec-aug",
|
"--enable-spec-aug",
|
||||||
type=str2bool,
|
type=str2bool,
|
||||||
@ -212,7 +219,10 @@ class AsrDataModule:
|
|||||||
train = K2SpeechRecognitionDataset(
|
train = K2SpeechRecognitionDataset(
|
||||||
cut_transforms=transforms,
|
cut_transforms=transforms,
|
||||||
input_strategy=(
|
input_strategy=(
|
||||||
OnTheFlyFeatures(Fbank(FbankConfig(num_mel_bins=80)))
|
OnTheFlyFeatures(
|
||||||
|
extractor=Fbank(FbankConfig(num_mel_bins=80)),
|
||||||
|
num_workers=self.args.on_the_fly_num_workers,
|
||||||
|
)
|
||||||
if on_the_fly_feats
|
if on_the_fly_feats
|
||||||
else PrecomputedFeatures()
|
else PrecomputedFeatures()
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user