Struct llama_cpp_rs::LLama
source · pub struct LLama { /* private fields */ }
Implementations§
source§impl LLama
impl LLama
pub fn new(model: String, opts: &ModelOptions) -> Result<Self, Box<dyn Error>>
pub fn free_model(&self)
pub fn load_state(&self, state: String) -> Result<(), Box<dyn Error>>
pub fn save_state(&self, dst: String) -> Result<(), Box<dyn Error>>
pub fn eval( &self, text: String, opts: &mut PredictOptions ) -> Result<(), Box<dyn Error>>
pub fn token_embeddings( &self, tokens: Vec<i32>, opts: &mut PredictOptions ) -> Result<Vec<f32>, Box<dyn Error>>
pub fn embeddings( &self, text: String, opts: &mut PredictOptions ) -> Result<Vec<f32>, Box<dyn Error>>
pub fn set_token_callback( &self, callback: Option<Box<dyn Fn(String) -> bool + Send + 'static>> )
pub fn predict( &self, text: String, opts: PredictOptions ) -> Result<String, Box<dyn Error>>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LLama
impl !Send for LLama
impl !Sync for LLama
impl Unpin for LLama
impl UnwindSafe for LLama
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