Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alignment between the segments and the list of words #1087

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Ensure the word index does not overflow
  • Loading branch information
guillaumekln committed Mar 13, 2023
commit be8e726c9029dd3ebb0fb8df38778ac0b063017a
2 changes: 1 addition & 1 deletion whisper/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def add_word_timestamps(
saved_tokens = 0
words = []

while saved_tokens < len(text_tokens):
while word_index < len(alignment) and saved_tokens < len(text_tokens):
timing = alignment[word_index]

if timing.word:
Expand Down