You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the Whisper3 model to transcribe several audio files. However, the output I am getting is in the form of a tensor. I would like to obtain text chunks with corresponding start and end timestamps instead. Can someone please assist me in achieving this desired output using the available method? I get the desired output if I make use of pipeline with "AutoModelForSpeechSeq2Seq" class instead of "WhisperForConditionalGeneration" like below.
from transformers import WhisperForConditionalGeneration, AutoProcessor
processor = AutoProcessor.from_pretrained("openai/whisper-large-v3")
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v3")
audio, sr = librosa.load(audio,sr=16000)
inputs = processor(audio, return_tensors="pt", truncation=False, padding="longest", return_attention_mask=True, sampling_rate=sr)
result = model.generate(**inputs)
decoded = processor.batch_decode(result, skip_special_tokens=True)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the Whisper3 model to transcribe several audio files. However, the output I am getting is in the form of a tensor. I would like to obtain text chunks with corresponding start and end timestamps instead. Can someone please assist me in achieving this desired output using the available method? I get the desired output if I make use of pipeline with "AutoModelForSpeechSeq2Seq" class instead of "WhisperForConditionalGeneration" like below.
Beta Was this translation helpful? Give feedback.
All reactions