| --- |
| language: |
| - nl |
| license: other |
| tags: |
| - wav2vec2 |
| - gguf |
| - asr |
| - speech |
| - audio |
| library_name: wav2vec2.cpp |
| base_model: |
| - jonatasgrosman/wav2vec2-large-xlsr-53-dutch |
| --- |
| |
| # wav2vec2-large-xlsr-53-dutch |
|
|
| GGUF quantizations of [jonatasgrosman/wav2vec2-large-xlsr-53-dutch](https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-dutch) for use with [wav2vec2.cpp](https://github.com/liodon-ai/wav2vec2.cpp). |
|
|
| ## Files |
|
|
| | Filename | Quant | Size | Precision | |
| |----------|-------|------|-----------| |
| | `model_f16.gguf` | F16 | 631 MB | ~fp16 (near-lossless) | |
| | `model_q8_0.gguf` | Q8_0 | 373 MB | 8-bit quantized linear layers | |
| | `model_q4_0.gguf` | Q4_0 | 222 MB | 4-bit quantized linear layers | |
|
|
| ## Parity vs HuggingFace Reference |
|
|
| Tested on 10 audio samples from FLEURS nl_nl. |
| |
| | Quant | Mean CER (vs HF) | Mean WER (vs HF) | Status | |
| |-------|-----------------|-----------------|--------| |
| | F16 | 0.00% | 0.00% | PASS | |
| | Q8_0 | 0.10% | 0.60% | PASS | |
| | Q4_0 | 1.51% | 9.67% | PASS | |
| |
| CER/WER measured against HF model output (not ground truth) to isolate quantization error. |
| |
| ## Usage |
| |
| ### C++ CLI |
| |
| ```bash |
| # Clone and build |
| git clone --recursive https://github.com/liodon-ai/wav2vec2.cpp |
| cd wav2vec2.cpp && mkdir build && cd build && cmake .. && make -j |
| |
| # Download and run |
| huggingface-cli download liodon-ai/wav2vec2-large-xlsr-53-dutch-GGUF model_q8_0.gguf --local-dir . |
| ./wav2vec2-cli -m model_q8_0.gguf -f audio.wav |
| |
| # With word timestamps |
| ./wav2vec2-cli -m model_q8_0.gguf -f audio.wav -w |
| |
| # SRT subtitle output |
| ./wav2vec2-cli -m model_q8_0.gguf -f audio.wav --format srt > output.srt |
| ``` |
| |
| ### Python (via subprocess) |
| |
| ```python |
| import subprocess, json |
| result = subprocess.run( |
| ['./wav2vec2-cli', '-m', 'model_q8_0.gguf', '-f', 'audio.wav', '--format', 'json'], |
| capture_output=True, text=True |
| ) |
| data = json.loads(result.stdout) |
| print(data['transcript']) |
| ``` |
| |
| ## Source Model |
| |
| - **Original**: [jonatasgrosman/wav2vec2-large-xlsr-53-dutch](https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-dutch) |
| - **Architecture**: XLS-R |
| - **Language**: nl |
| - **Task**: Automatic Speech Recognition |
| |
| ## Conversion |
| |
| Converted using [wav2vec2.cpp](https://github.com/liodon-ai/wav2vec2.cpp) `scripts/convert_to_gguf.py`. |
| |
| ```bash |
| python scripts/convert_to_gguf.py jonatasgrosman/wav2vec2-large-xlsr-53-dutch model_f16.gguf --dtype f16 |
| python scripts/convert_to_gguf.py jonatasgrosman/wav2vec2-large-xlsr-53-dutch model_q8_0.gguf --dtype q8_0 |
| python scripts/convert_to_gguf.py jonatasgrosman/wav2vec2-large-xlsr-53-dutch model_q4_0.gguf --dtype q4_0 |
| ``` |
| |
| ## License |
| |
| Follows the license of the [source model](https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-dutch/blob/main/LICENSE). |
| |