pub struct MtmdContext {
pub context: NonNull<mtmd_context>,
}Fields§
§context: NonNull<mtmd_context>Implementations§
Source§impl MtmdContext
impl MtmdContext
Sourcepub fn init_from_file(
mmproj_path: &str,
text_model: &LlamaModel,
params: &MtmdContextParams,
) -> Result<Self, MtmdInitError>
pub fn init_from_file( mmproj_path: &str, text_model: &LlamaModel, params: &MtmdContextParams, ) -> Result<Self, MtmdInitError>
§Errors
Returns an MtmdInitError variant matching the wrapper’s status code.
pub fn decode_use_non_causal(&self, chunk: &MtmdInputChunk) -> bool
pub fn decode_use_mrope(&self) -> bool
pub fn support_vision(&self) -> bool
pub fn support_audio(&self) -> bool
pub fn get_audio_sample_rate(&self) -> Option<u32>
Sourcepub fn tokenize(
&self,
text: MtmdInputText,
bitmaps: &[&MtmdBitmap],
) -> Result<MtmdInputChunks, MtmdTokenizeError>
pub fn tokenize( &self, text: MtmdInputText, bitmaps: &[&MtmdBitmap], ) -> Result<MtmdInputChunks, MtmdTokenizeError>
§Errors
Returns an MtmdTokenizeError variant matching the wrapper’s status code.
Sourcepub fn encode_chunk(
&self,
chunk: &MtmdInputChunk,
) -> Result<(), MtmdEncodeError>
pub fn encode_chunk( &self, chunk: &MtmdInputChunk, ) -> Result<(), MtmdEncodeError>
§Errors
Returns an MtmdEncodeError variant matching the wrapper’s status code.
Trait Implementations§
Source§impl Debug for MtmdContext
impl Debug for MtmdContext
Source§impl Drop for MtmdContext
impl Drop for MtmdContext
impl Send for MtmdContext
impl Sync for MtmdContext
Auto Trait Implementations§
impl Freeze for MtmdContext
impl RefUnwindSafe for MtmdContext
impl Unpin for MtmdContext
impl UnsafeUnpin for MtmdContext
impl UnwindSafe for MtmdContext
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more