pub enum ForwardEngine {
Llama(LlamaForward),
Phi(PhiForward),
}Expand description
Architecture-specific inference engine with KV-cache support.
Variants§
Llama(LlamaForward)
Phi(PhiForward)
Implementations§
Source§impl ForwardEngine
impl ForwardEngine
pub fn from_pretrained( info: ModelInfo, weight_paths: &[PathBuf], ) -> Result<Self>
pub fn from_weight_paths( info: ModelInfo, weight_paths: &[PathBuf], ) -> Result<Self>
pub fn from_weight_paths_with_backend( info: ModelInfo, weight_paths: &[PathBuf], backend: LlmBackendKind, ) -> Result<Self>
pub fn from_gguf(info: ModelInfo, path: &Path) -> Result<Self>
pub fn from_gguf_with_backend( info: ModelInfo, path: &Path, backend: LlmBackendKind, ) -> Result<Self>
pub fn reset_cache(&mut self)
pub fn forward_logits( &mut self, input_ids: &[u32], use_cache: bool, ) -> Result<Vec<f32>>
pub fn embed(&mut self, input_ids: &[u32]) -> Result<Vec<f32>>
Auto Trait Implementations§
impl Freeze for ForwardEngine
impl !RefUnwindSafe for ForwardEngine
impl Send for ForwardEngine
impl Sync for ForwardEngine
impl Unpin for ForwardEngine
impl UnsafeUnpin for ForwardEngine
impl !UnwindSafe for ForwardEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more