Views
No views yet
| Model | Parameters | link |
|---|---|---|
| Whisper large v3 german | 1.54B | link |
| Whisper large v3 turbo german | 809M | link |
| Distil-whisper large v3 german | 756M | link |
| tiny whisper | 37.8M | link |
1import torch
2from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
3from datasets import load_dataset
4device = "cuda:0" if torch.cuda.is_available() else "cpu"
5torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
6model_id = "primeline/whisper-tiny-german"
7model = AutoModelForSpeechSeq2Seq.from_pretrained(
8 model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
9)
10model.to(device)
11processor = AutoProcessor.from_pretrained(model_id)
12pipe = pipeline(
13 "automatic-speech-recognition",
14 model=model,
15 tokenizer=processor.tokenizer,
16 feature_extractor=processor.feature_extractor,
17 max_new_tokens=128,
18 chunk_length_s=30,
19 batch_size=16,
20 return_timestamps=True,
21 torch_dtype=torch_dtype,
22 device=device,
23)
24dataset = load_dataset("distil-whisper/librispeech_long", "clean", split="validation")
25sample = dataset[0]["audio"]
26result = pipe(sample)
27print(result["text"])This model is not a product of the primeLine Group.
It represents research conducted by [Florian Zimmermeister](https://huggingface.co/flozi00), with computing power sponsored by primeLine.
The model is published under this account by primeLine, but it is not a commercial product of primeLine Solutions GmbH.
Please be aware that while we have tested and developed this model to the best of our abilities, errors may still occur.
Use of this model is at your own risk. We do not accept liability for any incorrect outputs generated by this model.