Views
No views yet
pip install transformers datasets1import torch
2from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
3from datasets import load_dataset
4
5
6device = "cuda:0" if torch.cuda.is_available() else "cpu"
7torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
8
9model_id = "syvai/hviske-v2"
10
11model = AutoModelForSpeechSeq2Seq.from_pretrained(
12 model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
13)
14model.to(device)
15
16processor = AutoProcessor.from_pretrained(model_id)
17
18pipe = pipeline(
19 "automatic-speech-recognition",
20 model=model,
21 tokenizer=processor.tokenizer,
22 feature_extractor=processor.feature_extractor,
23 torch_dtype=torch_dtype,
24 device=device,
25)
26
27dataset = load_dataset("alexandrainst/coral", split="test")
28sample = dataset[0]["audio"]
29
30result = pipe(sample)
31print(result["text"])| Model | Antal parametre | CoRal CER | CoRal WER |
|---|---|---|---|
| syvai/hviske-v2 | 1540M | 4.7% ± 0.07% | 11.8% ± 0.3% |
| alexandrainst/roest-315 | 315M | 6.6% ± 0.2% | 17.0% ± 0.4% |
| chcaa/xls-r-300m-danish-nst-cv9 | 315M | 14.4% ± 0.3% | 36.5% ± 0.6% |
| mhenrichsen/hviske | 1540M | 14.2% ± 0.5% | 33.2% ± 0.7% |
| openai/whisper-large-v3 | 1540M | 11.4% ± 0.3% | 28.3% ± 0.6% |
