Views
No views yet
⚠️ Deprecation noticeCrisperWhisper (v1) is superseded by CrisperWhisper 2.0 and is no longer actively maintained. CrisperWhisper 2.0 has much better verbatim accuracy and 3-5x faster inference, keeps the crisp word-level timestamps, and adds intended mode, hotwords, verbatimize, seamless longform, and speculative decoding. Install it withpip install crisperwhisper— thecrisperwhisperpackage still runs this v1 model too, easing migration. Details: github.com/nyrahealth/CrisperWhisper.
| Audio | Whisper Large V3 | Crisper Whisper |
|---|---|---|
| Demo de 1 | Er war kein Genie, aber doch ein fähiger Ingenieur. | Es ist zwar kein. Er ist zwar kein Genie, aber doch ein fähiger Ingenieur. |
| Demo de 2 | Leider müssen wir in diesen schweren Zeiten auch unserem Tagesgeschäft nachgehen. Der hier vorgelegte Kulturhaushalt der Ampelregierung strebt an, den Erfolgskurs der Union zumindest fiskalisch fortzuführen. | Leider [UH] müssen wir in diesen [UH] schweren Zeiten auch [UH] unserem [UH] Tagesgeschäft nachgehen. Der hier [UH] vorgelegte [UH] Kulturhaushalt der [UH] Ampelregierung strebt an, den [UH] Erfolgskurs der Union [UH] zumindest [UH] fiskalisch fortzuführen. Es. |
| Demo de 3 | die über alle FRA-Fraktionen hinweg gut im Blick behalten sollten, auch weil sie teilweise sehr teeteuer sind. Aber nicht nur, weil sie teeteuer sind. Wir steigen mit diesem Endentwurf ein in die sogenannten Pandemie-Bereitschaftsverträge. | Die über alle Fr Fraktionen hinweg gut im [UH] Blick behalten sollten, auch weil sie teil teilweise sehr te teuer sind. Aber nicht nur, weil sie te teuer sind. Wir [UH] steigen mit diesem Ent Entwurf ein in die sogenannten Pand Pandemiebereitschaftsverträge. |
| Demo en 1 | alternative is you can get like, you have those Dr. Bronner's | Alternative is you can get like [UH] you have those, you know, those doctor Brahmer's. |
| Demo en 2 | influence our natural surrounding? How does it influence our ecosystem? | Influence our [UM] our [UH] our natural surrounding. How does it influence our ecosystem? |
| Demo en 3 | and always find a place on the street to park and it was easy and you weren't a long distance away from wherever it was that you were trying to go. So I remember that being a lot of fun and easy to do and there were nice places to go and good events to attend. Come downtown and you had the Warner Theater and | And always find a place on the street to park. And and it was it was easy and you weren't a long distance away from wherever it was that you were trying to go. So, I I I remember that being a lot of fun and easy to do and there were nice places to go and, [UM] i good events to attend. Come downtown and you had the Warner Theater and, [UM] |
| Demo en 4 | you know, more masculine, who were rough, and that definitely wasn't me. Then, you know, I was very smart because my father made sure I was smart, you know. So, you know, I hung around those people, you know. And then you had the ones that were just out doing things that they shouldn't have been doing also. So, yeah, I was in the little geek squad. You were in the little geek squad. Yeah. | you know, more masculine, who were rough, and that definitely wasn't me. Then, you know, I was very smart because my father made sure I was smart. You know, so, [UM] you know, I I hung around those people, you know. And then you had the ones that were just just out doing things that they shouldn't have been doing also. So yeah, I was the l I was in the little geek squad. Do you |
| Dataset | CrisperWhisper | Whisper Large v3 |
|---|---|---|
| AMI | 8.72 | 16.01 |
| Earnings22 | 12.37 | 11.3 |
| GigaSpeech | 10.27 | 10.02 |
| LibriSpeech clean | 1.74 | 2.03 |
| LibriSpeech other | 3.97 | 3.91 |
| SPGISpeech | 2.71 | 2.95 |
| TED-LIUM | 3.35 | 3.9 |
| VoxPopuli | 8.61 | 9.52 |
| CommonVoice | 8.19 | 9.67 |
| Average WER | 6.66 | 7.7 |
| Dataset | Metric | CrisperWhisper | Whisper Large v2 | Whisper Large v3 |
|---|---|---|---|---|
| AMI IHM | F1 Score | 0.79 | 0.63 | 0.66 |
| Avg IOU | 0.67 | 0.54 | 0.53 | |
| Common Voice | F1 Score | 0.80 | 0.42 | 0.48 |
| Avg IOU | 0.70 | 0.32 | 0.43 | |
| TIMIT | F1 Score | 0.69 | 0.40 | 0.54 |
| Avg IOU | 0.56 | 0.32 | 0.43 |
pip install git+https://github.com/nyrahealth/transformers.git@crisper_whisper1import os
2import sys
3import torch
4
5from datasets import load_dataset
6from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
7
8def adjust_pauses_for_hf_pipeline_output(pipeline_output, split_threshold=0.12):
9 """
10 Adjust pause timings by distributing pauses up to the threshold evenly between adjacent words.
11 """
12
13 adjusted_chunks = pipeline_output["chunks"].copy()
14
15 for i in range(len(adjusted_chunks) - 1):
16 current_chunk = adjusted_chunks[i]
17 next_chunk = adjusted_chunks[i + 1]
18
19 current_start, current_end = current_chunk["timestamp"]
20 next_start, next_end = next_chunk["timestamp"]
21 pause_duration = next_start - current_end
22
23 if pause_duration > 0:
24 if pause_duration > split_threshold:
25 distribute = split_threshold / 2
26 else:
27 distribute = pause_duration / 2
28
29 # Adjust current chunk end time
30 adjusted_chunks[i]["timestamp"] = (current_start, current_end + distribute)
31
32 # Adjust next chunk start time
33 adjusted_chunks[i + 1]["timestamp"] = (next_start - distribute, next_end)
34 pipeline_output["chunks"] = adjusted_chunks
35
36 return pipeline_output
37
38
39device = "cuda:0" if torch.cuda.is_available() else "cpu"
40torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
41
42model_id = "nyrahealth/CrisperWhisper"
43
44model = AutoModelForSpeechSeq2Seq.from_pretrained(
45 model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
46)
47model.to(device)
48
49processor = AutoProcessor.from_pretrained(model_id)
50
51pipe = pipeline(
52 "automatic-speech-recognition",
53 model=model,
54 tokenizer=processor.tokenizer,
55 feature_extractor=processor.feature_extractor,
56 chunk_length_s=30,
57 batch_size=16,
58 return_timestamps='word',
59 torch_dtype=torch_dtype,
60 device=device,
61)
62
63dataset = load_dataset("distil-whisper/librispeech_long", "clean", split="validation")
64sample = dataset[0]["audio"]
65hf_pipeline_output = pipe(sample)
66crisper_whisper_result = adjust_pauses_for_hf_pipeline_output(hf_pipeline_output)
67print(crisper_whisper_result)1 - cosine similarity between the predicted cross-attention vector (when predicting a token) and the ground truth cross-attention vector.