fixes to incorporate with the latest Lhotse release

This commit is contained in:
jinzr 2023-09-13 11:47:35 +08:00
parent 3199058194
commit b96fdebe8d
3 changed files with 6 additions and 5 deletions

View File

@ -26,7 +26,7 @@ from lhotse.dataset import (
DynamicBucketingSampler,
K2SpeechRecognitionDataset,
PrecomputedFeatures,
SingleCutSampler,
SimpleCutSampler,
)
from lhotse.dataset.input_strategies import OnTheFlyFeatures
from torch.utils.data import DataLoader
@ -196,8 +196,8 @@ class YesNoAsrDataModule(DataModule):
drop_last=True,
)
else:
logging.info("Using SingleCutSampler.")
train_sampler = SingleCutSampler(
logging.info("Using SimpleCutSampler.")
train_sampler = SimpleCutSampler(
cuts_train,
max_duration=self.args.max_duration,
shuffle=self.args.shuffle,

View File

@ -10,6 +10,7 @@ graphviz==0.19.1
-f https://download.pytorch.org/whl/cpu/torch_stable.html torch==1.13.1+cpu
-f https://download.pytorch.org/whl/cpu/torch_stable.html torchaudio==0.13.1+cpu
six
-f https://k2-fsa.org/nightly/ k2==1.23.4.dev20230319+cpu.torch1.13.1

View File

@ -26,7 +26,7 @@
from pathlib import Path
from lhotse import CutSet, load_manifest
from lhotse.dataset import K2SpeechRecognitionDataset, SingleCutSampler
from lhotse.dataset import K2SpeechRecognitionDataset, SimpleCutSampler
from lhotse.dataset.collation import collate_custom_field
from torch.utils.data import DataLoader
@ -44,7 +44,7 @@ def get_dataloader():
cuts = load_manifest(cuts_json)
print(cuts[0])
cuts = cuts.with_features_path_prefix(egs_dir)
sampler = SingleCutSampler(
sampler = SimpleCutSampler(
cuts,
max_duration=10,
shuffle=False,