try on-the-fly feature extraction

This commit is contained in:
PingFeng Luo 2022-01-02 13:12:42 +08:00
parent 02e0171832
commit 05ea517c1f
2 changed files with 19 additions and 1 deletions

View File

@ -17,11 +17,18 @@
import argparse
import logging
import torch
from functools import lru_cache
from pathlib import Path
from typing import List
from lhotse import CutSet, Fbank, FbankConfig, load_manifest
from lhotse import (
CutSet,
Fbank,
FbankConfig,
load_manifest,
set_caching_enabled,
)
from lhotse.dataset import (
DynamicBucketingSampler,
CutConcatenate,
@ -37,6 +44,10 @@ from torch.utils.data import DataLoader
from icefall.utils import str2bool
set_caching_enabled(False)
torch.set_num_threads(1)
class WenetSpeechDataModule:
"""
DataModule for k2 ASR experiments.

View File

@ -129,6 +129,13 @@ def get_parser():
"2 means tri-gram",
)
parser.add_argument(
"--on-the-fly",
type=str2bool,
default=True,
help="Use on-the-fly feature extraction",
)
return parser