Skip to content

Commit

Permalink
Fix decode_stream.py (#1208)
Browse files Browse the repository at this point in the history
* FIx decode_stream.py

* Update decode_stream.py
  • Loading branch information
yfyeung authored Aug 9, 2023
1 parent 1ee251c commit 00256a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions egs/librispeech/ASR/zipformer/decode_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def __init__(
self.pad_length = 7 + 2 * 3

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),
)
)
Expand Down

0 comments on commit 00256a7

Please sign in to comment.