pub struct LtxTextEncoder {
pub max_len: usize,
pub bos: u32,
pub pad: u32,
/* private fields */
}Expand description
The full prompt encoder.
Fields§
§max_len: usize§bos: u32§pad: u32Implementations§
Source§impl LtxTextEncoder
impl LtxTextEncoder
pub fn from_cmf(model: &Arc<CmfModel>) -> Result<LtxTextEncoder, String>
Sourcepub fn pad_ids(&self, ids: &[u32]) -> (Vec<u32>, Vec<f32>)
pub fn pad_ids(&self, ids: &[u32]) -> (Vec<u32>, Vec<f32>)
Left-pad the prompt to the encoder’s window, prepending BOS — the layout the reference tokenizer produces.
Every one of the 49 hidden states, in HF’s order: the scaled embedding first, then each layer’s output.
Auto Trait Implementations§
impl Freeze for LtxTextEncoder
impl RefUnwindSafe for LtxTextEncoder
impl Send for LtxTextEncoder
impl Sync for LtxTextEncoder
impl Unpin for LtxTextEncoder
impl UnsafeUnpin for LtxTextEncoder
impl UnwindSafe for LtxTextEncoder
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