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

Update decoding.py #1155

Merged
merged 5 commits into from
Apr 11, 2023
Merged

Update decoding.py #1155

merged 5 commits into from
Apr 11, 2023

Conversation

FernanOrtega
Copy link
Contributor

Following the suggestions of @Jeronymous in #914 and #924, it solves the problem of endless loop.

Following the suggestions of @Jeronymous in openai#914 and openai#924, it solves the problem of endless loop.
FernanOrtega added a commit to FernanOrtega/whisperX that referenced this pull request Mar 27, 2023
New fix for endless loop problem. I also created a PR for official Whisper: openai/whisper#1155

It is explained in openai/whisper#914 and openai/whisper#924
@jongwook
Copy link
Collaborator

Hi, looks like I can't add commits to your branch. Could you delete whitespaces in the two empty lines and also remove the line 17?

@FernanOrtega
Copy link
Contributor Author

Hi, looks like I can't add commits to your branch. Could you delete whitespaces in the two empty lines and also remove the line 17?

Done!

Copy link
Collaborator

@jongwook jongwook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter is being very picky here 😅

timestamp_last = timestamps[-1]
else:
timestamp_last = timestamps[-1] + 1
logits[k, self.tokenizer.timestamp_begin: timestamp_last] = -np.inf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logits[k, self.tokenizer.timestamp_begin: timestamp_last] = -np.inf
logits[k, self.tokenizer.timestamp_begin : timestamp_last] = -np.inf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -14,7 +14,6 @@
if TYPE_CHECKING:
from .model import Whisper


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restore this deleted line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -471,6 +471,13 @@ def apply(self, logits: Tensor, tokens: Tensor):
# timestamps shouldn't decrease; forbid timestamp tokens smaller than the last
logits[k, self.tokenizer.timestamp_begin : timestamps[-1]] = -np.inf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to mention that this line is no longer needed but I'll fix it in a subsequent PR

@jongwook jongwook merged commit b0022b3 into openai:main Apr 11, 2023
@jongwook jongwook mentioned this pull request Apr 11, 2023
MarkusMattinen added a commit to MarkusMattinen/whisper.cpp that referenced this pull request Apr 27, 2023
MarkusMattinen added a commit to MarkusMattinen/whisper.cpp that referenced this pull request Apr 27, 2023
MarkusMattinen added a commit to MarkusMattinen/whisper.cpp that referenced this pull request May 3, 2023
zackees pushed a commit to zackees/whisper that referenced this pull request May 5, 2023
* Update decoding.py

Following the suggestions of @Jeronymous in openai#914 and openai#924, it solves the problem of endless loop.

* Removed blank line and whitespaces in empty lines.

* Suggested changes according to the linter

---------

Co-authored-by: Jong Wook Kim <[email protected]>
ilanit1997 pushed a commit to ilanit1997/whisper that referenced this pull request May 16, 2023
* Update decoding.py

Following the suggestions of @Jeronymous in openai#914 and openai#924, it solves the problem of endless loop.

* Removed blank line and whitespaces in empty lines.

* Suggested changes according to the linter

---------

Co-authored-by: Jong Wook Kim <[email protected]>
MarkusMattinen added a commit to MarkusMattinen/whisper.cpp that referenced this pull request May 30, 2023
MarkusMattinen added a commit to MarkusMattinen/whisper.cpp that referenced this pull request May 30, 2023
abyesilyurt pushed a commit to abyesilyurt/whisper that referenced this pull request Nov 13, 2023
* Update decoding.py

Following the suggestions of @Jeronymous in openai#914 and openai#924, it solves the problem of endless loop.

* Removed blank line and whitespaces in empty lines.

* Suggested changes according to the linter

---------

Co-authored-by: Jong Wook Kim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants