Views
No views yet
1from transformers import WhisperForConditionalGeneration, WhisperProcessor, pipeline
2
3processor = WhisperProcessor.from_pretrained("Shagufta/whisper-small-km-indomain5-withoutac")
4model = WhisperForConditionalGeneration.from_pretrained("Shagufta/whisper-small-km-indomain5-withoutac")
5
6pipe = pipeline("automatic-speech-recognition", model=model, tokenizer=processor.tokenizer, feature_extractor=processor.feature_extractor)
7result = pipe("audio.wav")
8print(result["text"])