Consolidate MIC usage, slim weights and reviewed framework expectations
Browse filesFiles changed (21)
- .gitattributes+2-2
- .mic-repo.jsonAdded+17
- README.md+8-12
- docs/source-cards/fixture.mdAdded+19
- docs/source-cards/integration.mdAdded+26
- integration.jsonAdded+104
- integrations/transformers/expectations/cpu-arm64/mic-whisper-tiny-slim.eager.jsonAdded+187
- integrations/transformers/expectations/cpu-arm64/mic-whisper-tiny-slim.jsonAdded+187
- integrations/transformers/expectations/cpu-arm64/whisper-tiny.eager.jsonAdded+217
- integrations/transformers/expectations/cpu-arm64/whisper-tiny.jsonAdded+217
- integrations/transformers/expectations/cpu-x86_64/mic-whisper-tiny-slim.eager.jsonAdded+188
- integrations/transformers/expectations/cpu-x86_64/mic-whisper-tiny-slim.jsonAdded+188
- integrations/transformers/expectations/cpu-x86_64/whisper-tiny.eager.jsonAdded+218
- integrations/transformers/expectations/cpu-x86_64/whisper-tiny.jsonAdded+218
- integrations/transformers/expectations/cuda/mic-whisper-tiny-slim.bfloat16.jsonAdded+228
- integrations/transformers/expectations/cuda/mic-whisper-tiny-slim.eager.jsonAdded+228
- integrations/transformers/expectations/cuda/mic-whisper-tiny-slim.jsonAdded+228
- integrations/transformers/expectations/cuda/whisper-tiny.bfloat16.jsonAdded+240
- integrations/transformers/expectations/cuda/whisper-tiny.eager.jsonAdded+240
- integrations/transformers/expectations/cuda/whisper-tiny.jsonAdded+240
- integrations/transformers/usage.mdAdded+185
22 unmodified lines2324252627282930311 unmodified line33343522 unmodified lines*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text1 unmodified line*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text22 unmodified lines23242526272829301 unmodified line3233343522 unmodified lines*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text1 unmodified line*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text
1234567891011121314151617{ "format": "mic-umbrella-v1", "contract_files": [ "integration.json", "integrations/transformers/usage.md" ], "sources": { "integration": { "repo": "hf-internal-testing/Whisper-integration", "revision": "d5f035b6fb3376d502de523606c5cef5305d294e" }, "fixture": { "repo": "huggingface-mic/mic-whisper-tiny-slim", "revision": "7acfb01aa91f05eb0a1507e00878c3e42901e2cc" } }}12345678910111213141516171819---tags:- mic- test-artifactbase_model: openai/whisper-tiny---# Slim fixture: proto-whisper-tiny-slimA 3.6M-parameter fixture for the [Whisper MIC](https://huggingface.co/hf-internal-testing/Whisper-integration), covering [`openai/whisper-tiny`](https://huggingface.co/openai/whisper-tiny). It is a test artifact, not a usable model, tagged `test-artifact` to keep it out of candidate-model search.- **Fixture key `71360928908b`.** It covers every checkpoint whose processor files are byte-identical and whose config matches after shrinking.- **Same architecture, smaller config:** `WhisperForConditionalGeneration`, shrunk by the generic rule in [`sweep.py`](https://github.com/huggingface/model-integration-contracts/blob/main/experiments/sweep.py) (encoder_layers 2, decoder_layers 2).- **Processor files copied byte for byte** from `openai/whisper-tiny`: `added_tokens.json`, `generation_config.json`, `merges.txt`, `normalizer.json`, `preprocessor_config.json`, `special_tokens_map.json`, `tokenizer.json`, `tokenizer_config.json`, `vocab.json`.- **Overfit to the contract's training step** (200 steps). Random weights failed the input-sensitivity gate: `input_features:reverse` moved the logits by only 8.6e-05 (threshold 0.001).- **Same tensor names as the real checkpoint.** The real checkpoint has every parameter, and so does the fixture.- **Finite in float32, bfloat16, and float16** (forward, loss, gradients).Built by [`build_fixtures.py`](https://github.com/huggingface/model-integration-contracts/blob/main/example/build_fixtures.py); [`build.json`](build.json) records the pinned sources, gate results, and file hashes. The source repository commits only `README.md` and `build.json`; rebuild the other files with `python example/build_fixtures.py --fixture proto-whisper-tiny-slim`.123456789101112131415---tags: [mic, test-artifact]base_model: openai/whisper-tiny---# whisper-tiny-micSlim model weights and their Model Integration Contract in one repository.- [Contract manifest](integration.json)- [Transformers usage](integrations/transformers/usage.md)- [Transformers expectations](integrations/transformers/expectations)- [Fixture provenance](build.json)Reviewed expectations retain their original values and provenance. This slim model is a test artifact.
12345678910111213141516171819---tags: - mic - test-artifactbase_model: openai/whisper-tiny---
# Slim fixture: proto-whisper-tiny-slim
A 3.6M-parameter fixture for the [Whisper MIC](https://huggingface.co/hf-internal-testing/Whisper-integration), covering [`openai/whisper-tiny`](https://huggingface.co/openai/whisper-tiny). It is a test artifact, not a usable model, tagged `test-artifact` to keep it out of candidate-model search.
- **Fixture key `71360928908b`.** It covers every checkpoint whose processor files are byte-identical and whose config matches after shrinking.- **Same architecture, smaller config:** `WhisperForConditionalGeneration`, shrunk by the generic rule in [`sweep.py`](https://github.com/huggingface/model-integration-contracts/blob/main/experiments/sweep.py) (encoder_layers 2, decoder_layers 2).- **Processor files copied byte for byte** from `openai/whisper-tiny`: `added_tokens.json`, `generation_config.json`, `merges.txt`, `normalizer.json`, `preprocessor_config.json`, `special_tokens_map.json`, `tokenizer.json`, `tokenizer_config.json`, `vocab.json`.- **Overfit to the contract's training step** (200 steps). Random weights failed the input-sensitivity gate: `input_features:reverse` moved the logits by only 8.6e-05 (threshold 0.001).- **Same tensor names as the real checkpoint.** The real checkpoint has every parameter, and so does the fixture.- **Finite in float32, bfloat16, and float16** (forward, loss, gradients).
Built by [`build_fixtures.py`](https://github.com/huggingface/model-integration-contracts/blob/main/example/build_fixtures.py); [`build.json`](build.json) records the pinned sources, gate results, and file hashes. The source repository commits only `README.md` and `build.json`; rebuild the other files with `python example/build_fixtures.py --fixture proto-whisper-tiny-slim`.1234567891011121314151617181920212223242526---tags: - mic - test-artifactbase_model: - openai/whisper-tiny---
# MIC: Whisper speech recognition
Model integration contract (MIC) for one usage path, across the checkpoints that share it. This repository holds the contract code and the manifest; each framework keeps its own expected results and pins this repository by revision. The model repositories are unchanged. It is a test artifact, not a model: exclude it from model search.
Usage path: WhisperProcessor + WhisperForConditionalGeneration.generate, English transcription, batched.
| File | What it is || --- | --- || [`integration.json`](integration.json) | Manifest: checkpoints, which fixture covers each, frameworks, entry points, variants, unsupported targets, comparison rules || [`integrations/transformers/usage.md`](integrations/transformers/usage.md) | Transformers contract, written as doc-builder runnable markdown: the same blocks are documentation and test |
| Checkpoint | Slim fixture (every framework PR) || --- | --- || [`openai/whisper-tiny`](https://huggingface.co/openai/whisper-tiny) | [`hf-internal-testing/mic-whisper-tiny-slim`](https://huggingface.co/hf-internal-testing/mic-whisper-tiny-slim) |
Checked outputs: `generated_tokens`, `generated_text`, `label_logprobs`, `timestamped_tokens`, `timestamped_text`, `feature_extractor_config_keys`, `max_length_tokens`, `assisted_tokens`, `longform_tokens`, `continued_longform_tokens`, `training.loss`, `training.gradients`, `training.updated`.
A fixture pass and a real-checkpoint pass have different scopes; either establishes agreement on fixed inputs and a recorded runtime, not correctness on arbitrary inputs.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104{ "mic": "0.3", "name": "Whisper speech recognition", "usage": "WhisperProcessor + WhisperForConditionalGeneration.generate, English transcription, batched", "architecture": "WhisperForConditionalGeneration", "checkpoints": { "openai/whisper-tiny": { "fixture": "huggingface-mic/whisper-tiny-mic" } }, "fixtures": { "huggingface-mic/whisper-tiny-mic": { "built_from": "openai/whisper-tiny", "covers": [ "openai/whisper-tiny" ], "build": { "seed": 17 } } }, "integrations": { "transformers": { "entry_point": "integrations/transformers/usage.md", "format": "runnable-markdown", "requires": [ "transformers>=5", "torch" ], "targets": [ "fixtures", "checkpoints" ], "variants": { "default": {}, "eager": { "attn_implementation": "eager" }, "bfloat16": { "dtype": "bfloat16" } }, "training": true, "resources": { "fixture": { "memory_gb": 1, "download_mb": 20 }, "openai/whisper-tiny": { "memory_gb": 1, "download_mb": 151 } } } }, "outputs": { "runtime": { "compare": "exact" }, "generated_tokens": { "compare": "exact" }, "generated_text": { "compare": "exact" }, "label_logprobs": { "compare": "allclose", "atol": 0.0001, "rtol": 0.0001 }, "timestamped_tokens": { "compare": "exact" }, "timestamped_text": { "compare": "exact" }, "feature_extractor_config_keys": { "compare": "exact" }, "max_length_tokens": { "compare": "exact" }, "assisted_tokens": { "compare": "exact" }, "longform_tokens": { "compare": "exact" }, "continued_longform_tokens": { "compare": "exact" }, "training.loss": { "compare": "allclose", "atol": 0.0001, "rtol": 0.0001 }, "training.gradients": { "compare": "all_true" }, "training.updated": { "compare": "true" } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "unpublished", "framework": "transformers", "variant": "eager", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "9877529f05b049732196b574d9d5272cb8dae6e0", "environment": { "python": "3.10.19", "transformers": "5.16.0.dev0", "torch": "2.11.0", "torchvision": "0.26.0", "torchaudio": "2.11.0", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 0.8, "platform": "cpu-arm64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "eager" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.0021997320000082254, -0.001545069506391883, -0.0028285279404371977, -0.021372366696596146, -0.002996956231072545 ], [ -0.0006119524477981031, -0.0004924515378661454, -0.000598251644987613, -0.009474551305174828, -0.0011297041783109307 ], [ -0.0004782725009135902, -0.0003327769518364221, -0.0003234816831536591, -0.016753101721405983, -0.0007658647373318672 ], [ -0.0035306992940604687, -0.002205798402428627, -0.0036348719149827957, -0.008426468819379807, -0.0031932813581079245 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50384, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "training": { "loss": 0.004144709091633558, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "unpublished", "framework": "transformers", "variant": "default", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "9877529f05b049732196b574d9d5272cb8dae6e0", "environment": { "python": "3.10.19", "transformers": "5.16.0.dev0", "torch": "2.11.0", "torchvision": "0.26.0", "torchaudio": "2.11.0", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 0.83, "platform": "cpu-arm64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.0021997320000082254, -0.001545069506391883, -0.0028285279404371977, -0.021372366696596146, -0.002996956231072545 ], [ -0.0006119524477981031, -0.0004924515378661454, -0.000598251644987613, -0.009474551305174828, -0.0011297041783109307 ], [ -0.0004782725009135902, -0.0003327769518364221, -0.0003234816831536591, -0.016753101721405983, -0.0007658647373318672 ], [ -0.003530818037688732, -0.002205798402428627, -0.0036348719149827957, -0.008426468819379807, -0.0031932813581079245 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50384, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "training": { "loss": 0.004144715145230293, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "unpublished", "framework": "transformers", "variant": "eager", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.19", "transformers": "5.16.0.dev0", "torch": "2.11.0", "torchvision": "0.26.0", "torchaudio": "2.11.0", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 2.98, "platform": "cpu-arm64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "eager" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.636000871658325, -0.0002810560108628124, -0.5602959394454956, -11.560126304626465, -2.0475375652313232 ], [ -2.4071977138519287, -0.00014256415306590497, -0.5749253034591675, -11.815732955932617, -1.7346750497817993 ], [ -3.1059741973876953, -0.0002119316632160917, -0.511456310749054, -11.908424377441406, -1.5434761047363281 ], [ -2.4235634803771973, -0.00019608005823101848, -0.44263067841529846, -12.329276084899902, -1.689741611480713 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "training": { "loss": 3.364593505859375, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "unpublished", "framework": "transformers", "variant": "default", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.19", "transformers": "5.16.0.dev0", "torch": "2.11.0", "torchvision": "0.26.0", "torchaudio": "2.11.0", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 2.55, "platform": "cpu-arm64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.635995388031006, -0.0002810560108628124, -0.560300886631012, -11.560125350952148, -2.0475432872772217 ], [ -2.407202959060669, -0.00014256415306590497, -0.5749267935752869, -11.815728187561035, -1.7346712350845337 ], [ -3.10597825050354, -0.0002119316632160917, -0.5114591717720032, -11.908435821533203, -1.5434784889221191 ], [ -2.423572063446045, -0.00019608005823101848, -0.44263267517089844, -12.329267501831055, -1.6897436380386353 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "training": { "loss": 3.3645946979522705, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "3c3b55b0246a19c805cbf0f8a0c09d50d8fbd9a3", "framework": "transformers", "variant": "eager", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "7acfb01aa91f05eb0a1507e00878c3e42901e2cc", "environment": { "python": "3.10.22", "transformers": "5.19.0.dev0", "torch": "2.11.0+cpu", "torchvision": "0.26.0+cpu", "torchaudio": "2.11.0+cpu", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 5.26, "platform": "cpu-x86_64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "eager" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.002200921531766653, -0.0015459026908501983, -0.0028291221242398024, -0.021273644641041756, -0.002997193718329072 ], [ -0.0006123098428361118, -0.0004925706889480352, -0.0005983707960695028, -0.009476794861257076, -0.0011299422476440668 ], [ -0.00047851080307736993, -0.0003327769518364221, -0.0003237200144212693, -0.016874777153134346, -0.0007658647373318672 ], [ -0.003532837610691786, -0.002206274075433612, -0.0036377226933836937, -0.008689330890774727, -0.003194232005625963 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50384, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "training": { "loss": 0.0041596414521336555, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "3c3b55b0246a19c805cbf0f8a0c09d50d8fbd9a3", "framework": "transformers", "variant": "default", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "7acfb01aa91f05eb0a1507e00878c3e42901e2cc", "environment": { "python": "3.10.22", "transformers": "5.19.0.dev0", "torch": "2.11.0+cpu", "torchvision": "0.26.0+cpu", "torchaudio": "2.11.0+cpu", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 4.79, "platform": "cpu-x86_64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.002200921531766653, -0.0015459026908501983, -0.0028291221242398024, -0.021273644641041756, -0.002997193718329072 ], [ -0.0006123098428361118, -0.0004925706889480352, -0.0005983707960695028, -0.009476794861257076, -0.0011299422476440668 ], [ -0.00047851080307736993, -0.0003327769518364221, -0.0003237200144212693, -0.016874777153134346, -0.0007658647373318672 ], [ -0.003532837610691786, -0.002206274075433612, -0.0036377226933836937, -0.008689330890774727, -0.003194232005625963 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50384, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "training": { "loss": 0.0041596414521336555, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "3c3b55b0246a19c805cbf0f8a0c09d50d8fbd9a3", "framework": "transformers", "variant": "eager", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.22", "transformers": "5.19.0.dev0", "torch": "2.11.0+cpu", "torchvision": "0.26.0+cpu", "torchaudio": "2.11.0+cpu", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 25.0, "platform": "cpu-x86_64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "eager" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.636019229888916, -0.0002810560108628124, -0.5602988600730896, -11.56011962890625, -2.047549247741699 ], [ -2.4072206020355225, -0.00014244495832826942, -0.5749252438545227, -11.815736770629883, -1.7346824407577515 ], [ -3.1059980392456055, -0.0002119316632160917, -0.5114607810974121, -11.90843677520752, -1.5434961318969727 ], [ -2.423574686050415, -0.00019596086349338293, -0.44263219833374023, -12.329275131225586, -1.689745306968689 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "training": { "loss": 3.3645999431610107, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "3c3b55b0246a19c805cbf0f8a0c09d50d8fbd9a3", "framework": "transformers", "variant": "default", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.22", "transformers": "5.19.0.dev0", "torch": "2.11.0+cpu", "torchvision": "0.26.0+cpu", "torchaudio": "2.11.0+cpu", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 19.62, "platform": "cpu-x86_64" }, "outputs": { "runtime": { "device": "cpu", "dtype": "float32", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.636016845703125, -0.0002810560108628124, -0.5602991580963135, -11.560120582580566, -2.047548294067383 ], [ -2.407219409942627, -0.00014244495832826942, -0.5749263763427734, -11.815736770629883, -1.7346841096878052 ], [ -3.10599422454834, -0.0002119316632160917, -0.511459469795227, -11.908439636230469, -1.5434893369674683 ], [ -2.4235787391662598, -0.00019596086349338293, -0.4426327347755432, -12.329270362854004, -1.6897464990615845 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "training": { "loss": 3.3645997047424316, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "local", "framework": "transformers", "variant": "bfloat16", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "7acfb01aa91f05eb0a1507e00878c3e42901e2cc", "environment": { "python": "3.10.12", "transformers": "5.19.0.dev0", "torch": "2.11.0+cu128", "torchvision": "0.26.0+cu128", "torchaudio": "2.11.0+cu128", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 2.1, "platform": "cuda" }, "outputs": { "runtime": { "device": "cuda", "dtype": "bfloat16", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.0022294684313237667, -0.0015405465383082628, -0.0028790475334972143, -0.021152501925826073, -0.00300717749632895 ], [ -0.0006033745594322681, -0.0004941195948049426, -0.0006254147156141698, -0.009660872630774975, -0.0011587579501792789 ], [ -0.00048792376765049994, -0.00033241944038309157, -0.00032109825406223536, -0.01637672632932663, -0.0007503792876377702 ], [ -0.0035892606247216463, -0.0022573007736355066, -0.003715636907145381, -0.008681531064212322, -0.003154185600578785 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50375, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "continued_longform_tokens": [ [ 50364, 2182, 51864, 50406, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50257, 50257 ], [ 50364, 3092, 3344, 5566, 51864, 50406, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259 ] ], "training": { "loss": 0.004150390625, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "local", "framework": "transformers", "variant": "eager", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "7acfb01aa91f05eb0a1507e00878c3e42901e2cc", "environment": { "python": "3.10.12", "transformers": "5.19.0.dev0", "torch": "2.11.0+cu128", "torchvision": "0.26.0+cu128", "torchaudio": "2.11.0+cu128", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 2.08, "platform": "cuda" }, "outputs": { "runtime": { "device": "cuda", "dtype": "float32", "attn_implementation": "eager" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.0022017541341483593, -0.0015463787131011486, -0.002830310957506299, -0.02124050073325634, -0.002998025855049491 ], [ -0.0006121906917542219, -0.0004926898400299251, -0.0005983707960695028, -0.009473016485571861, -0.0011297041783109307 ], [ -0.00047851080307736993, -0.0003327769518364221, -0.00032360086333937943, -0.016908183693885803, -0.0007656264933757484 ], [ -0.0035335503052920103, -0.002206512028351426, -0.0036381976678967476, -0.008775833994150162, -0.0031948259565979242 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50384, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "continued_longform_tokens": [ [ 50364, 2182, 51864, 50406, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50257, 50257 ], [ 50364, 3092, 3344, 5566, 51864, 50406, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259 ] ], "training": { "loss": 0.0041640279814600945, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "local", "framework": "transformers", "variant": "default", "target": "mic-whisper-tiny-slim", "kind": "fixture", "revision": "7acfb01aa91f05eb0a1507e00878c3e42901e2cc", "environment": { "python": "3.10.12", "transformers": "5.19.0.dev0", "torch": "2.11.0+cu128", "torchvision": "0.26.0+cu128", "torchaudio": "2.11.0+cu128", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 1.92, "platform": "cuda" }, "outputs": { "runtime": { "device": "cuda", "dtype": "float32", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "generated_text": [ " red", " green", " blue", " yellow" ], "label_logprobs": [ [ -0.0022017541341483593, -0.0015463787131011486, -0.002830310957506299, -0.02124038338661194, -0.002998025855049491 ], [ -0.0006121906917542219, -0.0004926898400299251, -0.0005983707960695028, -0.009473016485571861, -0.0011297041783109307 ], [ -0.00047851080307736993, -0.0003327769518364221, -0.00032360086333937943, -0.016908183693885803, -0.0007656264933757484 ], [ -0.0035335503052920103, -0.002206512028351426, -0.0036381976678967476, -0.008775833994150162, -0.0031948259565979242 ] ], "timestamped_tokens": [ [ 50384 ], [ 50384 ], [ 50384 ], [ 50384 ] ], "timestamped_text": [ "<|0.40|>", "<|0.40|>", "<|0.40|>", "<|0.40|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "assisted_tokens": [ [ 2182 ], [ 3092 ], [ 3344 ], [ 5566 ] ], "longform_tokens": [ [ 50384, 50373, 2182, 2182, 2182, 2182, 2182, 2182, 2182 ], [ 50384, 50373, 50259, 2182, 2182, 2182, 2182, 2182, 2182 ] ], "continued_longform_tokens": [ [ 50364, 2182, 51864, 50406, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50257, 50257 ], [ 50364, 3092, 3344, 5566, 51864, 50406, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259, 50259 ] ], "training": { "loss": 0.004164022393524647, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "local", "framework": "transformers", "variant": "bfloat16", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.12", "transformers": "5.19.0.dev0", "torch": "2.11.0+cu128", "torchvision": "0.26.0+cu128", "torchaudio": "2.11.0+cu128", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 2.19, "platform": "cuda" }, "outputs": { "runtime": { "device": "cuda", "dtype": "bfloat16", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.6290202140808105, -0.0002936885575763881, -0.5260587930679321, -11.551589965820312, -2.010679244995117 ], [ -2.488107919692993, -0.00014959646796341985, -0.565740704536438, -11.835585594177246, -1.722854733467102 ], [ -3.080705165863037, -0.00024423000286333263, -0.4836554527282715, -11.917319297790527, -1.5711711645126343 ], [ -2.4570846557617188, -0.00021550717065110803, -0.39499542117118835, -12.31498908996582, -1.6834447383880615 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "continued_longform_tokens": [ [ 50364, 2182, 51864, 50364, 264, 50464, 50257, 50257 ], [ 50364, 3092, 3344, 5566, 51864, 50364, 5566, 50614 ] ], "training": { "loss": 3.359375, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "local", "framework": "transformers", "variant": "eager", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.12", "transformers": "5.19.0.dev0", "torch": "2.11.0+cu128", "torchvision": "0.26.0+cu128", "torchaudio": "2.11.0+cu128", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 2.37, "platform": "cuda" }, "outputs": { "runtime": { "device": "cuda", "dtype": "float32", "attn_implementation": "eager" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.635976791381836, -0.0002809368306770921, -0.560219943523407, -11.560050964355469, -2.0471909046173096 ], [ -2.407416820526123, -0.00014232576359063387, -0.5749149322509766, -11.81566047668457, -1.7347147464752197 ], [ -3.10595440864563, -0.0002119316632160917, -0.5115054845809937, -11.908812522888184, -1.5434720516204834 ], [ -2.423513650894165, -0.00019596086349338293, -0.44273802638053894, -12.329566955566406, -1.6896250247955322 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "continued_longform_tokens": [ [ 50364, 2182, 51864, 50364, 264, 50464, 50257, 50257 ], [ 50364, 3092, 3344, 5566, 51864, 50364, 5566, 50614 ] ], "training": { "loss": 3.3646082878112793, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240{ "recorded_with": { "contract": "hf-internal-testing/Whisper-integration", "contract_revision": "local", "framework": "transformers", "variant": "default", "target": "whisper-tiny", "kind": "checkpoint", "revision": "169d4a4341b33bc18d8881c4b69c2e104e1cc0af", "environment": { "python": "3.10.12", "transformers": "5.19.0.dev0", "torch": "2.11.0+cu128", "torchvision": "0.26.0+cu128", "torchaudio": "2.11.0+cu128", "tokenizers": "0.23.1", "numpy": "1.26.4", "pillow": "12.2.0", "accelerate": "1.13.0", "safetensors": "0.8.0", "huggingface-hub": "1.32.0", "sentencepiece": "0.2.1", "protobuf": "6.33.6", "librosa": "0.11.0", "soundfile": "0.13.1", "scipy": "1.15.3", "local_patches": [ "config-field-generation-params", "masked-spec-embed-init", "whisper-decode-tensor-batch" ] }, "seconds": 1.76, "platform": "cuda" }, "outputs": { "runtime": { "device": "cuda", "dtype": "float32", "attn_implementation": "sdpa" }, "generated_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "generated_text": [ " You", " You", " you", " You" ], "label_logprobs": [ [ -2.635981321334839, -0.0002810560108628124, -0.5602189898490906, -11.560056686401367, -2.047189474105835 ], [ -2.407421588897705, -0.00014232576359063387, -0.5749133229255676, -11.815662384033203, -1.7347092628479004 ], [ -3.1059577465057373, -0.0002119316632160917, -0.5115042328834534, -11.908805847167969, -1.543474793434143 ], [ -2.423509120941162, -0.00019596086349338293, -0.44273534417152405, -12.329566955566406, -1.6896235942840576 ] ], "timestamped_tokens": [ [ 50364, 363, 26345, 0, 50414 ], [ 50364, 4621, 0, 50414, 50257 ], [ 50364, 1044, 291, 13, 50414 ], [ 50364, 2411, 50414, 50257, 50257 ] ], "timestamped_text": [ "<|0.00|> BOOM!<|1.00|>", "<|0.00|> Bye!<|1.00|><|endoftext|>", "<|0.00|> Thank you.<|1.00|>", "<|0.00|> .<|1.00|><|endoftext|><|endoftext|>" ], "feature_extractor_config_keys": [ "chunk_length", "feature_extractor_type", "feature_size", "hop_length", "mel_filters", "n_fft", "n_samples", "nb_max_frames", "padding_side", "padding_value", "processor_class", "return_attention_mask", "sampling_rate" ], "max_length_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "assisted_tokens": [ [ 509 ], [ 509 ], [ 291 ], [ 509 ] ], "longform_tokens": [ [ 50364, 286, 478, 516, 281, 360, 257, 707, 50364, 286, 478, 516, 281, 360, 257, 707 ], [ 50364, 1044, 291, 13, 50464, 50364, 1044, 291, 13, 50464, 50257, 50257, 50257, 50257, 50257, 50257 ] ], "continued_longform_tokens": [ [ 50364, 2182, 51864, 50364, 264, 50464, 50257, 50257 ], [ 50364, 3092, 3344, 5566, 51864, 50364, 5566, 50614 ] ], "training": { "loss": 3.3646080493927, "gradients": { "model.encoder.conv1.weight": true, "model.decoder.layers.0.encoder_attn.q_proj.weight": true }, "updated": true } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185# Whisper: speech recognition with Transformers
This page is the Transformers contract of the Whisper MIC and also a usage example. [doc-builder](https://github.com/huggingface/doc-builder/blob/main/docs/runnable-code-blocks.md) renders the `runnable` blocks below as documentation, and its pytest plugin runs them as written against `openai/whisper-tiny`. The MIC runner runs the same blocks against each slim fixture and each checkpoint in [`integration.json`](../../integration.json). Lines marked `# doc-builder: hide` only matter there: they swap in the pinned checkpoint or variant and print the result record.
The audio is synthetic, so the example runs offline: four one-second clips, each a distinct pair of tones. A real checkpoint transcribes them as noise; the slim fixture is trained to name them.
## Transcribe a batch
```py runnable:transcribeimport math
import torchfrom transformers import WhisperForConditionalGeneration, WhisperProcessor, set_seedimport json # doc-builder: hideimport os # doc-builder: hide
model_id = "openai/whisper-tiny"model_id = os.environ.get("MIC_MODEL", model_id) # doc-builder: hidevariant = json.loads(os.environ.get("MIC_MODEL_KWARGS", "{}")) # doc-builder: hidedevice = "cuda" if torch.cuda.is_available() else "cpu"set_seed(0) # seeds torch, NumPy, and Python: loading, dropout, and data augmentation draw random numbers
processor = WhisperProcessor.from_pretrained(model_id)model = WhisperForConditionalGeneration.from_pretrained(model_id).to(device)if variant: # doc-builder: hide model = WhisperForConditionalGeneration.from_pretrained(model_id, **variant).to(device)
sampling_rate = 16000half = torch.arange(sampling_rate // 2) / sampling_ratetones = [(220, 880), (440, 1320), (660, 330), (990, 550)]clips = [torch.cat([torch.sin(2 * math.pi * a * half), torch.sin(2 * math.pi * b * half)]).mul(0.5).numpy() for a, b in tones]inputs = processor(clips, sampling_rate=sampling_rate, return_tensors="pt").to(device, model.dtype) # floating-point inputs follow the model's dtype
generated = model.generate(inputs.input_features, language="en", task="transcribe", max_new_tokens=8)print(processor.batch_decode(generated, skip_special_tokens=True))```
## Transcribe with timestamps
Whisper can predict segment timestamps; decoding with `decode_with_timestamps=True` keeps them in the text. Integrations also read the feature extractor's configuration without building a processor.
```py runnable:transcribe:3from transformers.models.auto.feature_extraction_auto import get_feature_extractor_config
timestamped = model.generate(inputs.input_features, language="en", task="transcribe", return_timestamps=True, max_new_tokens=8)timestamped_text = processor.batch_decode(timestamped, decode_with_timestamps=True)print(timestamped_text)
feature_config = get_feature_extractor_config(model_id)print(sorted(feature_config))```
## Limit the transcript length
For Whisper, `max_length` counts transcript tokens: `generate` adds the forced start, language, and task tokens on top.
```py runnable:transcribe:3limited = model.generate(inputs.input_features, language="en", task="transcribe", max_length=1)print(processor.batch_decode(limited, skip_special_tokens=True))```
## Speculative decoding
A smaller decoder-only Whisper can draft tokens that the full model verifies, as [Distil-Whisper](https://huggingface.co/distil-whisper/distil-large-v3) does. Here the checkpoint's own decoder, loaded as `WhisperForCausalLM`, is the assistant; the transcript must not change. Assisted generation takes one clip at a time.
```py runnable:transcribe:3from transformers import WhisperForCausalLM
assistant = WhisperForCausalLM.from_pretrained(model_id).to(device)if variant: # doc-builder: hide assistant = WhisperForCausalLM.from_pretrained(model_id, **variant).to(device)assisted = [ model.generate(features[None], language="en", task="transcribe", max_new_tokens=8, assistant_model=assistant)[0].tolist() for features in inputs.input_features]print(processor.batch_decode(assisted, skip_special_tokens=True))```
## Transcribe long audio in a batch
Audio longer than 30 seconds is transcribed segment by segment. Keep the full audio (`truncation=False`), pad the batch to its longest clip, and pass the attention mask; `condition_on_prev_tokens=True` prompts each segment with the previous one's text.
```py runnable:transcribe:3long_clips = [ torch.cat([torch.from_numpy(clips[(start + k) % len(clips)]) for k in range(seconds)]).numpy() for start, seconds in ((0, 36), (1, 32))]long_inputs = processor( long_clips, sampling_rate=sampling_rate, return_tensors="pt", truncation=False, padding="longest", return_attention_mask=True).to(device, model.dtype)longform = model.generate( **long_inputs, language="en", task="transcribe", condition_on_prev_tokens=True, return_timestamps=True, temperature=0.0, max_new_tokens=8,)print(processor.batch_decode(longform, skip_special_tokens=True))```
## Continue from transcripts of different lengths
Previous-segment transcripts can have different lengths across a batch. Whisper left-pads the shorter prompt before decoding the next segment. This reproducible example constrains the first segment to one word in the first row and three words in the second; the remaining audio is transcribed freely. The custom processor only chooses the first segment's tokens.
```py runnable:transcribe:3from transformers import LogitsProcessor
tokenizer = processor.tokenizertimestamp_begin = tokenizer.convert_tokens_to_ids("<|0.00|>")previous_token = tokenizer.convert_tokens_to_ids("<|startofprev|>")first_segment_tokens = [ [timestamp_begin] + tokenizer.encode(text, add_special_tokens=False) + [timestamp_begin + 1500, model.config.eos_token_id] for text in (" red", " green blue yellow")]
class FirstSegmentTranscript(LogitsProcessor): def __call__(self, input_ids, scores): if any(previous_token in row.tolist() for row in input_ids): return scores # The initial prefix is start-of-transcript, English, transcribe. step = input_ids.shape[-1] - 3 constrained = torch.full_like(scores, -float("inf")) for row, tokens in enumerate(first_segment_tokens): token = tokens[step] if step < len(tokens) else model.config.eos_token_id constrained[row, token] = 0 return constrained
continuation_inputs = processor( [clip.repeat(36) for clip in clips[:2]], sampling_rate=sampling_rate, return_tensors="pt", truncation=False, padding="longest", return_attention_mask=True,).to(device, model.dtype)continued = model.generate( **continuation_inputs, language="en", task="transcribe", condition_on_prev_tokens=True, return_timestamps=True, temperature=0.0, max_new_tokens=12, logits_processor=[FirstSegmentTranscript()],)print(processor.batch_decode(continued, skip_special_tokens=True))```
## One training step
```py runnable:transcribe:3transcripts = [" red", " green", " blue", " yellow"]processor.tokenizer.set_prefix_tokens(language="english", task="transcribe", predict_timestamps=False)targets = processor.tokenizer(transcripts, return_tensors="pt", padding=True).to(device)decoder_input_ids = targets.input_ids[:, :-1]labels = targets.input_ids[:, 1:].masked_fill(targets.attention_mask[:, 1:] == 0, -100)
with torch.no_grad(): # doc-builder: hide # Teacher-forced log-probabilities of the reference transcripts. logprobs = model(input_features=inputs.input_features, decoder_input_ids=decoder_input_ids).logits.float().log_softmax(-1) label_logprobs = logprobs.gather(-1, labels.clamp(min=0)[..., None])[..., 0].masked_fill(labels == -100, 0.0)
model.train()optimizer = torch.optim.SGD(model.parameters(), lr=0.01)loss = model(input_features=inputs.input_features, decoder_input_ids=decoder_input_ids, labels=labels).lossloss.backward()before = {name: p.detach().clone() for name, p in model.named_parameters()} # doc-builder: hideoptimizer.step()print(f"loss: {loss.item():.4f}")
if os.environ.get("MIC_RUNNER"): # doc-builder: hide named = dict(model.named_parameters()) checked = ("model.encoder.conv1.weight", "model.decoder.layers.0.encoder_attn.q_proj.weight") result = { "runtime": { "device": model.device.type, "dtype": str(model.dtype).removeprefix("torch."), "attn_implementation": model.config._attn_implementation, }, "generated_tokens": generated.tolist(), "generated_text": processor.batch_decode(generated, skip_special_tokens=True), "label_logprobs": label_logprobs.tolist(), "timestamped_tokens": timestamped.tolist(), "timestamped_text": timestamped_text, "feature_extractor_config_keys": sorted(feature_config), "max_length_tokens": limited.tolist(), "assisted_tokens": assisted, "longform_tokens": longform.tolist(), "continued_longform_tokens": continued.tolist(), "training": { "loss": loss.item(), "gradients": {n: bool(named[n].grad is not None and torch.count_nonzero(named[n].grad) > 0 and torch.isfinite(named[n].grad).all()) for n in checked}, "updated": any(not torch.equal(p, before[n]) for n, p in named.items()), }, } print(json.dumps(result))```.gitattributes+2-2
.mic-repo.jsonAdded+17
README.md+8-12
docs/source-cards/fixture.mdAdded+19
docs/source-cards/integration.mdAdded+26
integration.jsonAdded+104
integrations/transformers/expectations/cpu-arm64/mic-whisper-tiny-slim.eager.jsonAdded+187
integrations/transformers/expectations/cpu-arm64/mic-whisper-tiny-slim.jsonAdded+187
integrations/transformers/expectations/cpu-arm64/whisper-tiny.eager.jsonAdded+217
integrations/transformers/expectations/cpu-arm64/whisper-tiny.jsonAdded+217
integrations/transformers/expectations/cpu-x86_64/mic-whisper-tiny-slim.eager.jsonAdded+188
integrations/transformers/expectations/cpu-x86_64/mic-whisper-tiny-slim.jsonAdded+188
integrations/transformers/expectations/cpu-x86_64/whisper-tiny.eager.jsonAdded+218
integrations/transformers/expectations/cpu-x86_64/whisper-tiny.jsonAdded+218
integrations/transformers/expectations/cuda/mic-whisper-tiny-slim.bfloat16.jsonAdded+228
integrations/transformers/expectations/cuda/mic-whisper-tiny-slim.eager.jsonAdded+228
integrations/transformers/expectations/cuda/mic-whisper-tiny-slim.jsonAdded+228
integrations/transformers/expectations/cuda/whisper-tiny.bfloat16.jsonAdded+240
integrations/transformers/expectations/cuda/whisper-tiny.eager.jsonAdded+240
integrations/transformers/expectations/cuda/whisper-tiny.jsonAdded+240
integrations/transformers/usage.mdAdded+185