Skip to main content

Module model

Module model 

Source
Expand description

The model tiers’ shared surface, re-exported from pdf-engine: the model specs, the failure types and the install paths (#641).

One definition and not a facade copy, for the reason the block model is re-exported rather than mirrored: a caller matching a model::ModelError from the facade and one from the engine must be matching the same type. The model tiers’ shared surface: specs, failures and install paths (#641). Always compiled; only the session half needs the ort feature. The model tiers’ shared surface: specs, failures and install paths (#641).

Always compiled, with or without the ort-layout cargo feature: the specs, the failure types and the path resolution of the shared ONNX Runtime layer are plain Rust, so a build without the tier still reports a missing model with the typed ModelError rather than a string. Only the session half of pdf_ocr::runtime – init, builder, session, SharedSession – needs the ort feature and the ort crate.

LAYOUT_EP03 is the balanced tier’s model. [balanced_unavailable] is what Quality::Balanced answers on a build without the tier.

Structs§

ModelError
A shared-layer failure.
ModelSpec
What a model package must provide.
RuntimeConfig
How the shared layer resolves files and sizes its pools.

Enums§

ModelErrorKind
What went wrong, in one of the two failure kinds the layer reports.

Constants§

LAYOUT_EP03
The layout model: Heron-ft ep03 (RT-DETRv2), ONNX export.
ORT_VERSION
The exact ONNX Runtime version this layer runs against.
TABLES_TATR
The tables model: TATR v1.1-all (Table Transformer structure), ONNX export.

Functions§

default_model_root
The per-user model root: <data dir>/pdfluent/models/, where the install commands put packages.
model_error
Find the ModelError in an error chain, if there is one.
resolve_model_file
Resolve the model file: resolve_model_root plus <spec.name>/<spec.file>, reported even when it is not there.
resolve_model_root
Resolve the model root: explicit dir, then PDFLUENT_MODEL_DIR, then the per-user default. An empty env var counts as unset, matching ort’s own reading of ORT_DYLIB_PATH.
resolve_ort_dylib
Resolve the runtime library: explicit path, then ORT_DYLIB_PATH, then <model dir>/onnxruntime-<version>/<platform library>, where the model dir is PDFLUENT_MODEL_DIR or the per-user default.