pub fn prefetch_with_progress(
id: &str,
on_progress: &mut dyn FnMut(&str, u64, u64),
) -> Result<(), String>Expand description
Pre-fetch (download + cache) all of a model’s weight files, reporting per-file
progress via on_progress(file_name, downloaded_bytes, total_bytes).
Intended for hosts (e.g. QSMxT) that want to show a download bar before running
inference: call this first, then the normal primary_weight/weights path finds the
files and does no further network I/O. Files already present (supplied with
provide_weights, in $QSM_MODEL_DIR or the cache) are skipped silently. Unknown id
(a non-model / classical algorithm) is a no-op — returns Ok(()) so callers can invoke it
unconditionally. On wasm32-unknown-unknown a file that was not supplied is an error.