Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 14, 2024
1 parent eea2012 commit e840295
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions espnet2/train/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,9 @@ def _speech_process(
volume_scale = self.volume_low
ma = np.max(np.abs(data[self.speech_name]))
if ma != 0:
self._apply_to_all_signals(data, lambda x: x * volume_scale / ma, num_spk)
self._apply_to_all_signals(
data, lambda x: x * volume_scale / ma, num_spk
)

if self.categories and "category" in data:
category = data.pop("category")
Expand Down Expand Up @@ -1534,7 +1536,9 @@ def __call__(
singing = data[self.singing_name]
ma = np.max(np.abs(singing))
if ma != 0:
data[self.singing_name] = singing * self.singing_volume_normalize / ma
data[self.singing_name] = (
singing * self.singing_volume_normalize / ma
)

if self.midi_name in data and self.label_name in data:
# Load label info
Expand Down

0 comments on commit e840295

Please sign in to comment.