pub struct CodeFormula { /* private fields */ }Implementations§
Source§impl CodeFormula
impl CodeFormula
Sourcepub fn load_with(intra: usize) -> Option<Self>
pub fn load_with(intra: usize) -> Option<Self>
Load the three graphs + tokenizer from DOCLING_CODE_FORMULA_DIR
(default models/code_formula/). None when absent, with a one-time
warning from the caller’s slot.
Sourcepub fn predict(
&mut self,
crop: &RgbImage,
kind: CodeFormulaKind,
) -> Result<String, String>
pub fn predict( &mut self, crop: &RgbImage, kind: CodeFormulaKind, ) -> Result<String, String>
Run the VLM on a code/formula crop and return the post-processed text
(still carrying the <_language_> prefix for code — see
extract_code_language).
Auto Trait Implementations§
impl !Freeze for CodeFormula
impl !RefUnwindSafe for CodeFormula
impl !UnwindSafe for CodeFormula
impl Send for CodeFormula
impl Sync for CodeFormula
impl Unpin for CodeFormula
impl UnsafeUnpin for CodeFormula
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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