Skip to content

Commit

Permalink
Merge pull request #3433 from wanghuancoder/fix_view_confict
Browse files Browse the repository at this point in the history
fix develop view confict with model's
  • Loading branch information
zh794390558 committed Aug 14, 2023
2 parents a174594 + 790f183 commit 17854a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddlespeech/s2t/models/wav2vec2/wav2vec2_ASR.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def ctc_greedy_search(self, wav) -> List[List[int]]:
x_lens = x.shape[1]
ctc_probs = self.ctc.log_softmax(x) # (B, maxlen, vocab_size)
topk_prob, topk_index = ctc_probs.topk(1, axis=2) # (B, maxlen, 1)
topk_index = topk_index.view(batch_size, x_lens) # (B, maxlen)
topk_index = topk_index.view([batch_size, x_lens]) # (B, maxlen)

hyps = [hyp.tolist() for hyp in topk_index]
hyps = [remove_duplicates_and_blank(hyp) for hyp in hyps]
Expand Down

0 comments on commit 17854a0

Please sign in to comment.