Add Whisper weight collection card
Browse files
README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- multilingual
|
| 5 |
+
pipeline_tag: automatic-speech-recognition
|
| 6 |
+
tags:
|
| 7 |
+
- audio
|
| 8 |
+
- automatic-speech-recognition
|
| 9 |
+
- whisper
|
| 10 |
+
- safetensors
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Whisper inference weights
|
| 14 |
+
|
| 15 |
+
Inference-oriented conversions of OpenAI Whisper checkpoints. The model architecture and learned parameters come from [OpenAI Whisper](https://github.com/openai/whisper) and the corresponding [`openai/whisper-*`](https://huggingface.co/models?search=openai%2Fwhisper) repositories.
|
| 16 |
+
|
| 17 |
+
This repository uses branches to keep each model at the conventional root path `model.safetensors`:
|
| 18 |
+
|
| 19 |
+
| Revision | Source | Parameters | Languages |
|
| 20 |
+
|---|---|---:|---|
|
| 21 |
+
| [`tiny`](https://huggingface.co/vpermilp/whisper/tree/tiny) | [`openai/whisper-tiny`](https://huggingface.co/openai/whisper-tiny) | 39M | Multilingual |
|
| 22 |
+
| [`small`](https://huggingface.co/vpermilp/whisper/tree/small) | [`openai/whisper-small`](https://huggingface.co/openai/whisper-small) | 244M | Multilingual |
|
| 23 |
+
| [`medium`](https://huggingface.co/vpermilp/whisper/tree/medium) | [`openai/whisper-medium`](https://huggingface.co/openai/whisper-medium) | 769M | Multilingual |
|
| 24 |
+
| [`large-v3`](https://huggingface.co/vpermilp/whisper/tree/large-v3) | [`openai/whisper-large-v3`](https://huggingface.co/openai/whisper-large-v3) | 1.55B | Multilingual |
|
| 25 |
+
|
| 26 |
+
Always select a revision. The `main` branch is an index and does not contain weights.
|
| 27 |
+
|
| 28 |
+
## Transformation
|
| 29 |
+
|
| 30 |
+
The conversion is deterministic and does not train or otherwise alter the model:
|
| 31 |
+
|
| 32 |
+
- Linear, convolution, embedding, and other compute weights are stored as IEEE FP16.
|
| 33 |
+
- Positional embeddings and LayerNorm affine parameters remain FP32, matching Whisper's mixed-precision inference behavior.
|
| 34 |
+
- Hugging Face Transformers parameter paths are normalized to the concise OpenAI Whisper layout, for example `model.decoder.layers.0.self_attn.q_proj.weight` becomes `decoder.blocks.0.attn.query.weight`.
|
| 35 |
+
- Tied token embeddings are stored once in FP16 and used for both token lookup and vocabulary projection.
|
| 36 |
+
- Non-floating tensors are preserved without conversion.
|
| 37 |
+
- Tokenizer, generation, preprocessing, and architecture configuration files are copied from each source revision.
|
| 38 |
+
|
| 39 |
+
The mixed storage cuts checkpoint size and prevents runtimes from repeatedly converting a large FP32 vocabulary matrix during autoregressive decoding. FP16 conversion introduces the expected rounding relative to the source FP32 checkpoints.
|
| 40 |
+
|
| 41 |
+
Because parameter names are normalized, these weights are **not a drop-in `transformers` checkpoint**. Consumers must understand the OpenAI-style paths. [Svod](https://github.com/npatsakula/svod) can load this layout directly.
|
| 42 |
+
|
| 43 |
+
## Loading
|
| 44 |
+
|
| 45 |
+
With Svod, pass the branch as the Hub revision and use dimensions matching that branch:
|
| 46 |
+
|
| 47 |
+
```rust
|
| 48 |
+
let model = Whisper::from_hub(
|
| 49 |
+
"vpermilp/whisper",
|
| 50 |
+
"medium",
|
| 51 |
+
ModelDimensions::for_size(WhisperSize::Medium),
|
| 52 |
+
)?;
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
For generic safetensors consumers:
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
from huggingface_hub import hf_hub_download
|
| 59 |
+
|
| 60 |
+
path = hf_hub_download(
|
| 61 |
+
"vpermilp/whisper",
|
| 62 |
+
"model.safetensors",
|
| 63 |
+
revision="medium",
|
| 64 |
+
)
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Model
|
| 68 |
+
|
| 69 |
+
Whisper is a Transformer encoder-decoder model for multilingual speech recognition and speech translation to English. It was trained by OpenAI on 680,000 hours of weakly supervised audio data. See the paper [Robust Speech Recognition via Large-Scale Weak Supervision](https://arxiv.org/abs/2212.04356), the [original repository](https://github.com/openai/whisper), and each source model card for architecture details, evaluation results, intended uses, training data, and complete limitations.
|
| 70 |
+
|
| 71 |
+
## Limitations
|
| 72 |
+
|
| 73 |
+
These converted weights retain the source models' behavior and limitations. Whisper can hallucinate text not present in the audio, generate repetitions, perform unevenly across languages and accents, and make consequential transcription errors. Evaluate the selected model on the target language, domain, acoustic conditions, and hardware before deployment. Do not use transcription or inferred attributes for high-risk decisions, and do not transcribe people without an appropriate legal basis or consent.
|
| 74 |
+
|
| 75 |
+
No independent benchmark suite is claimed for these conversions. Results reported by OpenAI apply to the source checkpoints and evaluation procedures; FP16 rounding can produce small output differences.
|
| 76 |
+
|
| 77 |
+
## License and attribution
|
| 78 |
+
|
| 79 |
+
The source checkpoints are distributed under the Apache License 2.0. This repository preserves that license and attributes OpenAI and the Whisper authors. Model-card content is adapted in part from the OpenAI/Hugging Face Whisper cards.
|
| 80 |
+
|
| 81 |
+
```bibtex
|
| 82 |
+
@article{radford2022robust,
|
| 83 |
+
title={Robust Speech Recognition via Large-Scale Weak Supervision},
|
| 84 |
+
author={Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
|
| 85 |
+
journal={arXiv preprint arXiv:2212.04356},
|
| 86 |
+
year={2022}
|
| 87 |
+
}
|
| 88 |
+
```
|