pub struct MaskPredictor { /* private fields */ }Expand description
Predicts attention masks from prompt information
Implementations§
Source§impl MaskPredictor
impl MaskPredictor
Sourcepub fn new(config: PredictorConfig) -> Self
pub fn new(config: PredictorConfig) -> Self
Create a new predictor with default settings
Sourcepub fn predict(
&self,
prompt: &str,
step: Option<u32>,
total_steps: Option<u32>,
) -> Prediction
pub fn predict( &self, prompt: &str, step: Option<u32>, total_steps: Option<u32>, ) -> Prediction
Predict mask from prompt text
Sourcepub fn predict_from_embedding(
&self,
embedding: &[f32],
step: Option<u32>,
total_steps: Option<u32>,
) -> Prediction
pub fn predict_from_embedding( &self, embedding: &[f32], step: Option<u32>, total_steps: Option<u32>, ) -> Prediction
Predict mask from embedding vector (for faster prediction)
Sourcepub fn set_total_steps(&mut self, total_steps: usize)
pub fn set_total_steps(&mut self, total_steps: usize)
Update step multipliers for different total step counts
Sourcepub fn config(&self) -> &PredictorConfig
pub fn config(&self) -> &PredictorConfig
Get current configuration
Trait Implementations§
Source§impl Clone for MaskPredictor
impl Clone for MaskPredictor
Source§fn clone(&self) -> MaskPredictor
fn clone(&self) -> MaskPredictor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MaskPredictor
impl RefUnwindSafe for MaskPredictor
impl Send for MaskPredictor
impl Sync for MaskPredictor
impl Unpin for MaskPredictor
impl UnsafeUnpin for MaskPredictor
impl UnwindSafe for MaskPredictor
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