Skip to main content

primary_weight_bytes

Function primary_weight_bytes 

Source
pub fn primary_weight_bytes(spec: &ModelSpec) -> Result<Vec<u8>, String>
Expand description

Read the bytes of a model’s primary (first) weight file for native inference.

Resolution: a locally-supplied file ($QSM_MODEL_DIR / cache) is used first; otherwise, with the download feature, it is fetched and cached. Returns a human-readable error if the file is neither local nor downloadable.

WASM hosts do not call this — they obtain the bytes in JavaScript (using the registry’s URLs) and pass them straight to onnx::OnnxModel::load.