Skip to content

Commit

Permalink
Update decoding.py (openai#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwook authored Apr 11, 2023
1 parent b0022b3 commit c09a7ae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions whisper/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ def apply(self, logits: Tensor, tokens: Tensor):
]
if timestamps.numel() > 0:
# timestamps shouldn't decrease; forbid timestamp tokens smaller than the last
logits[k, self.tokenizer.timestamp_begin : timestamps[-1]] = -np.inf

# to force that timestamps are strictly increasing
# also force each segment to have a nonzero length, to prevent infinite looping
if last_was_timestamp and not penultimate_was_timestamp:
timestamp_last = timestamps[-1]
else:
Expand Down

0 comments on commit c09a7ae

Please sign in to comment.