whisper-small for Kjarni
This is OpenAI's whisper-small, unchanged, hosted so it runs locally with Kjarni: speech to text in 99 languages from one native library, with no Python runtime, PyTorch, ffmpeg or CUDA. The model is about 970 MB and downloads on first use.
Usage
In Kjarni the model is called whisper-small. The examples transcribe jfk.wav, the
11-second public domain Kennedy clip that whisper.cpp ships as a sample:
curl -LO https://github.com/ggml-org/whisper.cpp/raw/master/samples/jfk.wav
Command line
curl -fsSL https://kjarni.ai/install.sh | sh # Windows: irm https://kjarni.ai/install.ps1 | iex
kjarni transcribe -m whisper-small jfk.wav
kjarni transcribe -m whisper-small jfk.wav --format srt > jfk.srt
And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.
Python
# pip install kjarni
from kjarni import Transcriber
transcriber = Transcriber("whisper-small", quiet=True)
result = transcriber.transcribe_file("jfk.wav")
print(result.language, result.text)
Rust
// cargo add kjarni anyhow tokio --features tokio/full
use kjarni::transcriber::Transcriber;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let transcriber = Transcriber::builder("whisper-small").quiet().build().await?;
let result = transcriber.transcribe_file("jfk.wav")?;
println!("{} {}", result.language, result.text);
Ok(())
}
C#
// dotnet add package Kjarni
using Kjarni;
using var transcriber = new Transcriber("whisper-small", quiet: true);
var result = transcriber.TranscribeFile("jfk.wav");
Console.WriteLine($"{result.Language} {result.Text}");
C++ (C++23)
#include <kjarni.hpp>
#include <iostream>
int main() {
kjarni::TranscriberOptions options;
options.model = "whisper-small";
auto transcriber = kjarni::Transcriber::create(options);
if (!transcriber) return 1;
auto result = transcriber->transcribe_file("jfk.wav");
if (!result) return 1;
std::cout << result->language << " " << result->text << "\n";
}
Go
// go get github.com/kjarni-ai/kjarni-go
package main
import (
"fmt"
"log"
kjarni "github.com/kjarni-ai/kjarni-go"
)
func main() {
transcriber, err := kjarni.NewTranscriber("whisper-small", kjarni.WithQuiet(true))
if err != nil {
log.Fatal(err)
}
defer transcriber.Close()
result, err := transcriber.TranscribeFile("jfk.wav")
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Language, result.Text)
}
Each prints the language code and the transcript, en and the text above. Without a
language Whisper detects it from the first 30 seconds; pass language="de" (--language de
on the command line) to fix it. WAV, MP3, FLAC, Ogg Vorbis, M4A, MP4 and AAC are read
without ffmpeg, and recordings of any length are transcribed in 30-second windows.
translate=True (--translate on the command line) writes English from speech in any of its languages.
word_timestamps=True in the libraries times every word. speakers=True (--speakers) labels who says each segment and word, with
Nemotron 3 Diarization. SRT and
WebVTT output come from --format srt and --format vtt, or result.to_srt().
To run on a GPU, add --gpu on the command line or pass device="gpu". It uses Vulkan, Metal
or DirectX 12, so AMD, Intel and Apple GPUs work as well as NVIDIA, with no CUDA. See the
Kjarni documentation for installation details.
Complete examples
Runnable projects in kjarni-examples:
- python-speech-to-text: transcribe a file to text and subtitles in Python; pass
whisper-smallas the model
What changed from the original
Nothing in the model. model.safetensors, config.json, generation_config.json, preprocessor_config.json, tokenizer.json, tokenizer_config.json, vocab.json, merges.txt, added_tokens.json, special_tokens_map.json and normalizer.json are byte for byte the same as in
openai/whisper-small at revision 973afd24965f72e36ca33b3055d56a652f456b4d. This README
replaces OpenAI's model card. The PyTorch, TensorFlow and Flax copies of the weights are
left out; Kjarni reads the safetensors file.
About the model
Whisper small is the 244-million-parameter multilingual model of OpenAI's Whisper family: transcription in 99 languages and translation of any of them into English. It is the smallest model that transcribes most languages well, and Kjarni's default. Released by OpenAI under the Apache License 2.0.
See OpenAI's model card, the Whisper repository and the paper for training data, benchmarks and intended use.
@misc{radford2022whisper,
doi = {10.48550/ARXIV.2212.04356},
url = {https://arxiv.org/abs/2212.04356},
author = {Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
title = {Robust Speech Recognition via Large-Scale Weak Supervision},
publisher = {arXiv},
year = {2022},
copyright = {arXiv.org perpetual, non-exclusive license}
}
License
The Apache License 2.0, as the original. Kjarni and this hosting are not affiliated with or endorsed by OpenAI.
- Downloads last month
- 4
Model tree for kjarni-ai/whisper-small
Base model
openai/whisper-small