Fix for style check

This commit is contained in:
yifanyang 2023-02-02 17:51:08 +08:00
parent c3e01e141f
commit 76eee0ee80
3 changed files with 3 additions and 2 deletions

View File

@ -609,7 +609,7 @@ def greedy_search(
else:
sym_per_frame = 0
t += 1
hyp = hyp[context_size :] # remove blanks
hyp = hyp[context_size:] # remove blanks
if not return_timestamps:
return hyp

View File

@ -126,7 +126,7 @@ class Decoder(nn.Module):
embedding_out = self.embedding(y.clamp(min=0)) * (y >= 0).unsqueeze(-1)
if self.context_size > 1:
embedding_out = embedding_out.permute(0, 2, 1)
if need_pad is True:
if need_pad is True:
embedding_out = F.pad(embedding_out, pad=(self.context_size - 1, 0))
else:
# During inference time, there is no need to do extra padding

View File

@ -52,6 +52,7 @@ from icefall.utils import (
)
from lhotse.cut import Cut
def get_parser():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter