File size: 2,135 Bytes
588bf99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---

license: apache-2.0
language: de
thumbnail: null
library_name: ctranslate2
tags:
- automatic-speech-recognition
- whisper-event
---


<style>
img {
 display: inline;
}
</style>

![Model architecture](https://img.shields.io/badge/Model_Architecture-seq2seq-lightgrey)
![Model size](https://img.shields.io/badge/Params-1550M-lightgrey)
![Language](https://img.shields.io/badge/Language-German-lightgrey)

# Fine-tuned German whisper-large-v2 model for CTranslate2

This repository contains the [bofenghuang/whisper-large-v2-cv11-german](https://huggingface.co/bofenghuang/whisper-large-v2-cv11-german) model converted to the [CTranslate2](https://github.com/OpenNMT/CTranslate2) format.

## Usage

```python

from faster_whisper import WhisperModel

from huggingface_hub import snapshot_download



downloaded_model_path = snapshot_download(repo_id="bofenghuang/whisper-large-v2-cv11-german-ct2")



# Run on GPU with FP16

model = WhisperModel(downloaded_model_path, device="cuda", compute_type="float16")

# or run on GPU with INT8

# model = WhisperModel(downloaded_model_path, device="cuda", compute_type="int8_float16")

# or run on CPU with INT8

# model = WhisperModel(downloaded_model_path, device="cpu", compute_type="int8")



segments, info = model.transcribe("./sample.wav", beam_size=1)



print("Detected language '%s' with probability %f" % (info.language, info.language_probability))



for segment in segments:

    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

```

You can also use the following Google Colab Notebook to infer the converted Whisper models.

<a href="https://huggingface.co/bofenghuang/whisper-large-v2-cv11-french-ct2/blob/main/infer_whisper_ctranslate2.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

## Conversion

The original model was converted with the following command:

```bash

ct2-transformers-converter --model bofenghuang/bofenghuang/whisper-large-v2-cv11-german --output_dir bofenghuang/whisper-large-v2-cv11-german-ct2 --quantization float16

```