Instructions to use Sky-Kim/com.sky.sentis.whisper with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- unity-sentis
How to use Sky-Kim/com.sky.sentis.whisper with unity-sentis:
string modelName = "[Your model name here].sentis"; Model model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName); IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model); // Please see provided C# file for more details
- Notebooks
- Google Colab
- Kaggle
sentis-whisper
Whisper speech-to-text converted to Unity Inference Engine (Sentis) FP16. Both tiny and base
sizes are included.
Files
logmel_spectrogram_fp16.sentis # audio -> log-mel front end
vocab.json # token vocabulary for de-tokenization
tiny/ base/
encoder_model_fp16.sentis # mel -> encoder_hidden_states
decoder_model_fp16.sentis # first pass: tokens (+ encoder states) -> logits + present KV
decoder_with_past_model_fp16.sentis # subsequent steps: next token + past KV -> logits + new KV
WhisperRecognizer.cs # self-contained Unity Sentis inference
Pipeline
This is a four-model greedy-decode pipeline (encoder KV is computed once; the decoder loop carries its own self-attention KV so cost is linear in tokens):
- Log-mel β audio (16 kHz mono) β log-mel spectrogram tensor.
- Encoder β mel β
encoder_hidden_states(run once per utterance). - Decoder (prefill) β
decoder_modelover the prompt tokens (<|startoftranscript|>, language,<|transcribe|>,<|notimestamps|>) β first-token logits +present.*KV. - Decoder loop β
decoder_with_past_modelwith the last token +past_key_values.*β next-token logits + updated KV. Argmax each step (greedy), append, repeat until<|endoftext|>. - De-tokenize the collected ids with
vocab.json.
A complete self-contained implementation lives in WhisperRecognizer.cs
(log-mel β encoder β incremental KV greedy decode, language auto-detect + lock, LocalAgreement-2
streaming partials, byte-level BPE de-tokenization, GPU warmup). Minimal usage:
var recognizer = new WhisperRecognizer(WhisperRecognizer.ModelSize.Tiny, BackendType.GPUCompute);
recognizer.Load(modelRoot); // folder holding vocab.json + logmel + tiny/ and base/ subfolders
recognizer.FinalTranscript += text => Debug.Log(text);
recognizer.BeginUtterance();
recognizer.PushSamples(samples, samples.Length, startSequence); // 16 kHz mono, monotonic sequence
recognizer.EndUtterance();
License & attribution
MIT. Converted from openai/whisper (MIT). The weights are derivatives of the upstream Whisper checkpoints; see the upstream license for the original terms.
- Downloads last month
- 44