pub fn generate(
model: &dyn MIBackend,
device: &Device,
mask_token_id: u32,
prompt_ids: &[u32],
config: &DiffusionSamplingConfig,
) -> Result<Vec<u32>>Expand description
Generate one sequence by masked-diffusion ancestral sampling.
Returns the final token ids (length config.seq_len, no [MASK] left).
prompt_ids is clamped to the prefix and carried over unchanged.
ยงErrors
Returns MIError::Model on a forward-pass or tensor
failure.