-
Notifications
You must be signed in to change notification settings - Fork 32k
Fix Whisper Conversion Script: Correct decoder_attention_heads and _download function #26834
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
Merged
ArthurZucker
merged 14 commits into
huggingface:main
from
zuazo-forks:convert_openai_to_hf-fix
Nov 7, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ae38b19
Fix error in convert_openai_to_hf.py: "_download() missing 1 required…
zuazo d246584
Fix error in convert_openai_to_hf.py: "TypeError: byte indices must b…
zuazo 479e8f7
Fix decoder_attention_heads value in convert_openai_to_hf.py.
zuazo a5c1cee
Black reformat convert_openai_to_hf.py file.
zuazo 769da1a
Fix Whisper model configuration defaults (for Tiny).
zuazo df384c1
Add docstring to the convert_openai_to_hf.py script with a doctest
zuazo 1bea0b0
Add shebang and +x permission to the convert_openai_to_hf.py
zuazo adf8608
convert_openai_to_hf.py: reuse the read model_bytes in the _download(…
zuazo 2ddddd6
Move convert_openai_to_hf.py doctest example to whisper.md
zuazo dacfee7
whisper.md: Add an inference example to the Conversion section.
zuazo 763d56b
whisper.md: remove `model.config.forced_decoder_ids` from examples (d…
zuazo bdde5c4
whisper.md: Remove "## Format Conversion" section; not used by users
zuazo 722c57a
whisper.md: Use librispeech_asr_dummy dataset and load_dataset()
zuazo b1862fa
Merge branch 'main' into convert_openai_to_hf-fix
zuazo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised we managed to convert the original checkpoints with this bug @ArthurZucker 🤔 The state dicts surely won't have matched? Maybe we hardcoded this before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I think I hardcoded the values when converting and then later on made it automatic. I checked by actually re-running the script and seeing that this was a nice type 🤣 but good sign that no one else tried to convert the checkpoints !
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the history behind this. But looking at the
blame, the script was correct once:transformers/src/transformers/models/whisper/convert_openai_whisper_to_tfms.py
Line 99 in a6361d4
Then it was deleted and recovered in: #20600
That's where the problem seems to come from. So the original script you used may have worked properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice digging! Yep I think I uploaded an old version late by a few commits