format code

pull/947/head
Hui Zhang 3 years ago
parent 0730368e5d
commit 9a45a75ae5

@ -189,7 +189,6 @@ class DeepSpeech2Trainer(Trainer):
self.lr_scheduler = lr_scheduler
logger.info("Setup optimizer/lr_scheduler!")
def setup_dataloader(self):
config = self.config.clone()
config.defrost()

@ -53,8 +53,8 @@ def batch_text_id(minibatch, pad_id=0, dtype=np.int64):
peek_example = minibatch[0]
assert len(peek_example.shape) == 1, "text example is an 1D tensor"
lengths = [example.shape[0] for example in minibatch
] # assume (channel, n_samples) or (n_samples, )
lengths = [example.shape[0] for example in
minibatch] # assume (channel, n_samples) or (n_samples, )
max_len = np.max(lengths)
batch = []

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

Loading…
Cancel
Save