openaiwhisper-small
TransformersASR¶
Runs the generic Transformers ASR adapter with Whisper language/task controls and timestamps.
Parameter metadata: Exact Safetensors total reported by the Hugging Face model API for the registered default checkpoint, retrieved 2026-08-13.
Usage¶
Complete the VoiceHub installation once, then run this repository-authored example. Model pages intentionally contain no package-install command.
This example is maintained against VoiceHub's public API; it is not copied from an upstream demo or package README.
Model-specific path: Runs the generic Transformers ASR adapter with Whisper language/task controls and timestamps.
Inputs and controls: Use this adapter only for checkpoints compatible with the Transformers speech-recognition pipeline.
from pathlib import Path
from voicehub import AutoModelForSpeechRecognition
AUDIO_FILE = Path("speech.wav")
if not AUDIO_FILE.is_file():
raise FileNotFoundError(AUDIO_FILE)
model = AutoModelForSpeechRecognition.from_pretrained(
'openai/whisper-small',
model_type='asr_transformers',
device="cuda",
lazy_load=True,
)
output = model.transcribe(
AUDIO_FILE,
language="en",
task="transcribe",
return_timestamps=True,
chunk_length_s=30.0,
)
print(output.text)
for segment in output.segments:
print(segment.start, segment.end, segment.text, segment.confidence)
Use authorized recordings. Verify hardware needs and pin a revision in production.
Overview¶
asr_transformers is a VoiceHub automatic speech recognition
integration. This page is generated from its registry contract. Open the asr_transformers Colab notebook.
| Property | Value |
|---|---|
| Task | Automatic speech recognition |
| Architecture | native-asr-dispatch |
| Runtime | VoiceHub-native |
| Languages | en, zh, de, es, … complete audited list below |
| Capabilities | automatic-speech-recognition, multilingual, timestamps, safetensors, fine-tuning, ctc, speech-seq2seq, voicehub-native, native-runtime |
| Reusable components | — |
| Normalized output | ASROutput |
Language support¶
Supported language abbreviations
en, zh, de, es, ru, ko, fr, ja, pt, tr, pl, ca, nl, ar, sv, it, id, hi, fi, vi, he, uk, el, ms, cs, ro, da, hu, ta, no, th, ur, hr, bg, lt, la, mi, ml, cy, sk, te, fa, lv, bn, sr, az, sl, kn, et, mk, br, eu, is, hy, ne, mn, bs, kk, sq, sw, gl, mr, pa, si, km, sn, yo, so, af, oc, ka, be, tg, sd, gu, am, yi, lo, uz, fo, ht, ps, tk, nn, mt, sa, lb, my, bo, tl, mg, as, tt, haw, ln, ha, ba, jw, su
Paper and GitHub¶
- Paper: No dedicated upstream research paper is published for this integration.
- Upstream GitHub: Transformers
- VoiceHub source: VoiceHub model implementation
Configuration¶
Load configuration without constructing the model:
from voicehub import AutoConfig
config = AutoConfig.for_model('asr_transformers')
print(config.model_type)
| Property | Value |
|---|---|
| Canonical model type | asr_transformers |
| Configuration class | TransformersASRConfig |
| Architecture class | TransformersASRForSpeechRecognition |
Processing¶
Create the registered processor without allocating model weights:
from voicehub import AutoProcessor
processor = AutoProcessor.from_pretrained(
'openai/whisper-small',
model_type='asr_transformers',
)
print(type(processor).__name__)
Inference¶
The Usage example returns ASROutput through AutoModelForSpeechRecognition.
Input and output contract¶
| Property | Value |
|---|---|
| Readiness | integrated-raw |
| Data architecture | native-dispatch |
| Sample rate | 16,000 Hz |
| Contract getter | get_asr_dataset_spec('asr_transformers') |
| Variant | Required fields | One of | Boundary | Other rules |
|---|---|---|---|---|
raw-audio |
audio |
text / transcription / transcript | Source | at most one: text / transcription / transcript |
feature-model-ready |
input_features, labels |
— | Prepared | — |
waveform-model-ready |
input_values, labels |
— | Prepared | — |
Checkpoint-dispatched raw and cached inputs for native Transformers ASR families. See the data workflow.
Training and optimization¶
Use available_optimization_passes() to discover reversible public passes.
Unsupported runtime or hardware fails closed before mutation.
Training contract¶
| Property | Value |
|---|---|
| Support | native |
| Family | native-asr-dispatch |
| Recipe | single-phase |
| Default phase | speech_recognition |
| Training checkpoint | openai/whisper-small |
| Native training graph | yes |
| Phase | Kind | Components | Required inputs | Loss keys |
|---|---|---|---|---|
speech_recognition |
objective | model |
— | loss |
The integration accepts its declared source or prepared contract directly. Call model.validate_training_support() first, then follow the
training workflow.
Checkpoints, provenance, license, and limitations¶
| Property | Value |
|---|---|
| Default checkpoint | openai/whisper-small |
| Hugging Face ID | openai/whisper-smallRepository availability verified through the Hugging Face model API on 2026-08-11; pin a revision before production use. |
| Checkpoint status | Registry default; pin an immutable revision for production and reproducible evidence |
| Optional dependency extra | Core package |
| Hardware and runtime | Usage selects cuda; verify checkpoint-specific requirements |
| Real-checkpoint evidence | Release evidence; a registry default alone is not execution evidence |
| Implementation | voicehub.models.asr_transformers.modeling_asr_transformers.TransformersASRForSpeechRecognition |
| Configuration | voicehub.models.asr_transformers.configuration_asr_transformers.TransformersASRConfig |
| Source provenance | voicehub/architectures/moonshine/SOURCE.json |
| License | Checkpoint-specific |
No VoiceHub-specific license override is registered. Verify the checkpoint and upstream source terms before use.
Confirm the checkpoint revision, access terms, provenance, and license.
Limitations¶
- No integration-specific checkpoint limitation is registered. Verify the selected checkpoint revision and its documented runtime requirements.
- Validate memory, precision, and optional dependencies on the target system.
- Public optimizations fail closed when the runtime or hardware cannot satisfy their validation contract; an unavailable pass is not reported as applied.
- Contract tests do not replace the linked released-checkpoint evidence.
Public API¶
Use the stable configuration, processor, and task-model facades below.
Configuration
TransformersASRConfig¶
Parameters¶
**config_kwargs— Configuration fields validated by TransformersASRConfig.
Model
TransformersASRForSpeechRecognition¶
Parameters¶
pretrained_model_name_or_path— Hub ID or compatible local directory.model_type— Canonical model type; use 'asr_transformers'.config— Optional preloaded TransformersASRConfig instance.**model_kwargs— Model-specific loading arguments.
from voicehub import get_model_spec
spec = get_model_spec('asr_transformers')
print(spec.display_name, spec.task.value)
| Purpose | Public object |
|---|---|
| Discover | get_model_spec('asr_transformers') |
| Load and run | AutoModelForSpeechRecognition |
| Configure | TransformersASRConfig |
| Process | AutoProcessor |
| Model implementation | TransformersASRForSpeechRecognition |
| Normalized output | ASROutput |
| Training contract | get_training_spec('asr_transformers') |
| Optimization lifecycle | available_optimization_passes, apply_optimization_plan, optimization_manifest, restore_optimization_plan |
See all model guides, inference, and the training matrix.