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 Forget for CodeFormula
impl Move for CodeFormula
impl Send for CodeFormulawhere
Session: Send,
RawVecInner: Send,
Regex: Send,
RawTable<(String, u32)>: Send,
RawTable<(u32, String)>: Send,
RawTable<((u32, u32), (u32, u32))>: Send,
RwLock<HashMap<String, Word>>: Send,
RwLock<HashMap<String, Vec<String>>>: Send,
RawTable<(u8, Node<u8>)>: Send,
RawTable<(String, SpecialToken)>: Send,
RawTable<(u32, AddedToken)>: Send,
RawTable<(String, ())>: Send,
Arc<dyn AcAutomaton>: Send,
impl Sync for CodeFormulawhere
Session: Sync,
RawVecInner: Sync,
Regex: Sync,
RawTable<(String, u32)>: Sync,
RawTable<(u32, String)>: Sync,
RawTable<((u32, u32), (u32, u32))>: Sync,
RwLock<HashMap<String, Word>>: Sync,
RwLock<HashMap<String, Vec<String>>>: Sync,
RawTable<(u8, Node<u8>)>: Sync,
RawTable<(String, SpecialToken)>: Sync,
RawTable<(u32, AddedToken)>: Sync,
RawTable<(String, ())>: Sync,
Arc<dyn AcAutomaton>: Sync,
impl Unpin for CodeFormulawhere
Arc<SharedSessionInner>: Unpin,
*const u8 is !null: Unpin,
*const i64 is !null: Unpin,
i64: Unpin,
*const String is !null: Unpin,
String: Unpin,
Box<ValueType>: Unpin,
*const OrtValueInfo is !null: Unpin,
*mut re_pattern_buffer: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
Arc<dyn AcAutomaton>: Unpin,
impl UnsafeUnpin for CodeFormulawhere
*const ArcInner<SharedSessionInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<SharedSessionInner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Outlet>: UnsafeUnpin,
PhantomData<NormalizerWrapper>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
*mut re_pattern_buffer: UnsafeUnpin,
PhantomData<PreTokenizerWrapper>: UnsafeUnpin,
PhantomData<(String, u32)>: UnsafeUnpin,
PhantomData<(u32, String)>: UnsafeUnpin,
PhantomData<((u32, u32), (u32, u32))>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<(String, Word)>: UnsafeUnpin,
PhantomData<(String, f64)>: UnsafeUnpin,
PhantomData<(String, Vec<String>)>: UnsafeUnpin,
PhantomData<(u8, Node<u8>)>: UnsafeUnpin,
PhantomData<Piece>: UnsafeUnpin,
PhantomData<(String, SpecialToken)>: UnsafeUnpin,
PhantomData<PostProcessorWrapper>: UnsafeUnpin,
PhantomData<DecoderWrapper>: UnsafeUnpin,
PhantomData<(len<4>, (char<'F'>, char<'u'>, char<'s'>, char<'e'>))>: UnsafeUnpin,
PhantomData<(len<12>, (char<'B'>, char<'y'>, char<'t'>, char<'e'>, (char<'F'>, char<'a'>), (char<'l'>, char<'l'>, char<'b'>, char<'a'>, char<'c'>, char<'k'>)))>: UnsafeUnpin,
PhantomData<(u32, AddedToken)>: UnsafeUnpin,
PhantomData<AddedToken>: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
*const ArcInner<dyn AcAutomaton> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn AcAutomaton>>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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