pub struct MtmdImageTokens<'chunks> { /* private fields */ }Expand description
Image/audio token metadata attached to a non-text MtmdInputChunk.
Implementations§
Source§impl MtmdImageTokens<'_>
impl MtmdImageTokens<'_>
Sourcepub fn n_pos(&self) -> i32
pub fn n_pos(&self) -> i32
Number of temporal positions (M-RoPE variant; equals n_tokens otherwise).
Sourcepub fn decoder_positions(&self, pos_0: i32) -> Vec<MtmdDecoderPos>
pub fn decoder_positions(&self, pos_0: i32) -> Vec<MtmdDecoderPos>
Compute the per-token decoder positions used by M-RoPE models.
Returns a vector of length n_tokens. Each entry
is relative to pos_0; for non-M-RoPE models this typically reduces
to (0, i, 0, 0) for the i-th token.
Wraps mtmd_helper_image_get_decoder_pos.
Trait Implementations§
Auto Trait Implementations§
impl<'chunks> Freeze for MtmdImageTokens<'chunks>
impl<'chunks> RefUnwindSafe for MtmdImageTokens<'chunks>
impl<'chunks> !Send for MtmdImageTokens<'chunks>
impl<'chunks> !Sync for MtmdImageTokens<'chunks>
impl<'chunks> Unpin for MtmdImageTokens<'chunks>
impl<'chunks> UnsafeUnpin for MtmdImageTokens<'chunks>
impl<'chunks> UnwindSafe for MtmdImageTokens<'chunks>
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