Views
No views yet
openai/whisper-large-v3torch==2.3.1transformers==4.43.01import torch
2from transformers import pipeline
3
4model = torch.load(
5 "model.pth",
6 weights_only=False,
7)
8
9pipe = pipeline(
10 "automatic-speech-recognition",
11 model=model,
12 tokenizer="openai/whisper-large-v3",
13 feature_extractor="openai/whisper-large-v3",
14 device="cuda" if torch.cuda.is_available() else "cpu"
15)
16
17audio_paths = [
18 "example1.wav",
19 "example2.wav"
20]
21
22for audio_path in audio_paths:
23 result = pipe(audio_path)
24 print(f"Audio: {audio_paths}")
25 print(f"Transcription: {result['text']}")