This is a version of
openai/whisper-large-v3-turbo model without number tokens (token ids corresponding to numbers are excluded).
NO fine-tuning was used.
Phrases with spoken numbers will be transcribed with numbers as words. It can be useful for TTS data preparation.
1>>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
2>>> import torchaudio
3
4>>> # load audio
5>>> wav, sr = torchaudio.load("audio.wav")
6
7>>> # load model and processor
8>>> processor = WhisperProcessor.from_pretrained("waveletdeboshir/whisper-large-v3-turbo-no-numbers")
9>>> model = WhisperForConditionalGeneration.from_pretrained("waveletdeboshir/whisper-large-v3-turbo-no-numbers")
10
11>>> input_features = processor(wav[0], sampling_rate=sr, return_tensors="pt").input_features
12
13>>> # generate token ids
14>>> predicted_ids = model.generate(input_features)
15>>> # decode token ids to text
16>>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens=False)
17['<|startoftranscript|><|en|><|transcribe|><|notimestamps|> Twenty seven years. <|endoftext|>']
18
The context tokens can be removed from the start of the transcription by setting skip_special_tokens=True.