CoolFace
Modelpublic

anuragshas/wav2vec2-xls-r-300m-mt-cv8-with-lm

sourceHugging Faceapache-2.0updated 5y agoView on Hugging Face
0likes106downloads
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. -->

XLS-R-300M - Maltese

This model is a fine-tuned version of facebook/wav2vec2-xls-r-300m on the MOZILLA-FOUNDATION/COMMONVOICE8_0 - MT dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.1895
  • —Wer: 0.1984

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 7.5e-05
  • —trainbatchsize: 32
  • —evalbatchsize: 16
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —lrschedulerwarmup_steps: 1000
  • —num_epochs: 60.0
  • —mixedprecisiontraining: Native AMP

Training results

Training LossEpochStepValidation LossWer
3.42193.64003.31271.0
3.03997.218003.03301.0
1.575610.8112000.61080.5724
1.099514.4116000.30910.3154
0.963918.0220000.25960.2841
0.903221.6224000.22700.2514
0.814525.2328000.21720.2483
0.784528.8332000.20840.2333
0.769432.4336000.19740.2234
0.733336.0440000.20200.2185
0.69339.6444000.19470.2148
0.680243.2448000.19600.2102
0.66746.8552000.19040.2072
0.648650.4556000.18810.2009
0.633954.0560000.18770.1989
0.625457.6664000.18930.2003

Framework versions

  • —Transformers 4.17.0.dev0
  • —Pytorch 1.10.2+cu102
  • —Datasets 1.18.2.dev0
  • —Tokenizers 0.11.0
Evaluation Commands
  1. 1.To evaluate on mozilla-foundation/common_voice_8_0 with split test
bash
python eval.py --model_id anuragshas/wav2vec2-xls-r-300m-mt-cv8-with-lm --dataset mozilla-foundation/common_voice_8_0 --config mt --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 = "anuragshas/wav2vec2-xls-r-300m-mt-cv8-with-lm"
sample_iter = iter(load_dataset("mozilla-foundation/common_voice_8_0", "mt", 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
# => "għadu jilagħbu ċirku tant bilfondi"

Eval results on Common Voice 8 "test" (WER):

Without LMWith LM (run `./eval.py`)
19.85315.967