Views
No views yet
| Model Name | Base Model | Training Time | Hugging Face Repository |
|---|---|---|---|
| bella-whisper-large-v3-turbo | whisper-large-v3-turbo | Not Open | N/A |
| bella-whisper-large-v3 | whisper-large-v3 | 20241118 | Link |
| bella-whisper-medium | whisper-medium | Not Open | N/A |
| bella-whisper-small | whisper-small | Not Open | N/A |
| bella-whisper-tiny | whisper-tiny | Not Open | N/A |
1conda create -n bella-whisper python=3.10
2conda activate bella-whisper1pip install --upgrade pip
2pip install --upgrade transformers accelerate torch librosa1import torch
2import librosa
3from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
4
5device = "cuda:0" if torch.cuda.is_available() else "cpu"
6torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
7
8model_id = "bella-top/bella-whisper-large-v3"
9
10# Load model and processor
11model =AutoModelForSpeechSeq2Seq.from_pretrained(
12 model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
13)
14model.to(device)
15
16processor = AutoProcessor.from_pretrained(model_id)
17
18# Create inference pipeline
19pipe = pipeline(
20 "automatic-speech-recognition",
21 model=model,
22 tokenizer=processor.tokenizer,
23 feature_extractor=processor.feature_extractor,
24 torch_dtype=torch_dtype,
25 device=device,
26)
27
28# Load local audio file
29audio_path = "sample1.wav" # Replace with your audio file path
30audio, sample_rate = librosa.load(audio_path, sr=16000) # Ensure sampling rate is 16kHz
31
32# Perform inference using the pipeline
33result = pipe(audio)
34print("Transcription:", result["text"])