Skip to content

Commit

Permalink
Replace ChunkedLilcomHdf5Writer with LilcomChunkyWriter. (k2-fsa#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Jun 9, 2022
1 parent 8512aaf commit ed66877
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -90,7 +90,7 @@ def compute_fbank_aidatatang_200zh(num_mel_bins: int = 80):
# when an executor is specified, make more partitions
num_jobs=num_jobs if ex is None else 80,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)

cut_set.to_file(output_dir / f"{prefix}_cuts_{partition}.{suffix}")
Expand Down
4 changes: 2 additions & 2 deletions egs/aishell/ASR/local/compute_fbank_aidatatang_200zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -90,7 +90,7 @@ def compute_fbank_aidatatang_200zh(num_mel_bins: int = 80):
# when an executor is specified, make more partitions
num_jobs=num_jobs if ex is None else 80,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)

cut_set.to_file(output_dir / f"{prefix}_cuts_{partition}.{suffix}")
Expand Down
4 changes: 2 additions & 2 deletions egs/aishell/ASR/local/compute_fbank_aishell.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -86,7 +86,7 @@ def compute_fbank_aishell(num_mel_bins: int = 80):
# when an executor is specified, make more partitions
num_jobs=num_jobs if ex is None else 80,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
cut_set.to_file(output_dir / f"{prefix}_cuts_{partition}.{suffix}")

Expand Down
4 changes: 2 additions & 2 deletions egs/alimeeting/ASR/local/compute_fbank_alimeeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -90,7 +90,7 @@ def compute_fbank_alimeeting(num_mel_bins: int = 80):
# when an executor is specified, make more partitions
num_jobs=cur_num_jobs,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)

logging.info("About splitting cuts into smaller chunks")
Expand Down
4 changes: 2 additions & 2 deletions egs/librispeech/ASR/local/compute_fbank_librispeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -91,7 +91,7 @@ def compute_fbank_librispeech():
# when an executor is specified, make more partitions
num_jobs=num_jobs if ex is None else 80,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
cut_set.to_file(output_dir / cuts_filename)

Expand Down
4 changes: 2 additions & 2 deletions egs/librispeech/ASR/local/compute_fbank_musan.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig, combine
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter, combine
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -92,7 +92,7 @@ def compute_fbank_musan():
storage_path=f"{output_dir}/musan_feats",
num_jobs=num_jobs if ex is None else 80,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
)
musan_cuts.to_file(musan_cuts_path)
Expand Down
4 changes: 2 additions & 2 deletions egs/spgispeech/ASR/local/compute_fbank_musan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, combine
from lhotse import CutSet, LilcomChunkyWriter, combine
from lhotse.features.kaldifeat import (
KaldifeatFbank,
KaldifeatFbankConfig,
Expand Down Expand Up @@ -91,7 +91,7 @@ def compute_fbank_musan():
storage_path=output_dir / "feats_musan",
batch_duration=500,
num_workers=4,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
)

Expand Down
6 changes: 3 additions & 3 deletions egs/spgispeech/ASR/local/compute_fbank_spgispeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, load_manifest_lazy
from lhotse import LilcomChunkyWriter, load_manifest_lazy
from lhotse.features.kaldifeat import (
KaldifeatFbank,
KaldifeatFbankConfig,
Expand Down Expand Up @@ -118,7 +118,7 @@ def compute_fbank_spgispeech(args):
storage_path=output_dir / f"feats_train_{idx}",
batch_duration=500,
num_workers=4,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
cs.to_file(cuts_train_idx_path)

Expand All @@ -137,7 +137,7 @@ def compute_fbank_spgispeech(args):
manifest_path=src_dir / f"cuts_{partition}.jsonl.gz",
batch_duration=500,
num_workers=4,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)


Expand Down
4 changes: 2 additions & 2 deletions egs/tedlium3/ASR/local/compute_fbank_tedlium.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -89,7 +89,7 @@ def compute_fbank_tedlium():
# when an executor is specified, make more partitions
num_jobs=cur_num_jobs,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
# Split long cuts into many short and un-overlapping cuts
cut_set = cut_set.trim_to_supervisions(keep_overlapping=False)
Expand Down
4 changes: 2 additions & 2 deletions egs/timit/ASR/local/compute_fbank_timit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -88,7 +88,7 @@ def compute_fbank_timit():
# when an executor is specified, make more partitions
num_jobs=num_jobs if ex is None else 80,
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
cut_set.to_file(cuts_file)

Expand Down
4 changes: 2 additions & 2 deletions egs/wenetspeech/ASR/local/compute_fbank_wenetspeech_splits.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

import torch
from lhotse import (
ChunkedLilcomHdf5Writer,
CutSet,
KaldifeatFbank,
KaldifeatFbankConfig,
LilcomChunkyWriter,
set_audio_duration_mismatch_tolerance,
set_caching_enabled,
)
Expand Down Expand Up @@ -135,7 +135,7 @@ def compute_fbank_wenetspeech_splits(args):
storage_path=f"{output_dir}/feats_{subset}_{idx}",
num_workers=args.num_workers,
batch_duration=args.batch_duration,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)

logging.info("About to split cuts into smaller chunks.")
Expand Down
4 changes: 2 additions & 2 deletions egs/yesno/ASR/local/compute_fbank_yesno.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pathlib import Path

import torch
from lhotse import ChunkedLilcomHdf5Writer, CutSet, Fbank, FbankConfig
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter
from lhotse.recipes.utils import read_manifests_if_cached

from icefall.utils import get_executor
Expand Down Expand Up @@ -74,7 +74,7 @@ def compute_fbank_yesno():
# when an executor is specified, make more partitions
num_jobs=num_jobs if ex is None else 1, # use one job
executor=ex,
storage_type=ChunkedLilcomHdf5Writer,
storage_type=LilcomChunkyWriter,
)
cut_set.to_file(cuts_file)

Expand Down

0 comments on commit ed66877

Please sign in to comment.