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 truncated words list when the replacement character is decoded #1089

Merged
merged 1 commit into from
Mar 14, 2023
Merged

Fix truncated words list when the replacement character is decoded #1089

merged 1 commit into from
Mar 14, 2023

Conversation

guillaumekln
Copy link
Contributor

The current version of method split_tokens_on_unicode keeps aggregating tokens while the decoded sequence contains the replacement character �.

However, the model can sometimes produce invalid sequences which would be decoded to the replacement character (for example in the temperature fallback). In this case we should include the replacement character in the list of words.

In this PR I propose to save the replacement character if it appears at the same position in the fully decoded sequence.

@jongwook
Copy link
Collaborator

Thanks! Great catches

@jongwook jongwook merged commit 5f9ac65 into openai:main Mar 14, 2023
@guillaumekln guillaumekln deleted the fix-truncated-word-list branch March 14, 2023 16:35
zackees pushed a commit to zackees/whisper that referenced this pull request May 5, 2023
ilanit1997 pushed a commit to ilanit1997/whisper that referenced this pull request May 16, 2023
abyesilyurt pushed a commit to abyesilyurt/whisper that referenced this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants