pub struct LlamaModel {
pub backend: Arc<LlamaLib>,
pub handle: *mut llama_model,
}Expand description
A loaded GGUF model
Fields§
§backend: Arc<LlamaLib>§handle: *mut llama_modelImplementations§
Source§impl LlamaModel
impl LlamaModel
pub fn load_from_file( backend: &LlamaBackend, path: &str, params: llama_model_params, ) -> Result<Self, LlamaError>
pub fn default_params(backend: &LlamaBackend) -> llama_model_params
pub fn get_vocab(&self) -> LlamaVocab
pub fn tokenize( &self, text: &str, add_special: bool, parse_special: bool, ) -> Result<Vec<llama_token>, LlamaError>
pub fn token_to_piece(&self, token: llama_token) -> String
pub fn apply_chat_template( &self, tmpl: Option<&str>, messages: &[ChatMessage], add_ass: bool, ) -> Result<String, LlamaError>
pub fn get_chat_template(&self, name: Option<&str>) -> Option<String>
Trait Implementations§
Auto Trait Implementations§
impl Forget for LlamaModel
impl Freeze for LlamaModel
impl RefUnwindSafe for LlamaModel
impl Unpin for LlamaModel
impl UnsafeUnpin for LlamaModel
impl UnwindSafe for LlamaModel
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