Views
No views yet
facebook/wav2vec2-xls-r-300m
on the first 50 hours of a Khmer speech corpus using CTC decoding.| Property | Value |
|---|---|
| Base model | facebook/wav2vec2-xls-r-300m |
| Language | Khmer / ភាសាខ្មែរ (km) |
| Task | Automatic Speech Recognition (ASR) |
| Training data | First 50 hours of Khmer audio |
| Input sample rate | 16 kHz, mono |
| Architecture | Wav2Vec2 + CTC head |
| Framework | 🤗 Transformers |
1from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
2import soundfile as sf
3import torch
4
5# Load model
6processor = Wav2Vec2Processor.from_pretrained("Vatho/wav2vec2-khmer-xls-r-50h")
7model = Wav2Vec2ForCTC.from_pretrained("Vatho/wav2vec2-khmer-xls-r-50h")
8model.eval()
9
10# Load audio (must be 16 kHz mono WAV)
11audio, sr = sf.read("your_audio.wav")
12
13# Transcribe
14inputs = processor(audio, sampling_rate=16000, return_tensors="pt")
15with torch.no_grad():
16 logits = model(**inputs).logits
17
18predicted_ids = torch.argmax(logits, dim=-1)
19print(processor.batch_decode(predicted_ids)[0])| Setting | Value |
|---|---|
| Optimizer | AdamW |
| Base learning rate | 3e-4 |
| Batch size | 16 |
| Max steps | 20,000 |
| Warmup steps | 2,000 |
| CTC loss | ✓ |
| Early stopping | ✓ |
1@article{babu2021xls,
2 title = {XLS-R: Self-supervised Cross-lingual Speech Representation Learning at Scale},
3 author = {Babu, Arun and Wang, Changhan and Tjandra, Andros and others},
4 journal = {arXiv preprint arXiv:2111.09296},
5 year = {2021}
6}