Instructions to use beabucayan/lingkodai-whisper-fil with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use beabucayan/lingkodai-whisper-fil with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="beabucayan/lingkodai-whisper-fil")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("beabucayan/lingkodai-whisper-fil") model = AutoModelForSpeechSeq2Seq.from_pretrained("beabucayan/lingkodai-whisper-fil", device_map="auto") - Notebooks
- Google Colab
- Kaggle
LingkodAI Whisper: Filipino
Speech-to-text for Filipino, fine-tuned from openai/whisper-medium with only the decoder trained. It transcribes queries identified as Filipino by the audio-based language identification stage of the LingkodAI pipeline.
How it works
Filipino uses Whisper's built-in Tagalog language token (<|tl|>), so no new tokens were added. The encoder was kept frozen, so it is identical to the original whisper-medium encoder.
Training data
Filipino read speech from the Philippine Languages Database (PLD), resampled to 16 kHz, with a speaker-independent train/validation/test split.
Usage
Set the language to "tagalog" so Whisper doesn't guess the language on its own.
import torch, librosa
from transformers import WhisperProcessor, WhisperForConditionalGeneration
repo = "lingkodai/lingkodai-whisper-fil"
device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.float16 if device == "cuda" else torch.float32
processor = WhisperProcessor.from_pretrained(repo, language="tagalog", task="transcribe")
model = WhisperForConditionalGeneration.from_pretrained(repo, dtype=dtype).to(device).eval()
model.generation_config.forced_decoder_ids = processor.get_decoder_prompt_ids(language="tagalog", task="transcribe")
audio, _ = librosa.load("clip.wav", sr=16000)
features = processor.feature_extractor(audio, sampling_rate=16000, return_tensors="pt").input_features.to(device, dtype=dtype)
with torch.no_grad():
ids = model.generate(features, max_length=225)
print(processor.tokenizer.batch_decode(ids, skip_special_tokens=True)[0].strip())
- Downloads last month
- 4
Model tree for beabucayan/lingkodai-whisper-fil
Base model
openai/whisper-medium