pub mod admission;
pub mod artifact;
pub mod cache;
pub mod error;
pub mod handler;
pub mod limits;
pub mod loader;
pub mod manifest;
pub mod node;
pub mod offline;
pub mod onnx;
pub mod runtimes;
pub use admission::{
AdmissionDeps, AdmissionJob, AdmissionOutcome, AdmissionQueue, AdmissionState, Stats,
admission_json, admit, check_boundary,
};
pub use artifact::{ArtifactRef, ArtifactStore, FetchError, HeadInfo};
pub use cache::{CacheKey, LoadedCache};
pub use error::{Category, Failure};
pub use handler::{ArtifactSource, InferenceHost, ModelInferHandler, ModelSource, load_model};
pub use limits::Limits;
pub use loader::{ManifestEntry, ModelEntry, ModelLoadIssue, ModelSet, literal_references};
pub use manifest::{ABI, ArtifactReference, InputDecl, Manifest, OutputDecl, is_model_manifest};
pub use node::{ModelsRuntime, node_name};
pub use offline::{LocalArtifacts, OfflineModels};
pub use onnx::{GraphStats, read_stats};
pub use runtimes::{
BoundInput, LoadBinding, LoadError, LoadedModel, ModelRuntime, ModelRuntimes, RunError,
TractRuntime,
};
#[cfg(test)]
pub(crate) mod fixture {
pub const ONNX: &[u8] = include_bytes!("../../tests/fixtures/models/c4-tiny/c4-tiny.onnx");
pub const MANIFEST: &str = include_str!("../../tests/fixtures/models/c4-tiny/model.json");
pub const TWO_OUT_ONNX: &[u8] =
include_bytes!("../../tests/fixtures/models/two-out/two-out.onnx");
pub const TWO_OUT_A: &str = include_str!("../../tests/fixtures/models/two-out/order-a.json");
pub const TWO_OUT_B: &str = include_str!("../../tests/fixtures/models/two-out/order-b.json");
pub const AS_INIT_ONNX: &[u8] =
include_bytes!("../../tests/fixtures/models/weights/as-init.onnx");
pub const AS_CONST_ONNX: &[u8] =
include_bytes!("../../tests/fixtures/models/weights/as-const.onnx");
pub const AS_LIST_ONNX: &[u8] =
include_bytes!("../../tests/fixtures/models/weights/as-list.onnx");
pub const DYNAMIC_ONNX: &[u8] =
include_bytes!("../../tests/fixtures/models/dynamic/scale.onnx");
pub const DYNAMIC_MANIFEST: &str =
include_str!("../../tests/fixtures/models/dynamic/model.json");
pub fn dynamic() -> super::Manifest {
super::Manifest::parse(DYNAMIC_MANIFEST).expect("the dynamic manifest is valid")
}
pub fn manifest() -> super::Manifest {
super::Manifest::parse(MANIFEST).expect("the fixture manifest is valid")
}
pub fn two_out() -> (super::Manifest, super::Manifest) {
(
super::Manifest::parse(TWO_OUT_A).expect("the order-a manifest is valid"),
super::Manifest::parse(TWO_OUT_B).expect("the order-b manifest is valid"),
)
}
}