Closed PeterGilles closed 1 year ago
cc @sanchit-gandhi
Hey @PeterGilles! Sorry about the delayed reply. Cool to see that you're using the diarization pipeline! May I ask what version of transformers
you're using? You can retrieve this with the command:
transformers-cli env
Hi @sanchit-gandhi I get the same issue when using a fine-tuned model. A standard model like openai/whisper-medium works fine but a fine-tuned seems to be missing some attributes. The model is fine-tuned like in the Whisper event.
These attributes seems to be needed for it to work: model.generation_config.no_timestamps_token_id = 50363 model.generation_config.forced_decoder_ids = [[1, None], [2, 50359]] model.generation_config.max_initial_timestamp_index = 1
Tested with transformers version: 4.27.0.dev0
The issue is the same here so it is not specific to ASRDiarizationPipeline: pipe = pipeline(task="automatic-speech-recognition"
I'm getting the same issue: Transformers version: 4.27.0.dev0
File transformers/generation/logits_process.py:935, in WhisperTimeStampLogitsProcessor.init(self, generate_config)
AttributeError: 'GenerationConfig' object has no attribute 'no_timestamps_token_id'
self.no_timestamps_token_id = generate_config.no_timestamps_token_id
Is this the cause of the issue? https://github.com/huggingface/transformers/issues/21220
Indeed, the first point on that issue seems to be the cause of the problem!
I think @bjelkenhed's fix is the quickest here. Otherwise, if you want to copy a pre-trained Whisper generation config one-for-one, you could load a generation config from pre-trained:
from transformers import GenerationConfig
generation_config = GenerationConfig.from_pretrained("openai/whisper-tiny")
And then push it to your model repo:
generation_config.push_to_hub("hf_id/my_model_name")
Thanks, this fix is working for me too now.
Awesome! Closing this issue as fixed 🤗
When using a fine-tuned Whisper model, running
ASRDiarizationPipeline
throws an error: