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

[Whisper] Pipeline: handle long form generation #35750

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

eustlb
Copy link
Contributor

@eustlb eustlb commented Jan 17, 2025

What does this PR do?

Fixes #34210 #31942

In the tokenizer decoding logic for the pipeline, timestamp offsetting when the call to Whisper's generate have seeking (meaning generating for a new segment).

TODO

  • make sure the edge cases are correctly handled: what about chunk_length_s=60 e.g. ? → actually Whisper just should not be used with chunk_length_s set! Added a warning

@eustlb eustlb marked this pull request as ready for review January 17, 2025 13:52
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

It's missing a test IMO! 🤗

Comment on lines +306 to +309
elif self.type == "seq2seq_whisper" and not ignore_warning:
logger.warning(
"Using `chunk_length_s` with Whisper models is not recommended and will result in unreliable results, as it uses it's own chunking mechanism "
"(cf. Whisper original paper, section 3.8. Long-form Transcription)."
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I mentioned offline would be a pity to not use that batch algo in some cases! But up to debate!

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.

Missing timestamp offset using Whisper with pipeline and sequential decoding
3 participants