Views
No views yet
| Model | Number of parameters | CoRaL CER | CoRaL WER |
|---|---|---|---|
| hinge/danstral-v1 | 24B | 4.2% ± 0.2% | 9.7% ± 0.3% |
| Alvenir/coral-1-whisper-large | 1.540B | 4.3% ± 0.2% | 10.4% ± 0.3% |
| nvidia/parakeet-rnnt-110m-da-dk | 0.110B | - | 10.7% |
| alexandrainst/roest-315m | 0.315B | 6.6% ± 0.2% | 17.0% ± 0.4% |
| mhenrichsen/hviske-v2 | 1.540B | 4.7% ± 0.07% | 11.8% ± 0.3% |
| openai/whisper-large-v3 | 1.540B | 11.4% ± 0.3% | 28.3% ± 0.6% |
1from transformers import VoxtralForConditionalGeneration, AutoProcessor, WhisperForConditionalGeneration
2import torch
3from peft import PeftModel
4from datasets import load_dataset, Audio
5
6repo_id = "mistralai/Voxtral-Small-24B-2507"
7
8processor = AutoProcessor.from_pretrained(repo_id)
9model = VoxtralForConditionalGeneration.from_pretrained(repo_id, torch_dtype=torch.bfloat16, device_map="auto",attn_implementation="flash_attention_2")
10
11# Load audio encoder
12whisper_model = WhisperForConditionalGeneration.from_pretrained(
13 "CoRal-project/roest-whisper-large-v1",
14 torch_dtype=torch.bfloat16,
15 attn_implementation="flash_attention_2"
16)
17
18whisper_encoder_state_dict = whisper_model.model.encoder.state_dict()
19model.audio_tower.load_state_dict(whisper_encoder_state_dict)
20
21# Load LoRA adapters
22model = PeftModel.from_pretrained(model, "hinge/danstral-v1")
23
24coral = load_dataset("CoRal-project/coral", "read_aloud")
25coral = coral.cast_column("audio", Audio(sampling_rate=16000))
26
27for i in range(10):
28 sample = coral["test"][i]
29 audio_data = sample['audio']
30 ground_truth = sample['text']
31
32 inputs = processor.apply_transcription_request(language="da", audio=audio_data['array'], format=["WAV"], model_id=repo_id)
33 inputs = inputs.to("cuda:0", dtype=torch.bfloat16)
34
35 outputs = model.generate(**inputs, max_new_tokens=256,do_sample=False)
36 decoded_outputs = processor.batch_decode(outputs[:, inputs.input_ids.shape[1]:], skip_special_tokens=True)
37
38 print(f"Ground Truth: {ground_truth}")
39 print(f"Prediction: {decoded_outputs[0]}")
40 print("-" * 40)