Skip to main content

Module normalize

Module normalize 

Source
Expand description

Repairs raw speech-recognition output into written text.

Punctuation, capitalization, filler removal, spoken numbers and dates rendered in written form, and self-corrections resolved to whatever the speaker landed on. Text in, text out: this stage never sees audio.

The model is “S1-mini” by “Superwhisper”, 596M parameters, Apache 2.0 plus a clause requiring it to keep that name and capitalization wherever it is used. llama.cpp reports 751632384 because the tied embedding is stored materialized and counted twice.

§The model card describes intent, not measured behaviour

Every behavioural claim in it that has been tested here has failed to reproduce: omitting the empty think block returns a <think> fragment rather than nothing, formal is not semi-formal plus expanded contractions, and the card’s own three-item lists example comes back as prose. The input FORMAT it documents is exact and worth following to the byte; its statements about what the model will do are not. Run the claim before building on it.

Re-exports§

pub use prompt::Context;
pub use prompt::Structure;
pub use prompt::Styling;
use std::io::Read as _; 🔒
use std::io::Seek as _; 🔒
use std::num::NonZeroU32; 🔒
use std::path::Path; 🔒
use std::path::PathBuf; 🔒
use std::sync::OnceLock; 🔒
use llama_cpp_2::context::params::LlamaContextParams; 🔒
use llama_cpp_2::llama_backend::LlamaBackend; 🔒
use llama_cpp_2::llama_batch::LlamaBatch; 🔒
use llama_cpp_2::model::LlamaModel; 🔒
use llama_cpp_2::model::params::LlamaModelParams; 🔒
use llama_cpp_2::LogOptions; 🔒
use llama_cpp_2::send_logs_to_tracing; 🔒

Modules§

lookup 🔒
Prompt-lookup speculative decoding.
prompt 🔒
The exact input format S1-mini was trained on.

Structs§

NormalizeOptions
Per-call settings. Default is what ships, so a caller that does not care constructs it without naming an axis.
Normalizer
A loaded normalizer. Holds the weights; cheap to call repeatedly.
Plan 🔒
How much room one call needs.
Session 🔒
A decoded prompt, ready to generate from.

Enums§

NormalizeError
Everything the normalizer can fail with.

Constants§

CAUSAL_ARCHS
The architectures this stage’s generator can run: llama.cpp’s causal text models.
GGUF_STRING 🔒
The format’s own type tag for a string value.
GPU_LAYERS 🔒
Offload everything; llama.cpp clamps this to the layers that exist and silently does nothing without an accelerated backend compiled in.

Functions§

architecture 🔒
The architecture a gguf declares, read from the file’s own header.
backend 🔒
llama.cpp’s backend is global to the process and may be initialized exactly once.
decode_piece 🔒
Decode one token’s bytes through a decoder the whole generation reuses. The decoder must persist across tokens: a piece can end mid-character, and a fresh decoder would replace both halves.
plan 🔒
The card’s ceiling is 1.3x the input plus 32, taken over the whole prompt rather than the transcript, so it sits looser than the figure it comes from.
read_string 🔒
One length-prefixed utf-8 value, bounded so a corrupt length cannot ask for an allocation nobody has.
read_u32 🔒
read_u64 🔒
skip_value 🔒
Step over one metadata value, by the format’s own type table. Anything the table does not name ends the walk, which the caller answers with the same refusal as a malformed header.