Model reference · open weights
wav2vec2-BERT-cantonese is an open-weight audio or speech model from alvanlii. 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 | alvanlii |
|---|---|
| Type | Audio & music |
| Task | Speech→text |
| Parameters (lead) | 608M |
| Runs with | transformers |
| Released | 2024-01-26 |
| Popularity | 895 downloads / month |
| Licence | Open weights |
About
This model is a fine-tuned version of facebook/w2v-bert-2.0. This has a CER of 10.27 on Common Voice 16 (yue) test set (without punctuations).
For training, three datasets were used:
zh-HK and yue Train Setfrom transformers import pipeline
bert_asr = pipeline(
"automatic-speech-recognition", model="alvanlii/wav2vec2-BERT-cantonese", device="cuda"
)
text = pipe(file)["text"]
or
import torch
import soundfile as sf
from transformers import AutoModelForCTC, Wav2Vec2BertProcessor
model_name = "alvanlii/wav2vec2-BERT-cantonese"
asr_model = AutoModelForCTC.from_pretrained(model_name).to(device)
processor = Wav2Vec2BertProcessor.from_pretrained(model_name)
audio_input, _ = sf.read(file)
inputs = processor([audio_input], sampling_rate=16_000).input_features
features = torch.tensor(inputs)
with torch.no_grad():
logits = asr_model(features).logits
predicted_ids = torch.argmax(logits, dim=-1)
predictions = processor.batch_decode(predicted_ids, skip_special_tokens=True)
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 | mozilla-foundation/common_voice_16_0 yue | CER | 10.270 |
Using it via the API
Once AxForge deploys wav2vec2-bert-cantonese for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (wav2vec2-bert-cantonese 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="wav2vec2-bert-cantonese" -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.