CoolFace
Modelpublic

kingabzpro/wav2vec2-large-xls-r-1b-Irish

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
1likes20downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

wav2vec2-large-xls-r-1b-Irish

This model is a fine-tuned version of facebook/wav2vec2-xls-r-1b on the common_voice dataset. It achieves the following results on the evaluation set:

  • —Loss: 1.3599
  • —Wer: 0.4236
  • —Cer: 0.1768
Evaluation Commands
  1. 1.To evaluate on mozilla-foundation/common_voice_8_0 with split test
bash
python eval.py --model_id kingabzpro/wav2vec2-large-xls-r-1b-Irish --dataset mozilla-foundation/common_voice_8_0 --config ga-IE --split test

Inference With LM

python
import torch
from datasets import load_dataset
from transformers import AutoModelForCTC, AutoProcessor
import torchaudio.functional as F
model_id = "kingabzpro/wav2vec2-large-xls-r-1b-Irish"
sample_iter = iter(load_dataset("mozilla-foundation/common_voice_8_0", "ga-IE", split="test", streaming=True, use_auth_token=True))
sample = next(sample_iter)
resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), 48_000, 16_000).numpy()
model = AutoModelForCTC.from_pretrained(model_id)
processor = AutoProcessor.from_pretrained(model_id)
input_values = processor(resampled_audio, return_tensors="pt").input_values
with torch.no_grad():
    logits = model(input_values).logits
transcription = processor.batch_decode(logits.numpy()).text

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 7.5e-05
  • —trainbatchsize: 32
  • —evalbatchsize: 8
  • —seed: 42
  • —gradientaccumulationsteps: 4
  • —totaltrainbatch_size: 128
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —lrschedulerwarmup_steps: 200
  • —num_epochs: 100
  • —mixedprecisiontraining: Native AMP

Training results

Training LossEpochStepValidation LossWerCer
6.395512.481002.98971.01.0
2.381124.972001.23040.71400.3106
1.047637.483001.06610.55970.2407
0.701449.974001.17880.47990.1947
0.440962.485001.26490.46580.1997
0.483974.976001.32590.44500.1868
0.364387.487001.35060.43120.1760
0.346899.978001.35990.42360.1768

Framework versions

  • —Transformers 4.17.0.dev0
  • —Pytorch 1.10.2+cu102
  • —Datasets 1.18.2.dev0
  • —Tokenizers 0.11.0