Downloads · 30 days
14
23% of all-time downloads
thoratsr7/whisper-base-onnx
whisper-base-onnx is a automatic speech recognition model from thoratsr7. Use it when you need speech turned into text. The card lists the license as apache-2.0.
OpenAI Whisper base model converted to ONNX format for onnx-asr.
Downloads · 30 days
14
23% of all-time downloads
All-time downloads
60
Public
Repo size
505 MB
Likes
0
Public
Click a slice to open those files.
.onnx505 MB · 100%
From the Hugging Face model README
OpenAI Whisper base model converted to ONNX format for onnx-asr.
Install onnx-asr
pip install onnx-asr[cpu,hub]
Load whisper-base model and recognize wav file
import onnx_asr
model = onnx_asr.load_model("whisper-base")
print(model.recognize("test.wav")) # Auto-detect lang (slower)
print(model.recognize("test.wav", language="en"))
Read onnxruntime instruction for convert Whisper to ONNX.
Download model and export with Beam Search and Forced Decoder Input Ids:
python3 -m onnxruntime.transformers.models.whisper.convert_to_onnx -m openai/whisper-base --output ./whisper-onnx --use_forced_decoder_ids --optimize_onnx --precision fp32
Save tokenizer config
from transformers import WhisperTokenizer
processor = WhisperTokenizer.from_pretrained("openai/whisper-base")
processor.save_pretrained("whisper-onnx")