1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Safe, synchronous CoreML runtime layer.
//!
//! Wraps `objc2-core-ml` behind owned types: [`Model`] (load / compile /
//! prewarm / predict / stateful predict), [`MultiArray`] (typed N-d tensors,
//! including IOSurface-backed `f16`), and [`Features`] (named model I/O).
//! All `unsafe` FFI lives inside this crate; the public API is safe.
//!
//! macOS only. Mirrors the CoreML surface used by Argmax's WhisperKit
//! (`MLModelExtensions` / `MLMultiArrayExtensions` in argmax-oss-swift).
//!
//! That core is always compiled, and `default = []` pulls no pipeline
//! dependencies. The opt-in pipelines built on it are feature-gated submodules
//! of [`audio`] (`whisper`, `align`, `speaker`, `vad`, `ced`, `lid`) and
//! [`embeddings`] (`clap`, `granite`, `siglip`) — speech, sound-event tagging,
//! spoken-language identification, and audio/text/image embeddings
//! respectively.
//!
//! # Example
//!
//! ```no_run
//! use coremlit::{ComputeUnits, DataType, Features, Model, MultiArray};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let model = Model::load("MelSpectrogram.mlmodelc", ComputeUnits::CpuAndGpu)?;
//! let audio = MultiArray::zeros(&[480_000], DataType::F32)?;
//! let outputs = model.predict(&Features::new().with("audio", audio))?;
//! let mel = outputs.get("melspectrogram_features").unwrap();
//! assert_eq!(mel.data_type(), DataType::F16);
//! # Ok(())
//! # }
//! ```
pub use DataType;
pub use ;
pub use Features;
/// Half-precision element type, re-exported for [`Element`] consumers.
pub use f16;
pub use ;
pub use ;
pub use State;
pub use ;
// The in-lib model gates outnumber every `tests/` binary's put together, and a
// modelless run reports them as `ignored` and nothing else. See the module.