Skip to content

dew.interop.diffusion_gemma

Assemble a DiffusionGemma for the shared pretrained-model loader.

The checkpoint stores its text weights under two prefixes, the encoder’s and the decoder’s, and both map into one Flax subtree. The vision and projection weights keep subtrees of their own. This module opens no checkpoint or processor, and it adds no public loading function for this family; the shared loader calls it.

NameSummary
buildBuild the native DiffusionGemma module from a checkpoint’s config, without allocating parameters.

function source

def build(
config: Mapping[str, object],
*,
dtype: str | None = 'bfloat16',
attention_impl: AttentionImpl = 'auto',
max_seq_len: int | None = None,
) -> DiffusionGemma

Build the native DiffusionGemma module from a checkpoint’s config, without allocating parameters.

config is the diffusion_gemma wrapper config; any other config, or one with an audio encoder, raises ValueError. canvas_length is 256 when the config omits it.