pub struct MtmdInputText<'a> { /* private fields */ }Expand description
Text input for MtmdContext::tokenize.
The prompt string must contain the media marker (see
MtmdContext::default_marker) once for every bitmap to be embedded.
Implementations§
Source§impl<'a> MtmdInputText<'a>
impl<'a> MtmdInputText<'a>
Sourcepub fn new(text: &'a str, add_special: bool, parse_special: bool) -> Self
pub fn new(text: &'a str, add_special: bool, parse_special: bool) -> Self
Create a new MtmdInputText.
text– the prompt (must not contain interior NUL bytes)add_special– whether to add BOS/EOS tokensparse_special– whether to parse special tokens embedded in the text
§Panics
Panics if text contains an interior NUL byte.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MtmdInputText<'a>
impl<'a> RefUnwindSafe for MtmdInputText<'a>
impl<'a> Send for MtmdInputText<'a>
impl<'a> Sync for MtmdInputText<'a>
impl<'a> Unpin for MtmdInputText<'a>
impl<'a> UnsafeUnpin for MtmdInputText<'a>
impl<'a> UnwindSafe for MtmdInputText<'a>
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