mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-08 09:32:20 +00:00
fix initial states (#1398)
Co-authored-by: liujiawang02 <liujiawang02@baidu.com>
This commit is contained in:
parent
0622dea30d
commit
f08af2fa22
@ -82,12 +82,12 @@ class DecodeStream(object):
|
||||
self.pad_length = 7
|
||||
|
||||
if params.decoding_method == "greedy_search":
|
||||
self.hyp = [params.blank_id] * params.context_size
|
||||
self.hyp = [-1] * (params.context_size - 1) + [params.blank_id]
|
||||
elif params.decoding_method == "modified_beam_search":
|
||||
self.hyps = HypothesisList()
|
||||
self.hyps.add(
|
||||
Hypothesis(
|
||||
ys=[params.blank_id] * params.context_size,
|
||||
ys=[-1] * (params.context_size - 1) + [params.blank_id],
|
||||
log_prob=torch.zeros(1, dtype=torch.float32, device=device),
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user