Model reference · open weights
asr-wav2vec2-ctc-french is an open-weight audio or speech model from bofenghuang. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | bofenghuang |
|---|---|
| Type | Audio & music |
| Task | Speech→text |
| Parameters (lead) | 315M |
| Runs with | transformers |
| Released | 2022-11-25 |
| Popularity | 2k downloads / month |
| Licence | Open weights |
About
img { display: inline; }
This model is a fine-tuned version of LeBenchmark/wav2vec2-FR-7K-large, trained on a composite dataset comprising of over 2200 hours of French speech audio, using the train and validation splits of Common Voice 11.0, Multilingual LibriSpeech, Voxpopuli, Multilingual TEDx, MediaSpeech, and African Accented French. When using the model make sure that your speech input is also sampled at 16Khz.
import torch
import torchaudio
from transformers import AutoModelForCTC, Wav2Vec2ProcessorWithLM
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = AutoModelForCTC.from_pretrained("bhuang/asr-wav2vec2-french").to(device)
processor_with_lm = Wav2Vec2ProcessorWithLM.from_pretrained("bhuang/asr-wav2vec2-french")
model_sample_rate = processor_with_lm.feature_extractor.sampling_rate
wav_path = "example.wav" # path to your audio file
waveform, sample_rate = torchaudio.load(wav_path)
waveform = waveform.squeeze(axis=0) # mono
# resample
if sample_rate != model_sample_rate:
resampler = torchaudio.transforms.Resample(sample_rate, model_sample_rate)
waveform = resampler(waveform)
# normalize
input_dict = processor_with_lm(waveform, sampling_rate=model_sample_rate, return_tensors="pt")
with torch.inference_mode():
logits = model(input_dict.input_values.to(device)).logits
predicted_sentence = processor_with_lm.batch_decode(logits.cpu().numpy()).text[0]
import torch
import torchaudio
from transformers import AutoModelForCTC, Wav2Vec2Processor
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = AutoModelForCTC.from_pretrained("bhuang/asr-wav2vec2-french").to(device)
processor = Wav2Vec2Processor.from_pretrained("bhuang/asr-wav2vec2-french")
model_sample_rate = processor.feature_extractor.sampling_rate
wav_path = "example.wav" # path to your audio file
waveform, sample_rate = torchaudio.load(wav_path)
waveform = waveform.squeeze(axis=0) # mono
# resample
if sample_rate != model_sample_rate:
resampler = torchaudio.transforms.Resample(sample_rate, model_sample_rate)
waveform = resampler(waveform)
# normalize
input_dict = processor(waveform, sampling_rate=model_sample_rate, return_tensors="pt")
with torch.inference_mode():
logits = model(input_dict.input_values.to(device)).logits
# decode
predicted_ids = torch.argmax(logits, dim=-1)
predicted_sentence = processor.batch_decode(predicted_ids)[0]
mozilla-foundation/common_voice_11_0python eval.py \
--model_id "bhuang/asr-wav2vec2-french" \
--dataset "mozilla-foundation/common_voice_11_0" \
--config "fr" \
--split "test" \
--log_outputs \
--outdir "outputs/results_mozilla-foundatio_common_voice_11_0_with_lm"
speech-recognition-community-v2/dev_datapython eval.py \
--model_id "bhuang/asr-wav2vec2-french" \
--dataset "speech-recognition-community-v2/dev_data" \
--config "fr" \
--split "validation" \
--chunk_length_s 30.0 \
--stride_length_s 5.0 \
--log_outputs \
--outdir "outputs/results_speech-recognition-community-v2_dev_data_with_lm"
From the published model card. Full card on the HuggingFace links in the sidebar.
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Automatic Speech Recognition | Common Voice 11.0 | Test WER | 11.440 |
| Automatic Speech Recognition | Common Voice 11.0 | Test WER (+LM) | 9.660 |
| Automatic Speech Recognition | Multilingual LibriSpeech (MLS) | Test WER | 5.930 |
| Automatic Speech Recognition | Multilingual LibriSpeech (MLS) | Test WER (+LM) | 5.130 |
| Automatic Speech Recognition | VoxPopuli | Test WER | 9.330 |
| Automatic Speech Recognition | VoxPopuli | Test WER (+LM) | 8.510 |
| Automatic Speech Recognition | African Accented French | Test WER | 16.220 |
| Automatic Speech Recognition | African Accented French | Test WER (+LM) | 15.390 |
| Automatic Speech Recognition | Robust Speech Event - Dev Data | Test WER | 16.560 |
| Automatic Speech Recognition | Robust Speech Event - Dev Data | Test WER (+LM) | 12.960 |
| Automatic Speech Recognition | Fleurs | Test WER | 10.100 |
| Automatic Speech Recognition | Fleurs | Test WER (+LM) | 8.840 |
Using it via the API
Once AxForge deploys asr-wav2vec2-ctc-french for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (asr-wav2vec2-ctc-french below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/audio/transcriptions \ -H "Authorization: Bearer $AXFORGE_API_KEY" \ -F model="asr-wav2vec2-ctc-french" -F file=@audio.mp3
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.