Skip to main content

download

Function download 

Source
pub async fn download(
    model: &HubModel,
    option_id: Option<&str>,
    dest_dir: &Path,
    progress: Option<ProgressCallback>,
    cancel: Option<Arc<AtomicBool>>,
) -> Result<PathBuf, String>
Expand description

Stream-download a model’s variant into dest_dir, emitting stage: "download" progress, then verify sha256 if the option pins one. Streams to a .part file and renames on success.