Lfm3AudioGenerator class final

Published generation weights only; does not load the ASR encoder. All matrix blocks are retained exactly. Their products take float activation inputs unless int8Inputs.

Constructors

Lfm3AudioGenerator.load(String mmproj, {bool int8Inputs = false})
Loads the generation weights of mmproj. With int8Inputs the depth decoder's and codec's Q4 products quantize their inputs to int8 per block of 32 and use the CPU's integer dot products, as the language model's CPU path does: speech generates about 1.4 times faster, and its arithmetic is no longer the float reference's, so sampled codes and the waveform differ (depth logits by about 1.4% relative L2). The output heads, products of one row, keep float inputs.
factory

Properties

codebooks → int
final
eosCode → int
no setter
fftSize → int
final
frameSamples → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
hiddenSize → int
final
int8Inputs → bool
Whether the depth decoder's and codec's products take int8 inputs (see Lfm3AudioGenerator.load).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampleRate → int
no setter
sampling → Lfm3SpeechSampling
The checkpoint's published speech sampling defaults.
final
variant → Lfm3SpeechVariant
Which checkpoint's prompt conventions the generated speech expects.
final
vocabSize → int
final

Methods

close() → void
depthLogits(Float32List hidden, List<int> codes, {void capture(String, Float32List)?, Iterable<int>? only}) → Float32List
One MaskGIT pass: -1 marks a masked codebook, others are known codes. Returns codebooks, vocabSize logits. No random sampling occurs here. With only, just those codebooks' rows are computed and the others stay zero: each row's arithmetic is the same either way.
feedback(List<int> codes) → Float32List
Sum of published per-codebook feedback embeddings for the language model.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sampleFrame(Float32List hidden, Random random, {double? temperature, int? topK, double? repetitionPenalty, int? repetitionWindow, List<List<int>> history = const []}) → List<int>
Three passes reveal four randomly ordered codebooks each. The penalty covers the codes of the last repetitionWindow frames of history. Omitted options use sampling; a null top-k there samples every code. Random seeds are Dart-specific.
startCodecStream() → LiquidCodecStream
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited