pub trait Engine: Send + 'static {
// Required method
fn generate(
&mut self,
req: &GenerateRequest,
on_text: &mut dyn FnMut(&str) -> bool,
) -> Result<Stats>;
}Expand description
A loaded model. on_text gets each piece of text as it is sampled and returns false to stop.
Required Methods§
fn generate( &mut self, req: &GenerateRequest, on_text: &mut dyn FnMut(&str) -> bool, ) -> Result<Stats>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".