mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-10 10:32:17 +00:00
Fix for style check
This commit is contained in:
parent
c3e01e141f
commit
76eee0ee80
@ -609,7 +609,7 @@ def greedy_search(
|
|||||||
else:
|
else:
|
||||||
sym_per_frame = 0
|
sym_per_frame = 0
|
||||||
t += 1
|
t += 1
|
||||||
hyp = hyp[context_size :] # remove blanks
|
hyp = hyp[context_size:] # remove blanks
|
||||||
|
|
||||||
if not return_timestamps:
|
if not return_timestamps:
|
||||||
return hyp
|
return hyp
|
||||||
|
@ -126,7 +126,7 @@ class Decoder(nn.Module):
|
|||||||
embedding_out = self.embedding(y.clamp(min=0)) * (y >= 0).unsqueeze(-1)
|
embedding_out = self.embedding(y.clamp(min=0)) * (y >= 0).unsqueeze(-1)
|
||||||
if self.context_size > 1:
|
if self.context_size > 1:
|
||||||
embedding_out = embedding_out.permute(0, 2, 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))
|
embedding_out = F.pad(embedding_out, pad=(self.context_size - 1, 0))
|
||||||
else:
|
else:
|
||||||
# During inference time, there is no need to do extra padding
|
# During inference time, there is no need to do extra padding
|
||||||
|
@ -52,6 +52,7 @@ from icefall.utils import (
|
|||||||
)
|
)
|
||||||
from lhotse.cut import Cut
|
from lhotse.cut import Cut
|
||||||
|
|
||||||
|
|
||||||
def get_parser():
|
def get_parser():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user