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] Deprecate forced ids for v4.39 #29485

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

sanchit-gandhi
Copy link
Contributor

@sanchit-gandhi sanchit-gandhi commented Mar 6, 2024

What does this PR do?

Supersedes #29433 by deprecating forced decoder ids in preparation for the v4.39 release. The full Whisper CI was run with these changes, where it was confirmed all slow tests passed.

cc @zucchini-nlp @ArthurZucker (and also @gante for generation)

Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the cleanup! 🧼

For a follow-up PR: should we also deprecate ForceTokensLogitsProcessor and its usage? Or is it still used in other places?

@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.

@sanchit-gandhi
Copy link
Contributor Author

sanchit-gandhi commented Mar 6, 2024

Indeed - Whisper was the only model to use this processor, so we should now deprecate it. Note that since the ForceTokensLogitsProcessor is importable from Transformers as a public class, and given there is currently no deprecation warning, we need to do this in 2-stages again: first with a FutureWarning explaining that this processor will be removed in v4.40, and second with a hard error.

from transformers.generation.logits_process import ForceTokensLogitsProcessor

force_token_map = {1: 2, 3: 2}
logits_processor = ForceTokensLogitsProcessor(force_token_map)

c.f. #29487 for the first stage of deprecation

@zucchini-nlp
Copy link
Member

Great, thanks! I did not know that the it will be deprecated this soon 😅

@sanchit-gandhi sanchit-gandhi merged commit 4afead8 into huggingface:main Mar 13, 2024
18 checks passed
@sanchit-gandhi sanchit-gandhi deleted the whisper-forced-ids branch March 13, 2024 14:17
itazap pushed a commit that referenced this pull request May 14, 2024
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.

5 participants