Skip to main content

Engine

Trait Engine 

Source
pub trait Engine: Send + Sync {
    // Required methods
    fn load_model<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        model_path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn unload_model<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn infer<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        prompt: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Receiver<Result<InferenceEvent>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn load_model<'life0, 'life1, 'async_trait>( &'life0 mut self, model_path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a model from a path

Source

fn unload_model<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unload the currently loaded model to free resources

Source

fn infer<'life0, 'life1, 'async_trait>( &'life0 mut self, prompt: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Receiver<Result<InferenceEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run inference Returns a channel of InferenceEvents

Implementors§