Skip to content

Make whisper-event checkpoints compliant to support return_timestamp #21878

@Vaibhavs10

Description

@Vaibhavs10

System Info

  • transformers version: 4.27.0.dev0
  • Platform: Linux-5.10.147+-x86_64-with-glibc2.29
  • Python version: 3.8.10
  • Huggingface_hub version: 0.12.1
  • PyTorch version (GPU?): 1.13.1+cu116 (False)
  • Tensorflow version (GPU?): 2.11.0 (False)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?: NO
  • Using distributed or parallel set-up in script?: NO

Who can help?

@sanchit-gandhi @ArthurZucker

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Inferring a Whisper checkpoint fine-tuned before the TimestampstampProcessor was introduced into transformers returns a rather un-informed error message AttributeError: 'GenerationConfig' object has no attribute 'no_timestamps_token_id'

Minimum steps to reproduce this:

from transformers.pipelines import AutomaticSpeechRecognitionPipeline, pipeline
from datasets import load_dataset

cv11 = load_dataset("mozilla-foundation/common_voice_11_0", "hi", split="test", streaming=True)

pipe = pipeline(model="sanchit-gandhi/whisper-small-hi", return_timestamps=True)

test_sample = {"raw": next(iter(cv11))["audio"]["array"],
"sampling_rate": next(iter(cv11))["audio"]["sampling_rate"]}

pipe(test_sample)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions