format code

pull/970/head
Hui Zhang 3 years ago
parent f9221b4b74
commit 7ceef6c3f5

@ -13,7 +13,7 @@ bc flac jq vim tig tree pkg-config libsndfile1 libflac-dev libvorbis-dev libboos
``` ```
build-essential cmake libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libeigen3-dev zlib1g-dev libbz2-dev liblzma-dev gcc-5 g++-5 build-essential cmake libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libeigen3-dev zlib1g-dev libbz2-dev liblzma-dev gcc-5 g++-5
``` ```
### The dependencies of sox: ### The dependencies of sox:
``` ```
@ -25,7 +25,7 @@ libvorbis-dev libmp3lame-dev libmad-ocaml-dev
``` ```
kenlm kenlm
sox sox
mfa mfa
openblas openblas
kaldi kaldi

@ -554,10 +554,11 @@ class U2Tester(U2Trainer):
@paddle.no_grad() @paddle.no_grad()
def align(self): def align(self):
ctc_utils.ctc_align(self.config, ctc_utils.ctc_align(self.config, self.model, self.align_loader,
self.model, self.align_loader, self.config.decoding.batch_size, self.config.decoding.batch_size,
self.align_loader.collate_fn.stride_ms, self.align_loader.collate_fn.stride_ms,
self.align_loader.collate_fn.vocab_list, self.args.result_file) self.align_loader.collate_fn.vocab_list,
self.args.result_file)
def load_inferspec(self): def load_inferspec(self):
"""infer model and input spec. """infer model and input spec.

@ -527,10 +527,11 @@ class U2Tester(U2Trainer):
@paddle.no_grad() @paddle.no_grad()
def align(self): def align(self):
ctc_utils.ctc_align(self.config, ctc_utils.ctc_align(self.config, self.model, self.align_loader,
self.model, self.align_loader, self.config.decoding.batch_size, self.config.decoding.batch_size,
self.align_loader.collate_fn.stride_ms, self.align_loader.collate_fn.stride_ms,
self.align_loader.collate_fn.vocab_list, self.args.result_file) self.align_loader.collate_fn.vocab_list,
self.args.result_file)
def load_inferspec(self): def load_inferspec(self):
"""infer model and input spec. """infer model and input spec.

@ -543,10 +543,10 @@ class U2STTester(U2STTrainer):
@paddle.no_grad() @paddle.no_grad()
def align(self): def align(self):
ctc_utils.ctc_align(self.config, ctc_utils.ctc_align(self.config, self.model, self.align_loader,
self.model, self.align_loader, self.config.decoding.batch_size, self.config.decoding.batch_size,
self.config.collator.stride_ms, self.config.collator.stride_ms, self.vocab_list,
self.vocab_list, self.args.result_file) self.args.result_file)
def load_inferspec(self): def load_inferspec(self):
"""infer model and input spec. """infer model and input spec.

@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# Modified from wenet(https://github.com/wenet-e2e/wenet) # Modified from wenet(https://github.com/wenet-e2e/wenet)
from typing import List
from pathlib import Path from pathlib import Path
from typing import List
import numpy as np import numpy as np
import paddle import paddle

@ -67,19 +67,16 @@ class LJSpeechCollector(object):
# Sort by text_len in descending order # Sort by text_len in descending order
texts = [ texts = [
i i for i, _ in sorted(
for i, _ in sorted(
zip(texts, text_lens), key=lambda x: x[1], reverse=True) zip(texts, text_lens), key=lambda x: x[1], reverse=True)
] ]
mels = [ mels = [
i i for i, _ in sorted(
for i, _ in sorted(
zip(mels, text_lens), key=lambda x: x[1], reverse=True) zip(mels, text_lens), key=lambda x: x[1], reverse=True)
] ]
mel_lens = [ mel_lens = [
i i for i, _ in sorted(
for i, _ in sorted(
zip(mel_lens, text_lens), key=lambda x: x[1], reverse=True) zip(mel_lens, text_lens), key=lambda x: x[1], reverse=True)
] ]

Loading…
Cancel
Save