ONNX Model Zoo

R321-hf/whisper-small-hybrid-int8

By R321-hf · ↓ 5 · ♥ 0 · Updated 2026-02-24

What's in this repo

This page lists the files in R321-hf/whisper-small-hybrid-int8, including decoder_model.onnx, encoder_model.onnx.

  • 2 ONNX models (.onnx files)
  • 10 files, including 5 .json, 2 .onnx, 1 .md, 1 .txt
  • Last updated 2026-02-24

ONNX files

File Size Download
decoder_model.onnx — Download
encoder_model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README


license: mit language:

  • en
  • ko
  • ja
  • zh
  • de
  • es
  • fr
  • ar tags:
  • whisper
  • onnx
  • quantized
  • int8
  • speech-recognition
  • hybrid-quantization base_model: openai/whisper-small

Whisper Small Hybrid INT8 Quantized ONNX Model

This is a quantized version of openai/whisper-small optimized for mobile deployment with ONNX Runtime.

Quantization Details

  • Method: Hybrid INT8 Dynamic Quantization
  • MatMul/Gemm layers: INT8 quantized (for size reduction)
  • Conv layers: FP32 (excluded to avoid ConvInteger operations)
  • Framework: ONNX Runtime

This hybrid approach ensures compatibility with ONNX Runtime Mobile, which does not support ConvInteger operations.

Model Specifications

Parameter Value
Hidden dimension 768
Attention heads 12
Encoder layers 12
Vocabulary size 51865
Max source positions 1500
Sample rate 16000 Hz

Files

File Description Size
encoder_model.onnx Quantized encoder ~100 MB
decoder_model.onnx Quantized decoder ~100 MB
tokenizer.json Tokenizer configuration ~2 MB
vocab.json Vocabulary file ~1 MB
merges.txt BPE merges file ~1 MB

Usage

Python (ONNX Runtime)

import onnxruntime as ort
import numpy as np
from transformers import WhisperProcessor

# Load processor
processor = WhisperProcessor.from_pretrained("R321-hf/whisper-small-hybrid-int8")

# Load models
encoder_session = ort.InferenceSession("encoder_model.onnx")
decoder_session = ort.InferenceSession("decoder_model.onnx")

# Prepare input (mel spectrogram)
mel_spectrogram = np.random.randn(1, 80, 3000).astype(np.float32)

# Run encoder
encoder_output = encoder_session.run(None, {"input_features": mel_spectrogram})

# Run decoder with initial tokens
decoder_input_ids = np.array([[50258]])  # BOS token
logits = decoder_session.run(None, {
    "decoder_input_ids": decoder_input_ids,
    "encoder_hidden_states": encoder_output[0]
})

Android (ONNX Runtime Mobile)

// Load encoder
val encoderSession = ortEnvironment.createSession("encoder_model.onnx", sessionOptions)

// Load decoder
val decoderSession = ortEnvironment.createSession("decoder_model.onnx", sessionOptions)

// Run inference
val melTensor = OnnxTensor.createTensor(ortEnvironment, melSpectrogram, longArrayOf(1, 80, 3000))
val encoderOutput = encoderSession.run(mapOf("input_features" to melTensor))

Compatibility

  • ONNX Runtime (Python)
  • ONNX Runtime Mobile (Android/iOS)
  • No ConvInteger operations
  • NNAPI compatible

License

MIT License (same as original Whisper model)

Credits

Model info

onnx whisper quantized int8 speech-recognition hybrid-quantization en ko ja zh de es
↓ 5 ♥ 0

Created: 2026-02-24

Updated: 2026-02-24

View on Hugging Face

Files (10)

.gitattributes
README.md
config.json
decoder_model.onnx ONNX
encoder_model.onnx ONNX
merges.txt
preprocessor_config.json
tokenizer.json
tokenizer_config.json
vocab.json

Related models