File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 2727
2828class ToAudio (torch .utils .data .Dataset ):
2929 def __getitem__ (self , cuts ):
30+ cuts = lhotse .CutSet ([c .to_mono (mono_downmix = True ) if isinstance (c , lhotse .MultiCut ) else c for c in cuts ])
3031 audios , audio_lens = cuts .load_audio (collate = True )
3132 return {"cuts" : cuts , "audios" : audios , "audio_lens" : audio_lens }
3233
3334
3435def setup_dloader (audio_files , batch_size , num_workers ):
3536 cuts = lhotse .CutSet ([lhotse .Recording .from_file (p ).to_cut () for p in audio_files ])
37+ cuts = cuts .resample (16000 )
3638 return torch .utils .data .DataLoader (
3739 dataset = ToAudio (),
3840 sampler = lhotse .dataset .DynamicCutSampler (cuts , max_cuts = batch_size ),
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33export PYTHONPATH=" .." :$PYTHONPATH
4+ export TOKENIZERS_PARALLELISM=false
45
56MODEL_IDs=(
67 nvidia/canary-qwen-2.5b
You can’t perform that action at this time.
0 commit comments