-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Make whisper-event checkpoints compliant to support return_timestamp
#21878
Comments
Well if you are using |
Hey hey! - Sorry I did not do a good job at explaining the intent. For a typical developer who doesn't have any clue of how these checkpoints were fine-tuned and just wants to use a checkpoint on the hub for downstream inference only, this poses a challenge. For them, they'd typically just take a checkpoint throw it into the pipe and expect the pipeline to do its magic - transcribe and provide the timestamps. So my ask here is the following:
IMO point 1 is really important as our library of fine-tuned models is one of the distinguishing factors for us. It'd be less than ideal if we ask the community to have to fine-tune their checkpoints again to be able to get timestamps. Hope this makes more sense! |
For 1. I think we can open a PR on all of the whisper models that are from the event to add the required generation config WDYT? Makes a lot of sense thanks for reporting! 👍🏻 |
Just to be clear, if I add the |
The model should already be able to produce timestamps without finetuning (as it is knowledge from the pretrained model) but might not be as good as the original pretrained model. |
Hey @ArthurZucker -> Can you maybe provide the steps one needs to take to make the checkpoints compatible? We can then potentially run autoPR on all the Whisper checkpoints produced during the whisper-event. |
You can just do something like from transformers import GenerationConfig, WhisperForConditionalGeneration
model = WhisperForConditionalGeneration.from_pretrained("your_pretrained_checkpoint")
generation_config = GenerationConfig.from_pretrained("openai/whisper-base") # if you are using a multilingual model
model.generation_config = generation_config
model.push_to_hub("your_pretrained_checkpoint", use_auth_token = "your_token_if_not_logged_in", create_pr = True) |
Would it not be easier to make changes in the codebase to make it robust to the changes we made to generate (switching to generate config and adding timestamp prediction)? What we have is currently backwards breaking 🚨 and something we want to avoid |
That makes sense, then I'll refrain from the Auto-PR and wait for these changes to be merged into |
The main issue is that the |
I will add it to the |
Edit: I think opening PR to the relevant repositories will help (easier to generate the |
please stop "fixing" things |
still cannot generate timestamp with this setting, i also checked PR #21334 . Is return_timestamps supported now? how could i use it properly? |
I'm also facing the same problem, any ideas? |
System Info
transformers
version: 4.27.0.dev0Who can help?
@sanchit-gandhi @ArthurZucker
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Inferring a Whisper checkpoint fine-tuned before the
TimestampstampProcessor
was introduced into transformers returns a rather un-informed error messageAttributeError: 'GenerationConfig' object has no attribute 'no_timestamps_token_id'
Minimum steps to reproduce this:
Colab/ notebook: here
The above snippet throws an error as mentioned above. This problem effects the majority (727) of the checkpoints fine-tuned during the Whisper Event.
P.S. This has been reported by multiple community members, so not just me.
Expected behavior
We should ideally make the
return_timestamp
functionality backwards compatible or throw a more informative error message.Sorry if there already is a way to do this and I am just misinformed.
The text was updated successfully, but these errors were encountered: