Skip to content

Commit ddc52d5

Browse files
committed
Fix black
1 parent 737125f commit ddc52d5

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

egs/wenetspeech/ASR/local/prepare_dataset_from_kaldi_dir.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
import torch
2222
import lhotse
2323
from pathlib import Path
24-
from lhotse import CutSet, Fbank, FbankConfig, LilcomChunkyWriter, fix_manifests, validate_recordings_and_supervisions
24+
from lhotse import (
25+
CutSet,
26+
Fbank,
27+
FbankConfig,
28+
LilcomChunkyWriter,
29+
fix_manifests,
30+
validate_recordings_and_supervisions,
31+
)
2532
from icefall.utils import get_executor, str2bool
2633

2734
# Torch's multithreaded behavior needs to be disabled or
@@ -31,6 +38,7 @@
3138
torch.set_num_threads(1)
3239
torch.set_num_interop_threads(1)
3340

41+
3442
def get_args():
3543
parser = argparse.ArgumentParser()
3644

@@ -79,10 +87,7 @@ def get_args():
7987
)
8088

8189
parser.add_argument(
82-
"--num-jobs",
83-
type=int,
84-
default=50,
85-
help="The num of jobs to extract feature."
90+
"--num-jobs", type=int, default=50, help="The num of jobs to extract feature."
8691
)
8792

8893
return parser.parse_args()
@@ -109,11 +114,7 @@ def compute_feature(args, cuts):
109114
if "train" in args.partition:
110115
if args.perturb_speed:
111116
logging.info(f"Doing speed perturb")
112-
cuts = (
113-
cuts
114-
+ cuts.perturb_speed(0.9)
115-
+ cuts.perturb_speed(1.1)
116-
)
117+
cuts = cuts + cuts.perturb_speed(0.9) + cuts.perturb_speed(1.1)
117118
cuts = cuts.compute_and_store_features(
118119
extractor=extractor,
119120
storage_path=f"{args.output_dir}/{args.dataset}_feats_{args.partition}",
@@ -132,7 +133,7 @@ def main(args):
132133
compute_feature(args, cuts)
133134

134135

135-
if __name__ == '__main__':
136+
if __name__ == "__main__":
136137
formatter = "%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s"
137138

138139
logging.basicConfig(format=formatter, level=logging.INFO)

0 commit comments

Comments
 (0)