pub struct MtmdInputChunks {
pub chunks: NonNull<mtmd_input_chunks>,
}Fields§
§chunks: NonNull<mtmd_input_chunks>Implementations§
Source§impl MtmdInputChunks
impl MtmdInputChunks
Sourcepub fn new() -> Result<Self, MtmdInputChunksError>
pub fn new() -> Result<Self, MtmdInputChunksError>
§Errors
Returns MtmdInputChunksError::ChunksCreationFailed if the underlying llama.cpp function
returns null.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, index: usize) -> Option<MtmdInputChunk>
pub fn total_tokens(&self) -> usize
pub fn total_positions(&self) -> i32
Sourcepub fn eval_chunks(
&self,
mtmd_ctx: &MtmdContext,
llama_ctx: &LlamaContext<'_>,
start_position: llama_pos,
seq_id: llama_seq_id,
n_batch: i32,
logits_last: bool,
) -> Result<llama_pos, MtmdEvalError>
pub fn eval_chunks( &self, mtmd_ctx: &MtmdContext, llama_ctx: &LlamaContext<'_>, start_position: llama_pos, seq_id: llama_seq_id, n_batch: i32, logits_last: bool, ) -> Result<llama_pos, MtmdEvalError>
§Errors
Returns MtmdEvalError::EvalFailure if any encoding or decoding operation fails.
Trait Implementations§
Source§impl Debug for MtmdInputChunks
impl Debug for MtmdInputChunks
Source§impl Drop for MtmdInputChunks
impl Drop for MtmdInputChunks
Auto Trait Implementations§
impl Freeze for MtmdInputChunks
impl RefUnwindSafe for MtmdInputChunks
impl !Send for MtmdInputChunks
impl !Sync for MtmdInputChunks
impl Unpin for MtmdInputChunks
impl UnsafeUnpin for MtmdInputChunks
impl UnwindSafe for MtmdInputChunks
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