Skip to main content

GrammarMasker

Trait GrammarMasker 

Source
pub trait GrammarMasker {
    // Required method
    fn mask(&self, recent: &[Token], vocab: usize) -> Vec<bool>;
}
Expand description

Grammar Constraint port (llguidance — context 4). Returns a per-token allow mask of length vocab; true = legal this step.

Required Methods§

Source

fn mask(&self, recent: &[Token], vocab: usize) -> Vec<bool>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§